Bug 4589 - Unhandled exception in thread started by Error in sys.excepthook:
: Unhandled exception in thread started by Error in sys.excepthook:
Status: ACCEPTED
Product: distro-constructor
dc-cli
: unspecified
: Other OpenSolaris
: P4 minor (vote)
: 2010.1H
Assigned To: Watcher account for Distribution Constructor bugs
:
:
: reviewed-2009.06 top_60
:
:
:
  Show dependency treegraph
 
Reported: 2008-11-06 11:47 UTC by erik.lafever
Modified: 2009-11-13 19:35 UTC (History)
7 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description erik.lafever 2008-11-06 11:47:48 UTC
The Unhandled exception error has shown up at random times during testing as
seen in the output below. 

I have been able to reproduce this somewhat consistently by issuing
distro_const build -l slim_cd.xml several times in a row.  The error typically
shows up after the command is executed 4 times.  The error does not cause the
build to fail.


###########################################################################

wands# distro_const build -l slim_cd_101b2.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101b2_temp_18484.xml validates

Step           Resumable Description
-------------- --------- -------------
im-pop             X     Populate the image with packages
im-mod             X     Image area modifications
slim-im-mod        X     Slim CD Image area Modifications
br-init            X     Boot root initialization
slim-br-config     X     Slim CD boot root configuration
br-config          X     Boot root configuration
br-arch            X     Boot root archiving
slim-post-mod      X     Slim CD post bootroot image area modification
grub-setup         X     Grub menu setup
post-mod           X     Post bootroot image area modification
iso                X     ISO image creation
usb                X     USB image creation
wands# distro_const build -r post-mod -p iso slim_cd_101b2.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101b2_temp_18492.xml validates
Simple Log: /rpool/dc/slim_cd_101b2/logs/simple-log-2008-11-06-10-25-20
Detail Log: /rpool/dc/slim_cd_101b2/logs/detail-log-2008-11-06-10-25-20
Build started Thu Nov  6 10:25:20 2008
Distribution name: slim_cd_101b2
Build Area dataset: rpool/dc/slim_cd_101b2
Build Area mount point: /rpool/dc/slim_cd_101b2
==== post-mod: Post bootroot image area modification 

Removing sbin, kernel and lib from package image area

Warning: creating filesystem that does not conform to ISO-9660.

Warning: inode blocks/cyl group (39) >= data blocks (37) in last
    cylinder group. This implies 600 sector(s) cannot be allocated.
/dev/rlofi/1:   105776 sectors in 176 cylinders of 1 tracks, 601 sectors

        51.6MB in 11 cyl groups (16 c/g, 4.70MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 9648, 19264, 28880, 38496, 48112, 57728, 67344,
 76960,
 86576,

 96192

0 blocks

112784 blocks

Warning: creating filesystem that does not conform to ISO-9660.

Stopping at iso: ISO image creation 

Build completed Thu Nov  6 10:41:08 2008
Build is successful.
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:
wands# 


####################################################################

example that reproduced the problem on third try :


root@wands:/export/DC_tests/Phase6# distro_const build -l slim_cd_101a.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101a_temp_19075.xml validates

Step           Resumable Description
-------------- --------- -------------
im-pop             X     Populate the image with packages
im-mod             X     Image area modifications
slim-im-mod        X     Slim CD Image area Modifications
br-init            X     Boot root initialization
slim-br-config     X     Slim CD boot root configuration
br-config          X     Boot root configuration
br-arch            X     Boot root archiving
slim-post-mod      X     Slim CD post bootroot image area modification
grub-setup         X     Grub menu setup
post-mod           X     Post bootroot image area modification
iso                X     ISO image creation
usb                X     USB image creation
root@wands:/export/DC_tests/Phase6# distro_const build -l slim_cd_101a.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101a_temp_19085.xml validates

Step           Resumable Description
-------------- --------- -------------
im-pop             X     Populate the image with packages
im-mod             X     Image area modifications
slim-im-mod        X     Slim CD Image area Modifications
br-init            X     Boot root initialization
slim-br-config     X     Slim CD boot root configuration
br-config          X     Boot root configuration
br-arch            X     Boot root archiving
slim-post-mod      X     Slim CD post bootroot image area modification
grub-setup         X     Grub menu setup
post-mod           X     Post bootroot image area modification
iso                X     ISO image creation
usb                X     USB image creation
root@wands:/export/DC_tests/Phase6# distro_const build -l slim_cd_101a.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101a_temp_19095.xml validates

Step           Resumable Description
-------------- --------- -------------
im-pop             X     Populate the image with packages
im-mod             X     Image area modifications
slim-im-mod        X     Slim CD Image area Modifications
br-init            X     Boot root initialization
slim-br-config     X     Slim CD boot root configuration
br-config          X     Boot root configuration
br-arch            X     Boot root archiving
slim-post-mod      X     Slim CD post bootroot image area modification
grub-setup         X     Grub menu setup
post-mod           X     Post bootroot image area modification
iso                X     ISO image creation
usb                X     USB image creation
root@wands:/export/DC_tests/Phase6# distro_const build -l slim_cd_101a.xml
/usr/share/distro_const/DC-manifest.defval.xml validates
/tmp/slim_cd_101a_temp_19105.xml validates

Step           Resumable Description
-------------- --------- -------------
im-pop             X     Populate the image with packages
im-mod             X     Image area modifications
slim-im-mod        X     Slim CD Image area Modifications
br-init            X     Boot root initialization
slim-br-config     X     Slim CD boot root configuration
br-config          X     Boot root configuration
br-arch            X     Boot root archiving
slim-post-mod      X     Slim CD post bootroot image area modification
grub-setup         X     Grub menu setup
post-mod           X     Post bootroot image area modification
iso                X     ISO image creation
usb                X     USB image creation
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:
root@wands:/export/DC_tests/Phase6#
Comment 1 Clay Baenziger 2009-03-27 09:20:57 UTC
I've hit this on the 03/27 indiana-build DC run too:
SunOS indiana-build 5.11 snv_105 i86pc i386 i86pc

"[...]
 86.26% done, estimate finish Fri Mar 27 02:57:31 2009
 92.42% done, estimate finish Fri Mar 27 02:57:31 2009
 98.58% done, estimate finish Fri Mar 27 02:57:31 2009
Total translation table size: 2048
Total rockridge attributes bytes: 49143
Total directory bytes: 262144
Path table size(bytes): 1644
Max brk space used aa000
81166 extents written (158 MB)
Build completed Fri Mar 27 02:57:31 2009
Build is successful.
Unhandled exception in thread started by 
Error in sys.excepthook:

Original exception was:
ret is 0

====Distribution Build Complete===="
Comment 2 hajma 2009-08-02 13:57:10 UTC
hit it in 2009.06
Comment 3 jack.a.schwartz 2009-11-13 19:34:19 UTC
Part of the problem is that the socket server is not terminated when DC exits
on errors.  This can be fixed by adding the following to distro_const.py:

    try:
        RET_VAL = main_func()
    except ...
    ...
    finally:

        # Shut down socket server.
        # Do in save env in case manifest server obj isn't initialized.
        try:
            manifest_server_obj.stop_socket_server()
        except:
            pass

        ...

However, this doesn't fix the entire problem.  Probably should change to use
Thread instead of thread.

This may also be a manifestation of a python bug.  For example:
http://bugs.python.org/issue1722344
Before concluding this, however, Thread should be tried.
Comment 4 jack.a.schwartz 2009-11-13 19:35:44 UTC
Part of the problem is that the socket server is not terminated when DC exits
on errors.  This can be fixed by adding the following to distro_const.py:

    try:
        RET_VAL = main_func()
    except ...
    ...
    finally:

        # Shut down socket server.
        # Do in save env in case manifest server obj isn't initialized.
        try:
            manifest_server_obj.stop_socket_server()
        except:
            pass

        ...

However, this doesn't fix the entire problem.  Probably should change to use
Thread instead of thread.

This may also be a manifestation of a python bug.  For example:
http://bugs.python.org/issue1722344
Before concluding this, however, Thread should be tried in the manifest server
object for handling the socket server.