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

bin/magento must return non zero on exceptions #3189

Closed
wants to merge 7 commits into from
Closed

bin/magento must return non zero on exceptions #3189

wants to merge 7 commits into from

Conversation

BlackIkeEagle
Copy link
Member

When you use bin/magento in a deployment flow it must return a non zero
exitcode when there was an error or an exception. Now the exceptions
caught and as a result the exitcode is 0. In a script we assume exit
code 0 to be all clear everything went fine.

So we must fix this here.

Signed-off-by: BlackEagle ike.devolder@gmail.com

@BlackIkeEagle
Copy link
Member Author

@vancoz I've added more things that are related to incorrect exit codes, these are open for discussion

@BlackIkeEagle
Copy link
Member Author

I'll fix the failing tests probably later today

@BlackIkeEagle
Copy link
Member Author

@vancoz Could we discuss here if the changes I've done are good for you. Maybe it can be taken further and instead of returning non-zero from the execute methods we could just throw exceptions instead.

@BlackIkeEagle
Copy link
Member Author

Sorry for the delay, I got it sorted out now.

@vancoz
Copy link

vancoz commented Mar 25, 2016

Hi @BlackIkeEagle, thank you for contribution, and sorry for delay.
Can you please use constants for exit codes? Thank you.

@erikhansen
Copy link
Contributor

@BlackIkeEagle Did you see the latest feedback from @vancoz about "Can you please use constants for exit codes"? Are you going to be able to work on that small change?

Thanks for working on this fix, as it solved PR #3060 that myself and others have wanted to see fix.

@BlackIkeEagle
Copy link
Member Author

@erikhansen Sorry I have seen the comment by @vancoz but I did not yet get to it to update this PR.

@erikhansen
Copy link
Contributor

erikhansen commented Apr 15, 2016

@BlackIkeEagle It looks like the latest CI tests failed. I saw other tests that were failing for the same reason, so it looks like it was an issue with code from develop. Also, your branch now has conflicts with develop. Can you merge develop into your branch and fix any merge conflicts? Hopefully that will result in successful CI tests.

@BlackIkeEagle
Copy link
Member Author

@erikhansen Ok I'll rebase again :)

@BlackIkeEagle
Copy link
Member Author

pff is there any way for magento to use something more stable than travis please

there are almost every time issues with stuff that is rebooting and whatever

@erikhansen
Copy link
Contributor

@vancoz It looks like the Travis CI build randomly failed. Can you restart the tests?

@@ -32,4 +32,5 @@ try {
echo "\n\n";
$e = $e->getPrevious();
}
exit(1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use constant here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting that, I completely missed it

@BlackIkeEagle
Copy link
Member Author

Fingers crossed travis does not reboot anything now :)

@BlackIkeEagle
Copy link
Member Author

please help me here:

integration 1 php 5.5

The system is going down for power off NOW!
FEPHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Connection refused' in

integration 1 php 5.6

The system is going down for power off NOW!
EPHP Warning:  PDOStatement::execute(): MySQL server has gone away in

integration 2 php 7

The system is going down for power off NOW!
EPHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused in

integration integrity php 7

The system is going down for power off NOW!
Exception: Starting Magento installation:
....
  [Exception]
  Warning: PDOStatement::execute(): MySQL server has gone away in /home/travi
  s/build/magento/magento2/vendor/magento/zendframework1/library/Zend/Db/Stat
  ement/Pdo.php on line 228

static:

I don't think the issue is caused by my changes so fixing it here would be out-of-scope unless you guys say 'just fix it here :)'

@BlackIkeEagle
Copy link
Member Author

I'm really tired of this stupid failures with travis

@Vinai
Copy link
Contributor

Vinai commented Apr 21, 2016

Restarted the build.

@BlackIkeEagle
Copy link
Member Author

@Vinai thanks, but again there is such an issue:

The system is going down for power off NOW!

@davidalger
Copy link
Member

davidalger commented Apr 21, 2016

I'm really tired of this stupid failures with travis

@BlackIkeEagle Does it help at all to know others (like myself) are pretty sick of it too? :) Seems to have all started when Travis started shifting their infrastructure over to GCE, and unfortunately the only option we've got is to restart the failed builds.

@BlackIkeEagle
Copy link
Member Author

@davidalger I did not at all assume I was alone with my annoyance. So we can conclude if we cumulate all 'failed' builds that is basically succeeds :)

@mazhalai
Copy link
Contributor

@BlackIkeEagle there are some static failures specific to your changes. Please see: https://travis-ci.org/magento/magento2/jobs/125264905#L622

@BlackIkeEagle
Copy link
Member Author

@mazhalai yeah sorry I already noticed but did not yet have the time to update the PR

@BlackIkeEagle
Copy link
Member Author

@mazhalai I checked again, and if you want less dependencies the code must be refactored. Its not like the new 'dependency' will make it more messy.

@BlackIkeEagle
Copy link
Member Author

@mazhalai do you want me to add PHPMD ignores or something like that

@mazhalai
Copy link
Contributor

We do now allow any new suppress warning, I believe there is a task/story in backlog to remove all existing ones. Yes this will need to be refactored.

@piotrekkaminski
Copy link
Contributor

Internal issue id: MAGETWO-52458, reported as well by @LeeSaferite

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Code must not contain multiple empty lines in a row; found 3 empty lines

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- removing dependency on cache manager
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- adding check in case all caches are already disabled.
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

 - fix unknown variable merge error and path in docblock
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- fixes for QA issues.
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- Using OM to create TImeZoneProvider.
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- fixes for QA issues.
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- fixes for QA issues.
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- Code update to fix QA issues
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- fixes for QA issues.
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- updating job set cache
magento-team pushed a commit that referenced this pull request May 20, 2016
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- static test failures
magento-team pushed a commit that referenced this pull request May 20, 2016
…- unhelpful error message #3189

- static test failures
@mazhalai
Copy link
Contributor

@BlackIkeEagle this PR has been merged. It was combined with other logging related issues, hence PR was not automatically closed. Thank you very much for your contribution!

@mazhalai mazhalai closed this May 27, 2016
@BlackIkeEagle
Copy link
Member Author

@mazhalai superb, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: accept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants