Bug 13267 - bitbake Python (double) exception
Summary: bitbake Python (double) exception
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.8 M4
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-04-05 15:12 UTC by Juro Bystricky
Modified: 2019-08-20 03:34 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juro Bystricky 2019-04-05 15:12:11 UTC
My HOSTTOOLS were missing "chrpath", so an error message was expected. However, not like this:


ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/juro/yocto/poky/build2-repro-minimal-x86_64-2019-04-04/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 14471 at 2019-04-04 10:42:45.831093 ---
Traceback (most recent call last):
  File "/home/juro/yocto/poky/bitbake/lib/bb/cookerdata.py", line 290, in parseBaseConfiguration
    bb.event.fire(bb.event.ConfigParsed(), self.data)
  File "/home/juro/yocto/poky/bitbake/lib/bb/event.py", line 225, in fire
    fire_class_handlers(event, d)
  File "/home/juro/yocto/poky/bitbake/lib/bb/event.py", line 134, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/home/juro/yocto/poky/bitbake/lib/bb/event.py", line 106, in execute_handler
    ret = handler(event)
  File "/home/juro/yocto/poky/meta/classes/base.bbclass", line 238, in base_eventhandler
    setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d)
  File "/home/juro/yocto/poky/meta/classes/base.bbclass", line 142, in setup_hosttools_dir
    bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n  %s" % " ".join(notfound))
  File "/home/juro/yocto/poky/bitbake/lib/bb/__init__.py", line 120, in fatal
    raise BBHandledException()
bb.BBHandledException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/juro/yocto/poky/bitbake/lib/bb/daemonize.py", line 83, in createDaemon
    function()
  File "/home/juro/yocto/poky/bitbake/lib/bb/server/process.py", line 469, in _startServer
    self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
  File "/home/juro/yocto/poky/bitbake/lib/bb/cooker.py", line 210, in __init__
    self.initConfigurationData()
  File "/home/juro/yocto/poky/bitbake/lib/bb/cooker.py", line 375, in initConfigurationData
    self.databuilder.parseBaseConfiguration()
  File "/home/juro/yocto/poky/bitbake/lib/bb/cookerdata.py", line 317, in parseBaseConfiguration
    raise bb.BBHandledException
bb.BBHandledException
ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
  chrpath
Comment 1 Robert Yang 2019-04-29 08:28:18 UTC
Hi RP,

I think that double exceptions are acceptable unless it loses error message? For this case, the error message is kept. What's your opinion, please ?
Comment 2 Richard Purdie 2019-05-01 07:09:40 UTC
The double exception is confusing to the user. The system printed a real error so it shouldn't be printing an exception at all in this case. One of the points of bb.BBHandledException is to avoid tracebacks as there should have been a usable error shown to the user already.