Bug 9252 - Build images doesn't work in Toaster
Summary: Build images doesn't work in Toaster
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.1
Hardware: x86 x86_64
: Medium+ normal
Target Milestone: 2.3 M2
Assignee: brian avery
QA Contact: David Lopez Barriba
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-03-14 15:23 UTC by Cristina Agurida
Modified: 2017-05-10 16:34 UTC (History)
11 users (show)

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


Attachments
IMG (44.17 KB, image/png)
2016-12-21 17:03 UTC, David Lopez Barriba
no flags Details
Log (20.25 MB, application/octet-stream)
2016-12-21 17:06 UTC, David Lopez Barriba
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cristina Agurida 2016-03-14 15:23:11 UTC
STATUS: Failed
BUILD: 2.1_M3.RC1: 8debfea81e69d038bd2d56314b272cb74f5582ed
ENVIRONMENT: 'Ubuntu 14.10 x86_64'

STEPS TO REPRODUCE: 

1. Start up toaster.
2. Create a new project on local branch.
3. Try to build an image (ex: core-image-minimal).

EXPECTED OUTCOME: 

The image is successfully created.

ACTUAL OUTCOME:

Image build process hangs at "0% of tasks complete".
Comment 1 Michael Wood 2016-03-14 17:06:12 UTC
This is because we've been relying on the xmlrpc server not being a single use instance (i.e. it stays around after a build). Ed fixed an issue where the switch to toggle on and off this single use was accidentally always set to false. Which means Toaster has been relying on some incorrect behaviour of bitbake/xmlrpc.

We need to either get on and merge Ed's current work to do per project build directories and/or roll a patch to make sure we don't use anonymous mode.


commit d405f97af32d82b1b82915fa0b7038d4ac79f410
Author: Ed Bartosh <ed.bartosh@linux.intel.com>
Date:   Wed Mar 9 10:07:40 2016 +0200

    bitbake: xmlrpc: fix bug in setting XMLRPCServer.single_use
    
    XMLRPCServer.single_use attribute was always set to False.
    This caused xmlrpc server to keep running after build is done as
    BitBakeServerCommands.removeClient only shuts down server if its
    single_use attribute is set to True.
    
    (Bitbake rev: 0a60b0928a0a746a60d2c2f294ff1903963c7086)
    
    Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 1ceca51..7528138 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -191,8 +191,7 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
         Constructor
         """
         BaseImplServer.__init__(self)
-        if (interface[1] == 0):     # anonymous port, not getting reused
-            self.single_use = True
+        self.single_use = interface[1] == 0 # anonymous port, not getting reused
         # Use auto port configuration
         if (interface[1] == -1):
             interface = (interface[0], 0)
@@ -205,7 +204,6 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
         self.commands = BitBakeServerCommands(self)
         self.autoregister_all_functions(self.commands, "")
         self.interface = interface
-        self.single_use = False
 
     def addcooker(self, cooker):
         BaseImplServer.addcooker(self, cooker)
Comment 2 Ed Bartosh 2016-03-17 09:50:59 UTC
Please, review the fix: https://lists.yoctoproject.org/pipermail/toaster/2016-March/004197.html
Comment 3 Ed Bartosh 2016-03-29 08:22:30 UTC
The fix has been merged to master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b58e5b1fb3bcacbcfce17a748bca5f60c3528b4f
Comment 4 Libertad 2016-04-05 19:18:23 UTC
Verified in 

2.1_M3.RC2: 21823cb466e79540567ad1a43ae6f93d850e4057

by being able to run the Toaster test suites:

https://bugzilla.yoctoproject.org/tr_show_run.cgi?run_id=5606
https://bugzilla.yoctoproject.org/tr_show_run.cgi?run_id=5607
Comment 5 David Lopez Barriba 2016-12-21 17:03:11 UTC
Created attachment 3567 [details]
IMG
Comment 6 David Lopez Barriba 2016-12-21 17:05:24 UTC
I found this error again in
2.3_M1_rc1: 573c646d4cc62dcd0c230381df4940bdf314d495
Comment 7 David Lopez Barriba 2016-12-21 17:06:57 UTC
Created attachment 3568 [details]
Log
Comment 8 Ed Bartosh 2016-12-21 17:23:37 UTC
resetting to default assignee. This may be caused by recent work Paul did for resident bitbake.
Comment 9 brian avery 2017-01-04 18:59:00 UTC
git bisect says:
7d5c9860de05efc4272256ccefc530113f01d24e is the first bad commit
Comment 10 brian avery 2017-01-04 19:02:25 UTC
Added to CC : 
Joshua L.  as he was curious/
Paul E. for tinfoil2 insight.
Comment 11 David Reyna 2017-01-09 05:52:08 UTC
I have an installation before Paul's "7d5c9860de05efc4272256ccefc530113f01d24e" commit and an installation after that commit, and have attempted a "quilt-native" with each as per Brian's advice.

The normal shell log commands are the same for both, and cover upto the build start.

The normal UI logs are the same, except that the 'after' log never proceeds past 0% done for the parsing.

The build-specific Toaster log for before works perfectly. The one after immediately shows the reported "unable to open database file", so the commit from Paul is definitely the cause.

Additionally, I can see of course that the Toaster code base is identical before and after. I am therefore symlinking the two copies of "buildinfohelper.py" so that I can have identical added debugging instrumentation to better find the divergence in the Toaster forward dataflow, while I also investigate backtracking from the reported failure message to the error in creating the database access.
Comment 12 brian avery 2017-01-15 03:17:22 UTC
tinfoil2 changes were clearing toaster_dir. patch sent to bitbake list.
Comment 13 brian avery 2017-01-17 18:16:52 UTC
In master
commit 63f899a950daf1018999455bafa7a2be8b22f164
Comment 14 David Lopez Barriba 2017-05-10 16:34:56 UTC
Verified in 381897c64069ea43d595380a3ae913bcc79cf7e1