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

drush site-install returns improper exit code #4034

Closed
Leksat opened this issue Apr 5, 2019 · 2 comments
Closed

drush site-install returns improper exit code #4034

Leksat opened this issue Apr 5, 2019 · 2 comments

Comments

@Leksat
Copy link
Contributor

Leksat commented Apr 5, 2019

If site installation fails, Drush exists with 0.

$ ./vendor/bin/drush site-install -y minimal --sites-subdir default --config-dir ../config/sync

 // You are about to DROP all tables in your 'sites/default/files/.sqlite' database. Do you want to continue?: yes.

 [notice] Starting Drupal installation. This takes a while.
TypeError: Argument 2 passed to ...
 [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

$ echo $?
0
Q A
Drush version 9.6.1
Drupal version 8.6.13
PHP version 7.3.3
OS Mac

Probably the same issue as in #2223

@Leksat
Copy link
Contributor Author

Leksat commented Apr 8, 2019

Yeah, this seems to be a general issue with exit codes. Just noticed the same bug with the config-import command:

$ drush -y cim
 ...
 // Import the listed configuration changes?: yes.
 [error]  TypeError: Argument 1 passed to ...
 [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

$ echo $?
0

m4olivei added a commit to m4olivei/drush that referenced this issue May 24, 2019
* master:
  Remove latest unstable chiclet. Its not helpful.
  Remove mentions of Shippable. (drush-ops#4079)
  Add mysql service to Travis config. (drush-ops#4078)
  Fix link in docs.
  More docs about dynamic users in site.yml files.
  Fix drush-ops#4055. Sort inside namespaces in list command. (drush-ops#4057)
  Print class name in drush_op()
  Update dependencies. (drush-ops#4051)
  UNISH_NO_TIMEOUTS is unused since we moved to CLITrait. (drush-ops#4047)
  Add jsonapi command (drush-ops#4045)
  Fixes drush-ops#4034: Ensure that status code is nonzero on invalid shutdown (drush-ops#4037)
  Add webflo/drupal-core-require-dev (drush-ops#4041)
  Fix TTY detection for runserver command. (drush-ops#4033)
  Add vagrant transport to Drush. (drush-ops#4036)
@mbomb007
Copy link

I just had this issue when running any Drush command with the following packages installed:

php-apcu/jammy,now 5.1.24-1+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-common/jammy,now 2:95+ubuntu22.04.1+deb.sury.org+1 all [installed,automatic]
php-dev/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-gd/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-json/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed,automatic]
php-ldap/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-mbstring/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-mysql/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-pear/jammy,now 1:1.10.12+submodules+notgz+20210212-1ubuntu3 all [installed]
php-xml/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-zip/jammy,now 2:8.3+95+ubuntu22.04.1+deb.sury.org+1 all [installed]
php8.3-apcu/jammy,now 5.1.24-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-cli/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-common/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-curl/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-dev/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-fpm/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-gd/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-ldap/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-mbstring/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-mysql/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-opcache/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-readline/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-xml/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-zip/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3/jammy,now 8.3.13-1+ubuntu22.04.1+deb.sury.org+1 all [installed]
php8.4-apcu/jammy,now 5.1.24-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.4-cli/now 8.4.0~rc3-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 8.4.0~rc4-1+ubuntu22.04.1+deb.sury.org+1]
php8.4-common/now 8.4.0~rc3-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 8.4.0~rc4-1+ubuntu22.04.1+deb.sury.org+1]
php8.4-opcache/now 8.4.0~rc3-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 8.4.0~rc4-1+ubuntu22.04.1+deb.sury.org+1]
php8.4-phpdbg/now 8.4.0~rc3-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 8.4.0~rc4-1+ubuntu22.04.1+deb.sury.org+1]
php8.4-readline/now 8.4.0~rc3-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 8.4.0~rc4-1+ubuntu22.04.1+deb.sury.org+1]

Running sudo apt remove php8.4\* fixed the issue. So I'm not sure if there is something in PHP 8.4 that causes the issue to occur.

The error looked like this, and the exit code was still zero, so my custom set_warning function wasn't run.

vendor/bin/drush cr || set_warning
 [preflight] Class "DOMDocument" does not exist
 [warning] Drush command terminated abnormally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants