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

Unattended install fail when unable to access database, but still produce clean exit code. #533

Closed
louim opened this issue Apr 23, 2015 · 4 comments
Labels

Comments

@louim
Copy link

louim commented Apr 23, 2015

Hello!

I'm currently automating magento install using Magerun and Ansible. When running unattended install with some wrong database params, I get an exception, with installation failed, but then the installer produce another command which exits cleanly. Ansible then thinks all went right, even when the installation did not complete.

vagrant@magentotest:/var/www$ magerun install --installSampleData=no --dbHost=localhost --installationFolder=/var/www/magento --magentoVersion=1.9.1.0 --dbUser=magento --dbPass=magento --dbName=magento_development --useDefaultConfigParams=yes --baseUrl=http://magentotest.dev/


  Magento Installation


  - Installing magento-ce-1.9.1.0 (1.9.1.0)
    Loading from cache

Created database magento_development
Start installation process.
/usr/bin/env php /var/www/magento/install.php --license_agreement_accepted 'yes' --locale 'de_DE' --timezone 'Europe/Berlin' --db_host 'localhost' --db_name 'magento_development' --db_user 'magento' --db_pass 'magento' --url 'http://magentotest.dev/' --use_rewrites 'yes' --use_secure 'no' --secure_base_url 'https://magentotest.dev/' --use_secure_admin 'no' --admin_username 'admin' --admin_lastname 'Doe' --admin_firstname 'John' --admin_email 'john.doe@example.com' --admin_password 'password123' --session_save 'files' --admin_frontname 'admin' --backend_frontname 'admin' --default_currency 'EUR' --skip_url_validation 'yes'



  [Exception]
  Installation failed.
  FAILED
  ERROR: Database connection error.



install [--magentoVersion[="..."]] [--magentoVersionByName[="..."]] [--installationFolder[="..."]] [--dbHost[="..."]] [--dbUser[="..."]] [--dbPass[="..."]] [--dbName[="..."]] [--dbPort[="..."]] [--installSampleData[="..."]] [--useDefaultConfigParams[="..."]] [--baseUrl[="..."]] [--replaceHtaccessFile[="..."]] [--noDownload] [--forceUseDb[="..."]]

If I check the exit code:

vagrant@magentotest:/var/www$ echo $?
0

Here is a screenshot of the text version :

capture d ecran 2015-04-23 a 09 36 53

Question is: am I doing something wrong? I don't understand the install part example after the exception. Is it supposed to show there?

I'm using PHP 5.5.23:

PHP 5.5.23-1+deb.sury.org~trusty+2 (cli) (built: Mar 24 2015 10:58:52)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

And Magerun: n98-magerun version 1.95.0 by netz98 new media GmbH

@cmuench cmuench added the bug label Apr 24, 2015
@tkn98
Copy link
Collaborator

tkn98 commented Apr 27, 2015

I tried to reproduce your issue but was unable to trigger the exact Exception you have there.

Do you know what I can do to provoke it? I tried with wrong username on the database as well with wrong hostname but this gives me a different exception only:

  [InvalidArgumentException]         
  Database configuration is invalid  

The exit code then is 1, so it's not enough to reproduce your case. Any ideas?

kirtixs pushed a commit that referenced this issue Apr 27, 2015
due to the symfony command line interface implementation it is required to set the autoExit to false in order to run multiple commands
by setting autoExit to true for this case symfony cli will now exit with exit-code 1

fixes #533
@tkn98
Copy link
Collaborator

tkn98 commented Apr 27, 2015

Thank you for the quick fix and looking into it @redshark1802!

@tkn98 tkn98 closed this as completed Apr 27, 2015
@tkn98
Copy link
Collaborator

tkn98 commented Apr 27, 2015

@louim: A fix is now part of the development version. You can either wait for the next release or build the phar from devel branch sources.

The exit code on error is 1.

@louim
Copy link
Author

louim commented Apr 27, 2015

Thank you very much for the quick fix!

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

No branches or pull requests

3 participants