| Summary: | toaster: catch early build and server exceptions | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Toaster | Reporter: | David Reyna <david.reyna> |
| Component: | toaster | Assignee: | David Reyna <david.reyna> |
| Status: | RESOLVED FIXED | QA Contact: | Libertad <libertad.gonzalez.de.la.cruz> |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | jessica.zhang, stanciux.mihail |
| Version: | 2.4 | ||
| Target Milestone: | 2.4 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
David Reyna
2017-09-06 05:42:54 UTC
When "_shellcmd" fails in "localhostcontroller.py" detects a error (clone problem, server error, reported bitbake format errors), it must report the error and formally stop the current build. The current behavior is bailing with a "ShellCmdException()" which leaves the build hanging in the web gui. Here is my validation test for catching the exceptions:
[ Test 1: Format error in custom layer ]
* Make a copy of a layer like "meta-poky" and save it in a new directory called "meta-poky-bad".
* "Import" this layer to the Toaster project as a local directory
* Append the following false line to this layer's "conf/layer.conf"
foo=bar
* Build a target, for example "quilt-native"
Observe that after a moment the build halts, with an error message of the form:
"command: bash -c .../bitbake/bin/bitbake ... --server-only -B 0.0.0.0:0"
b"ERROR: Unable to start bitbake server\nERROR: Last 10 lines of server log /opt/dreyna/toaster_newer/poky/build-toaster-2/bitbake-cookerdaemon.log:\nBitbake XMLRPC server address: 0.0.0.0, server port: 47425\nEntering server connection loop\nMarking as dirty due to 'prefile' option change to '[]'\nXMLRPC Server triggering exit\nExiting\nERROR: ParseError at /opt/dreyna/toaster_newer/poky/meta-poky-bad/conf/layer.conf:22: unparsed line: 'foo=bar'\nERROR: ..."
[ Test 2: Success Test ]
* Fix the "layer.conf" and click re-build.
Observe that the buils succeeds.
[ Test 3: Git error in "setLayers()" ]
* In the file localhostbecontroller.py, add the following false git command in "setLayers()":
self._shellcmd("git garbage error", self.be.sourcedir).split("\n")
* Stop and restart Toaster to instantiate ths change, and then click rebuild.
Observe that the build halts with the following error message:
command: git garbage error
b"git: 'garbage' is not a git command. See 'git --help'.\n"
commit 7dce5875eae80425d1528a914c6b1f165fbb524b |