Bug 8320

Summary: Error content does not display in the Toaster GUI
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Elliot Smith <elliot.smith>
Status: VERIFIED FIXED QA Contact: Cristina Agurida <cristina-danielax.agurida>
Severity: normal    
Priority: Medium+ CC: belen.barros.pena, cristina-danielax.agurida, jessica.zhang, stanciux.mihail
Version: 1.8   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
exception-instead-of-error.png
none
no-error-shown.png
none
no-error-log.txt
none
Design - Displaying failed build requests none

Description Belen Barros Pena 2015-09-17 17:19:55 UTC
Found on master:ea562de57590c966cd5a75fda8defecd397e6436

When the build fails before starting proper (during the build request stage):

* Errors display as a Toaster exception instead of an error (see attached exception-instead-of-error.png), or

* Errors don't display at all (see attached no-error-shown.png and its corresponding cooker log: no-error-log.txt).

We need to: 

* Roll back the 'Toaster exceptions' changes, since they are showing as exceptions things that ought to be shown as errors, and honestly we are not even sure that presenting Toaster exceptions in this way is a good idea

* Make sure the errors not showing at all show up.
Comment 1 Belen Barros Pena 2015-09-17 17:20:25 UTC
Created attachment 2741 [details]
exception-instead-of-error.png
Comment 2 Belen Barros Pena 2015-09-17 17:20:45 UTC
Created attachment 2742 [details]
no-error-shown.png
Comment 3 Belen Barros Pena 2015-09-17 17:21:02 UTC
Created attachment 2743 [details]
no-error-log.txt
Comment 4 Belen Barros Pena 2015-09-29 17:25:26 UTC
this is how to reproduce:

1. In managed mode, create a Toaster project choosing the master release
2. Add the meta-raspberrypi layer to the project
3. Set the machine to raspberrypi2
4. Delete the meta-raspberrypi layer from the project
5. Start a build

The build will fail before starting because nothing provides the machine. The error message will not show in the build dashboard.
Comment 5 Belen Barros Pena 2015-09-29 17:29:43 UTC
By the way, builds that fail at the build request stage should have a different build dashboard (see attached document Design - Displaying failed build requests).

I can open a separate issue for this one (Elliot: let me know if you want me to do that)
Comment 6 Belen Barros Pena 2015-09-29 17:30:30 UTC
Created attachment 2774 [details]
Design - Displaying failed build requests
Comment 7 Belen Barros Pena 2015-10-11 12:42:29 UTC
I have managed to reproduced the toaster exception issue (shown in the attached exception-instead-of-error.png) on master:e35c404537db0b46047fcb2ee7d3645e3e0935c5

This is how:

1. Create a Toaster project selecting the master release
2. Add the layers e100-bsp and e300-bsp. In my database, those 2 layers have different git urls. For the e100-bsp, the git url is 

git://github.com/EttusResearch/meta-ettus.git

For the e300-bsp, the git url is 

https://github.com/EttusResearch/meta-ettus.git

I know the maintainer of those layers has corrected the issue in the layer index, so if your layers data no longer shows the different git urls, you will need to change the database to make it so.

3. Set the ettus-e300 as the project machine
4. Build gps-config

This build throws this error in the toaster_server.log

Bitbake server address: 0.0.0.0, server port: 36802
ERROR: Unable to parse /home/yocto/master/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/parse/parse_py/ConfHandler.py
Traceback (most recent call last):
  File "/home/yocto/master/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include(parentfn='/home/yocto/master/_toaster_clones/_https___github.com_EttusResearch_meta-ettus.git_master/e300-bsp/conf/machine/ettus-e300.conf', fn='conf/machine/include/machine-xilinx-default.inc', lineno=13, data=<bb.data_smart.DataSmart object at 0x7f70821c2c90>, error_out='include required'):
                 if error_out:
    >                raise ParseError("Could not %s file %s" % (error_out, fn), parentfn, lineno)
                 logger.debug(2, "CONF file '%s' not found", fn)
ParseError: ParseError at /home/yocto/master/_toaster_clones/_https___github.com_EttusResearch_meta-ettus.git_master/e300-bsp/conf/machine/ettus-e300.conf:13: Could not include required file conf/machine/include/machine-xilinx-default.inc

Bitbake server address: 0.0.0.0, server port: 60944

========================================

And in Toaster shows the following as an exception:

command: bash -c "source /home/yocto/master/_toaster_clones/_git___git.yoctoproject.org_poky_master/oe-init-build-env /home/yocto/master/build 2>&1 >toaster_server.log && bitbake --read /home/yocto/master/build/conf/toaster-pre.conf --postread /home/yocto/master/build/conf/toaster.conf --server-only -t xmlrpc -B 0.0.0.0:0 2>&1 >>toaster_server.log " 

=========================================

I hope this works.
Comment 8 Elliot Smith 2015-10-15 08:04:19 UTC
Thanks Belen, the test cases you supplied should both work correctly with this branch (elliot/toaster/error_display-8320).

Patches submitted to toaster mailing list for review:
https://lists.yoctoproject.org/pipermail/toaster/2015-October/003147.html
Comment 9 Elliot Smith 2015-10-16 14:11:29 UTC
Now in bitbake master.
Comment 10 Cristina Agurida 2015-10-28 12:51:39 UTC
Verified on master: 505a82673ac2487df5ea343a6422c2fc47018831