weixin_39613712
weixin_39613712
2020-12-27 01:58

Fails with post-code-update cloud hook on Acquia Cloud.

My system information: * Operating system type: macOS * Operating system version: 10.12.4 * BLT version: 8.8.2

The first time I encountered this problem was when updating 'blt' from 8.6.15 to 8.8.2 on another project. At that time I thought that my project had a cause but this happened even when I started a new project.

Output of blt doctor:


Changed current directory to /Users/snize/.composer
+----------------------+----------------------------------------------------------------------------------+
| Property             | Value                                                                            |
+----------------------+----------------------------------------------------------------------------------+
| %paths               |                                                                                  |
|  - %root             | /Users/snize/dev/MY_PROJECT/docroot                                              |
|  - %site             | sites/default                                                                    |
|  - %modules          | modules                                                                          |
|  - %themes           | themes                                                                           |
| blt-version          | 8.8.2                                                                            |
| drupal-settings-file | sites/default/settings.php                                                       |
| drupal-version       | 8.3.0                                                                            |
| drush-alias-files    | /Users/snize/.drush/glocal.aliases.drushrc.php                                   |
|                      | /Users/snize/.drush/selfturn.aliases.drushrc.php                                 |
|                      | /Users/snize/dev/MY_PROJECT/docroot/../drush/site-aliases/aliases.drushrc.php    |
|                      | /Users/snize/dev/MY_PROJECT/docroot/../drush/site-aliases/example.acsf.aliases.d |
|                      | rushrc.php                                                                       |
|                      | /Users/snize/dev/MY_PROJECT/docroot/../drush/site-aliases/example.local.aliases. |
|                      | drushrc.php                                                                      |
| drush-conf           | /Users/snize/dev/MY_PROJECT/drush/drushrc.php                                    |
| drush-script         | /Users/snize/dev/MY_PROJECT/vendor/drush/drush/drush.php                         |
| drush-temp           | /tmp                                                                             |
| drush-version        | 8.1.10                                                                           |
| modules              | modules                                                                          |
| php-bin              | /usr/local/opt/php70/bin/php                                                     |
| php-conf             | /usr/local/etc/php/7.0/php.ini                                                   |
| php-os               | Darwin                                                                           |
| root                 | /Users/snize/dev/MY_PROJECT/docroot                                              |
| site                 | sites/default                                                                    |
| themes               | themes                                                                           |
| uri                  | default                                                                          |
+----------------------+----------------------------------------------------------------------------------+
+--------------------------+---------------------------------------------------------------------------------+
| Check                    | Outcome                                                                         |
+--------------------------+---------------------------------------------------------------------------------+
| checkDocrootExists       | Found docroot.                                                                  |
| checkCoreExists          | Drupal core exists                                                              |
| checkSettingsFile        | Found settings file.                                                            |
| checkSettingsFile        | BLT settings are not included in settings file.                                 |
| checkLocalSettingsFile   | Could not find local settings file.                                             |
|                          | Your local settings file should exist at                                        |
|                          | /Users/snize/dev/MY_PROJECT/docroot/sites/default/settings/local.settings.php.  |
| checkLocalDrushFile      | Local drushrc file does not exist.                                              |
|                          | Create /Users/snize/dev/MY_PROJECT/docroot/sites/default/local.drushrc.php.     |
|                          | Run `blt setup:drush:settings` to generate it automatically, or run `blt setup` |
|                          | to run the entire setup process.                                                |
| checkFileSystem:%files   | Public files directory is not set.                                              |
| checkFileSystem:%private | Private files directory is not set.                                             |
| checkFileSystem:%temp    | Temporary files directory is not set.                                           |
| checkDbConnection        | Could not connect to MySQL database.                                            |
|                          |                                                                                 |
|                          | Is your *AMP stack running?                                                     |
|                          | Are your database credentials correct?                                          |
|                          |   db-driver:                                                                    |
|                          |   db-hostname:                                                                  |
|                          |   db-username:                                                                  |
|                          |   db-password:                                                                  |
|                          |   db-name:                                                                      |
|                          |   db-port:                                                                      |
|                          |                                                                                 |
|                          | Are you using the correct PHP binary?                                           |
|                          | Is PHP using the correct MySQL socket?                                          |
|                          |   php-os: Darwin                                                                |
|                          |   php-bin: /usr/local/opt/php70/bin/php                                         |
|                          |   php-conf: Array                                                               |
|                          |   php-mysql:                                                                    |
|                          |                                                                                 |
|                          | Are you using the correct site and settings.php file?                           |
|                          |   site: sites/default                                                           |
|                          |   drupal-settings-file: sites/default/settings.php                              |
|                          |                                                                                 |
|                          | To verify, run `drush sqlc`                                                     |
|                          |                                                                                 |
| checkDrupalBootstrapped  | Could not bootstrap Drupal via drush without alias.                             |
| checkDrupalInstalled     | Drupal is not installed.                                                        |
|                          |                                                                                 |
|                          | Run `blt local:setup` to install Drupal locally.                                |
| checkCaching:page        | Drupal cache is disabled.                                                       |
| checkCaching:css         | CSS preprocessing is disabled.                                                  |
| checkCaching:js          | JS preprocessing is disabled.                                                   |
| checkNvmExists           | NVM does not exist.                                                             |
|                          |                                                                                 |
|                          | It is recommended that you use NVM to manage multiple versions of NodeJS on one |
|                          | machine.                                                                        |
|                          | Instructions for installing NVM can be found at:                                |
|                          |   https://github.com/creationix/nvm#installation                                |
| checkComposer:require    | acquia/blt is in composer.json's require object.                                |
| checkComposer:plugins    | hirak/prestissimo plugin for composer is installed.                             |
| checkBehat:exists        | tests/behat/local.yml is missing!                                               |
|                          |   Run `blt setup:behat` to generate it from example.local.yml.                  |
| checkProjectYml:keys     | project.yml has no deprecated keys.                                             |
| checkPhpDateTimezone     | PHP setting for date.timezone is correctly set                                  |
+--------------------------+---------------------------------------------------------------------------------+

When I run this command:

Step 1. Created fresh project.


composer clear-cache
export COMPOSER_PROCESS_TIMEOUT=2000
composer create-project --no-interaction acquia/blt-project MY_PROJECT
cd MY_PROJECT

Step 2. Installed could hook.


blt setup:cloud-hooks                                                   
blt > setup:cloud-hooks:
     [copy] Created 18 empty directories in /Users/snize/dev/MY_PROJECT/hooks
     [copy] Copying 5 files to /Users/snize/dev/MY_PROJECT/hooks

BUILD FINISHED; 0.8411 seconds

Step 3. Added remote repo to project.yml and commit to git. Step 4. Deploy with blt to acquia cloud.


blt deploy -Ddeploy.branch=master -Ddeploy.commitMsg='First commit';

I get the following output on acquia cloud Task Log:


[03:09:46] [03:09:46] Started

[03:10:03] [2017-04-18 03:09:59] Starting hook: post-code-update
[2017-04-18 03:10:01] Executing: /mnt/users/pipeline4test/dev.shell /var/www/html/pipeline4test.dev/hooks/common/post-code-update/post-code-update.sh pipeline4test dev master master pipeline4test-5767.devcloud.hosting.acquia.com:pipeline4test.git git < /dev/null (as pipeline4test.dev-6361})
Running updates for environment: dev
[00;36m [property] Loading /mnt/www/html/pipeline4testr3vu6d336n/blt/project.yml[0m
[00;32mblt > deploy:update:[0m
[00;36m [property] Loading /mnt/www/html/pipeline4testr3vu6d336n/blt/project.yml[0m
[00;32mblt > deploy:update:site:[0m
[00;36m     [echo] Deploying updates to default[0m
[00;36m [property] Loading /mnt/www/html/pipeline4testr3vu6d336n/blt/project.yml[0m
[00;32mblt > setup:config-import:[0m
[00;36m [property] Loading /mnt/www/html/pipeline4testr3vu6d336n/blt/project.yml[0m
[00;32mblt > target-hook:invoke:[0m
[00;36m     [echo] Executing command in /mnt/www/html/pipeline4testr3vu6d336n/docroot:[0m
[00;36m     [exec] Executing command: echo 'No pre-config-import configured.'[0m
No pre-config-import configured.
[00;36m    [drush] Changing working directory to: /mnt/www/html/pipeline4testr3vu6d336n/docroot[0m
[00;36m    [drush] Executing: /mnt/www/html/pipeline4testr3vu6d336n/vendor/bin/drush --include=../drush --uri=default --yes --verbose cc drush 2>&1[0m
[00;36m    [drush] Include ../drush                                                        [notice][0m
[00;36m    [drush] 'drush' cache was cleared.                                             [success][0m
[00;36m    [drush] Command dispatch complete                                               [notice][0m
[00;36m    [drush] Changing working directory back to /mnt/www/html/pipeline4testr3vu6d336n/vendor/acquia/blt/phing.[0m
[00;36m     [echo] Importing configuration...[0m
[00;36m    [drush] Changing working directory to: /mnt/www/html/pipeline4testr3vu6d336n/docroot[0m
[00;36m    [drush] Executing: /mnt/www/html/pipeline4testr3vu6d336n/vendor/bin/drush --include=../drush --uri=default --yes --verbose pm-enable config 2>&1[0m
[00;36m    [drush] Include ../drush                                                        [notice][0m
[00;36m    [drush] Command pm-enable needs a higher bootstrap level to run - you will       [error][0m
[00;36m    [drush] need to invoke drush from a more functional Drupal environment to run[0m
[00;36m    [drush] this command.[0m
[00;36m    [drush] The drush command 'pm-enable config' could not be executed.              [error][0m
[00;36m    [drush] Drush was not able to start (bootstrap) the Drupal database.             [error][0m
[00;36m    [drush] Hint: This may occur when Drush is trying to:[0m
[00;36m    [drush]  * bootstrap a site that has not been installed or does not have a[0m
[00;36m    [drush] configured database. In this case you can select another site with a[0m
[00;36m    [drush] working database setup by specifying the URI to use with the --uri[0m
[00;36m    [drush] parameter on the command line. See `drush topic docs-aliases` for[0m
[00;36m    [drush] details.[0m
[00;36m    [drush]  * connect the database through a socket. The socket file may be[0m
[00;36m    [drush] wrong or the php-cli may have no access to it in a jailed shell. See[0m
[00;36m    [drush] http://drupal.org/node/1428638 for details.[0m
[00;36m    [drush] [0m
[00;36m    [drush] Drush was attempting to connect to:[0m
[00;36m    [drush]  Drupal version      :  8.3.0[0m
[00;36m    [drush]  Site URI            :  default[0m
[00;36m    [drush]  PHP executable      :  /usr/local/php5.6/bin/php[0m
[00;36m    [drush]  PHP configuration   :  /usr/local/php5.6/etc/cli/php.ini[0m
[00;36m    [drush]  PHP OS              :  Linux[0m
[00;36m    [drush]  Drush script        :  /mnt/www/html/pipeline4testr3vu6d336n/vendo[0m
[00;36m    [drush]                         r/drush/drush/drush.php[0m
[00;36m    [drush]  Drush version       :  8.1.10[0m
[00;36m    [drush]  Drush temp          :  /mnt/tmp/pipeline4testr3vu6d336n[0m
[00;36m    [drush]  directory[0m
[00;36m    [drush]  Drush               :  /mnt/www/html/pipeline4testr3vu6d336n/drush[0m
[00;36m    [drush]  configuration          /drushrc.php /etc/drush/drushrc.php[0m
[00;36m    [drush]  Drush alias files   :  /mnt/drush/pipeline4test/pipeline4test.alia[0m
[00;36m    [drush]                         ses.drushrc.php[0m
[00;36m    [drush]                         /mnt/www/html/pipeline4testr3vu6d336n/docro[0m
[00;36m    [drush]                         ot/../drush/site-aliases/aliases.drushrc.ph[0m
[00;36m    [drush]                         p[0m
[00;36m    [drush]  Drupal root         :  /mnt/www/html/pipeline4testr3vu6d336n/docro[0m
[00;36m    [drush]                         ot[0m
[00;36m    [drush]  Drupal Settings     :  sites/default/settings.php[0m
[00;36m    [drush]  File[0m
[00;36m    [drush]  Site path           :  sites/default[0m
[00;36m    [drush] [0m
[00;36m    [drush] [0m
[00;36m    [drush] Changing working directory back to /mnt/www/html/pipeline4testr3vu6d336n/vendor/acquia/blt/phing.[0m
[01;31m[phingcall] /mnt/www/html/pipeline4testr3vu6d336n/./vendor/acquia/blt/phing/tasks/setup.xml:183:8: /mnt/www/html/pipeline4testr3vu6d336n/./vendor/acquia/blt/phing/tasks/setup.xml:195:45: Drush exited with code 1[0m
[01;31m  [foreach] /mnt/www/html/pipeline4testr3vu6d336n/./vendor/acquia/blt/phing/tasks/deploy.xml:311:22: Execution of the target buildfile failed. Aborting.[0m
[01;31m
BUILD FAILED/mnt/www/html/pipeline4testr3vu6d336n/./vendor/acquia/blt/phing/tasks/deploy.xml:306:31: Execution of the target buildfile failed. Aborting.
; 1.2516 second[0m
Update errored.
[2017-04-18 03:10:03] Finished hook: post-code-update

[2017-04-18 03:10:03] WARN: Command returned exit code 1: /mnt/users/pipeline4test/dev.shell /var/www/html/pipeline4test.dev/hooks/common/post-code-update/post-code-update.sh pipeline4test dev master master pipeline4test-5767.devcloud.hosting.acquia.com:pipeline4test.git git executing hook post-code-update in dev environment
zlib(finalizer): the stream was freed prematurely.

And I expected this to happen:

该提问来源于开源项目:acquia/blt

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39613712 weixin_39613712 3月前

    Thank you for your reply. The project 'Pipeline4test' did just use to reproduce the problem. The real problem occurred when updating blt from 8.6.15 to 8.8.2 on an existing site. Does that answer your question?

    This problem did not occur in 8.6.15. It seems like the #1200 that changed when updating to 8.7.x or 8.8.x seems to be affected, but I am not sure. However, errors came to occur in that place.

    点赞 评论 复制链接分享
  • weixin_39603357 weixin_39603357 3月前

    Can you SSH into the server, cd to /mnt/www/html/pipeline4testr3vu6d336n/docroot and execute drush status? It still seems like Drupal is not installed. Can you tell me the output?

    点赞 评论 复制链接分享
  • weixin_39613712 weixin_39613712 3月前

    I discovered that this problem lies in the failure to uninstall Contact Storage Module in my project. I am terribly sorry about this. I Fix this problem with removing some record form database and reinstall Contact Storage Module.

    点赞 评论 复制链接分享
  • weixin_39603357 weixin_39603357 3月前

    Have you already installed Drupal on the environment?

    点赞 评论 复制链接分享
  • weixin_39613712 weixin_39613712 3月前

    Yes, Drupal is installed on both new projects and existing projects.

    点赞 评论 复制链接分享
  • weixin_39603357 weixin_39603357 3月前

    I don't quite understand your answer. What is the context of new vs existing projects?

    It looks like these could hooks are on your dev environment. Can you verify that Drupal is already installed on the dev environment on Acquia Cloud? E.g., if you visit it in a browser, can you view the Drupal front page?

    The cloud hooks are intended to update and already installed site. If you want to instead install the site from scratch in a cloud hook, you'll need to replace deploy_updates with deploy_install in your cloud hook file.

    点赞 评论 复制链接分享