Exit code not set on error

Bug #113085 reported by Benji York on 2007-05-07
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

When the buildout exits with an error, it should return a non-zero value. It doesn't appear to do so now. The specific occurrance I'm seeing is when paramiko raises an AuthenticationException error.

Jim Fulton (jim-zope) on 2007-05-09
Changed in zc.buildout:
status: Unconfirmed → Fix Committed
Jim Fulton (jim-zope) wrote :

Note that this only affected internal errors (e.g. bugs in recipes).

User errors se the exist code correctly.

Jim Fulton (jim-zope) on 2007-05-09
Changed in zc.buildout:
status: Fix Committed → Fix Released
Marius Gedminas (mgedmin) wrote :

I still see this problem with zc.buildout 1.1.0:

  zc.buildout version 1.1.0;
Generated script '/home/user/src/package/bin/buildout'.
Updating test.
  Updating test.
  Getting distribution for 'plastex'.

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/usr/lib/python2.5/httplib.py", line 349, in _read_status
    raise BadStatusLine(line)
program finished with exit code 0

(The "program finished with exit code 0" line comes from buildbot logs; because of the exit code buildbot thinks everything was fine and tries to run the next step, which fails because bin/test doesn't exist.)

Changed in zc.buildout:
status: Fix Released → New
Marius Gedminas (mgedmin) wrote :

Okay, this is extremely weird. I can see the sys.exit(1) call in buildout sources on that machine, right after the internal error message is printed. Could the logging.shutdown() call in the finally: block somehow clear that exception? Nothing else comes to mind...

Sidnei da Silva (sidnei) wrote :

I can confirm this is still the problem with the latest 1.2.1 release.

Changed in zc.buildout:
status: New → Confirmed
Patrick Gerken (do3cc) wrote :

I traced it a bit more today, and these were my findings:

- It does only happen when buildout shall be used with a different buildout version, and buildout upgrades the zc.buildout, and restarts itself.
- In zc.buildout.buildout._maybe_upgrade the new version is called, and this one correctly returns the exit code one because of a failure. _maybe_upgrade calls sys.exit() with the correct exit code
- The Exception bubbles up the stack until zc.buildout.buildout.main, here the exceptions SystemExit are being catched and ignored

I don't know why SystemExit gets swallowed here, I only know it happened then:


As I don't understand the reasons good enough, I just post my findings here.

Patrick Gerken (do3cc) wrote :

I have created a branch that does not catch the SystemError any longer. This resulted in some errors during an update that I also fixed. I'd be really happy if somebody could review it so that it gets released soon. It will make a lot of failing buildouts happy, because they'll fail at the right step.
The branch is here:

Domen Kožar (ielectric+) wrote :

This *should* be fixed in zc.buildout 1.6.0, can someone verify?

Patrick Gerken (do3cc) wrote :

We should see this soonishly with the automated buildbots.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers