Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drupal-scaffold plugin fails after latest image release #923

Closed
alexdesignworks opened this Issue Feb 28, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@alexdesignworks
Copy link

alexdesignworks commented Feb 28, 2019

Describe the bug
For Drupal 8, I'm using drupal-scaffold plugin (https://github.com/drupal-composer/drupal-scaffold). This plugin downloads several Drupal files from the drupal.org repository into current Drupal project docroot.

The problem is that after recent images release the plugin stopped working, reporting the following message

  - Downloading 1/7: http://cgit.drupalcode.org/drupal/plain/index.php
Script DrupalComposer\DrupalScaffold\Plugin::scaffold handling the post-install-cmd event terminated with an exception
                                                                                                                                                                                                                                                                                                                                                      
  [Exception]                                                                                                                                                                                                                                                                                                                                         
  Failed to download http://cgit.drupalcode.org/drupal/plain/.gitattributes, http://cgit.drupalcode.org/drupal/plain/.htaccess, http://cgit.drupalcode.org/drupal/plain/robots.txt, http://cgit.drupalcode.org/drupal/plain/update.php, http://cgit.drupalcode.org/drupal/plain/.editorconfig, http://cgit.drupalcode.org/drupal/plain/.eslintignore                                                              

This problem appears only if hirak/prestissimo package is installed (and it is installed into Lagoon php images). drupal-scaffold has a class that supports hirak/prestissimo and uses it for parallel downloads. The hirak/prestissimo package uses PHP's curl_multi_* functions to use unblocking parallel downloads.
http://php.net/manual/en/function.curl-multi-init.php

After debugging and setting curl option to be verbose, the following output was produced:

Verbose output from PHPs curl:

------------------- ESTABLISHING CONNECTTION AND FIRST REQUEST - OKAY
*   Trying 151.101.2.49...
* TCP_NODELAY set
* Expire in 149982 ms for 3 (transfer 0x564c99f6e720)
* Expire in 200 ms for 4 (transfer 0x564c99f6e720)
* Hostname 'cgit.drupalcode.org' was found in DNS cache
* Expire in 11 ms for 1 (transfer 0x564c99f68d00)
*   Trying 151.101.2.49...
* TCP_NODELAY set
* Expire in 149982 ms for 3 (transfer 0x564c99f68d00)
* Expire in 200 ms for 4 (transfer 0x564c99f68d00)
* Connected to cgit.drupalcode.org (151.101.2.49) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* Connected to cgit.drupalcode.org (151.101.2.49) port 443 (#1)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Fastly, Inc.; CN=q2.shared.global.fastly.net
*  start date: Feb 19 18:28:24 2019 GMT
*  expire date: Oct 11 20:12:15 2019 GMT
*  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign CloudSSL CA - SHA256 - G3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x564c99f6e720)
> GET /drupal/plain/.eslintignore?h=8.6.10 HTTP/2
Host: cgit.drupalcode.org
User-Agent: Composer/1.6.5 (Linux; 4.9.125-linuxkit; PHP 7.3.2)
Accept: */*
Accept-Encoding: deflate, gzip

* old SSL session ID is stale, removing
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=Fastly, Inc.; CN=q2.shared.global.fastly.net
*  start date: Feb 19 18:28:24 2019 GMT
*  expire date: Oct 11 20:12:15 2019 GMT
*  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign CloudSSL CA - SHA256 - G3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x564c99f68d00)
> GET /drupal/plain/.editorconfig?h=8.6.10 HTTP/2
Host: cgit.drupalcode.org
User-Agent: Composer/1.6.5 (Linux; 4.9.125-linuxkit; PHP 7.3.2)
Accept: */*
Accept-Encoding: deflate, gzip

* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200 
< server: nginx
< content-type: text/plain; charset=UTF-8
< content-disposition: inline; filename=".eslintignore"
< expires: Thu, 28 Feb 2019 08:16:08 GMT
< last-modified: Thu, 28 Feb 2019 08:16:08 GMT
< etag: "9c134873d484956a9b6c87447e82b792cd27334c-gzip"
< content-encoding: gzip
< via: 1.1 varnish
< cache-control: no-cache
< accept-ranges: bytes
< date: Thu, 28 Feb 2019 11:12:01 GMT
< via: 1.1 varnish
< age: 10551
< x-served-by: cache-sea1033-SEA, cache-mel19030-MEL
< x-cache: HIT, HIT
< x-cache-hits: 1, 3
< x-timer: S1551352321.211954,VS0,VE6
< vary: Accept-Encoding
< content-length: 94
< 
* Connection #0 to host cgit.drupalcode.org left intact
-------------------SECOND REQUEST - FAILS

* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200 
< server: nginx
< content-type: text/plain; charset=UTF-8
< content-disposition: inline; filename=".editorconfig"
< expires: Thu, 28 Feb 2019 08:16:05 GMT
< last-modified: Thu, 28 Feb 2019 08:16:05 GMT
< etag: "686c443ceca7e4aaccd384ba6b36afe43337104f-gzip"
< content-encoding: gzip
< via: 1.1 varnish
< cache-control: no-cache
< accept-ranges: bytes
< date: Thu, 28 Feb 2019 11:12:01 GMT
< via: 1.1 varnish
< age: 10553
< x-served-by: cache-sea1033-SEA, cache-mel19022-MEL
< x-cache: HIT, HIT
< x-cache-hits: 1, 3
< x-timer: S1551352321.244465,VS0,VE4
< vary: Accept-Encoding
< content-length: 252
< 
* Could not resolve host: cgit.drupalcode.org
* Closing connection 1

This issue has been replicated in 4 different environments with amazeeio/php:7.1-cli-drupal, amazeeio/php:7.2-cli-drupal, and amazeeio/php:7.3-cli-drupal images.

To Reproduce
Steps to reproduce the behavior:

  1. docker pull amazeeio/php:7.2-cli-drupal
  2. docker run --rm --interactive --tty <IMAGE ID HERE> bash
  3. composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction --ignore-platform-reqs
  4. See error

Expected behavior
The command should complete successfully

Temp workaround
Uninstall hirak/prestissimo from the image during the build, but this will significantly slow down the build process.

The place where the downloading error originates is this https://github.com/drupal-composer/drupal-scaffold/blob/master/src/PrestissimoFileFetcher.php#L64

@Schnitzel

This comment has been minimized.

@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Feb 28, 2019

opened up an issue in drupal-scaffold drupal-composer/drupal-scaffold#102

@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Feb 28, 2019

opened an issue at curl:
curl/curl#3629

@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Feb 28, 2019

actually I realized that our PHP Images are running an apk upgrade which upgrades curl from 7.63.0 to 7.64.0.
As 7.63.0 does not have the issue I removed the upgrade which will ship our lagoon images also with 7.63.0:
#925

As soon as building is confirmed I will hotrelease new php images.

@alexdesignworks

This comment has been minimized.

Copy link
Author

alexdesignworks commented Feb 28, 2019

@Schnitzel Thank you for looking into this urgently!

I can confirm on my side that new images solve the problem. Please consider this resolved. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.