<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9902</bug_id>
          
          <creation_ts>2016-07-09 02:53:23 +0000</creation_ts>
          <short_desc>the tmp/cache can get corrupted and prevent building</short_desc>
          <delta_ts>2016-07-29 15:47:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="brian avery">brian.avery</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63775</commentid>
    <comment_count>0</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2016-07-09 02:53:23 +0000</bug_when>
    <thetext>The tmp/cache file can get into a bad state where subsequent bitbake calls generate a traceback. Afaik, this only happens when also running toaster.

Workaround: Removing tmp/cache forces bitbake to regenerate the cache and there are no tracebacks.

Commitish: master/d6abd7559512b3de980b2495e2f5f5db25a4afed

To reproduce:
oe-init &amp; start toaster, cli build , stop toaster, start toaster, cli build...

-------
  . ~/src/intel/myBugs/poky/oe-init-build-env
  . toaster start
  bitbake zlib
  . toaster  stop
  . toaster  start
  bitbake bash
  . toaster stop
  . toaster webport=0.0.0.0:8005 start
  bitbake core-image-minimal
--------



The traceback:
$ bitbake core-image-minimal
NOTE: ToasterUI waiting for events
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = &quot;1.31.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;universal&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;qemux86&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;2.1+snapshot-20160709&quot;
TUNE_FEATURES     = &quot;m32 i586&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-poky         
meta-yocto-bsp    = &quot;master:d6abd7559512b3de980b2495e2f5f5db25a4afed&quot;

ERROR: 
Traceback (most recent call last):
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/ui/toasterui.py&quot;, line 246, in main
    buildinfohelper.store_started_build(event, build_log_file_path)
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/ui/buildinfohelper.py&quot;, line 1009, in store_started_build
    build_information = self._get_build_information(build_log_path)
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/ui/buildinfohelper.py&quot;, line 893, in _get_build_information
    build_info[&apos;distro&apos;] = self.server.runCommand([&quot;getVariable&quot;, &quot;DISTRO&quot;])[0]
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/server/process.py&quot;, line 61, in runCommand
    bb.fatal(&quot;Gave up; Too many tries: timeout while attempting to communicate with bitbake server&quot;)
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/__init__.py&quot;, line 104, in fatal
    raise BBHandledException()
bb.BBHandledException

ERROR: An uncaught exception occured in runqueue, please see the failure below:
ERROR: Running idle function
Traceback (most recent call last):
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/server/process.py&quot;, line 142, in ProcessServer.idle_commands(delay=0.1, fds=[&lt;multiprocessing.connection.Connection object at 0x7fb78a68b6d8&gt;, &lt;multiprocessing.connection.Connection object at 0x7fb7892005f8&gt;]):
                 try:
    &gt;                retval = function(self, data, False)
                     if retval is False:
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/cooker.py&quot;, line 1354, in buildTargetsIdle(server=&lt;ProcessServer(ProcessServer-1, started)&gt;, rq=&lt;bb.runqueue.RunQueue object at 0x7fb78410a2b0&gt;, abort=False):
                 try:
    &gt;                retval = rq.execute_runqueue()
                 except runqueue.TaskFailure as exc:
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/runqueue.py&quot;, line 1210, in RunQueue.execute_runqueue():
             try:
    &gt;            return self._execute_runqueue()
             except bb.runqueue.TaskFailure:
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/runqueue.py&quot;, line 1144, in RunQueue._execute_runqueue():
                     # needs it
    &gt;                depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
                     self.rqdata.init_progress_reporter.next_stage()
  File &quot;/big/src/intel/myBugs/poky/bitbake/lib/bb/cooker.py&quot;, line 741, in BBCooker.buildDependTree(rq=&lt;bb.runqueue.RunQueue object at 0x7fb78410a2b0&gt;, taskdata=&lt;bb.taskdata.TaskData object at 0x7fb786863940&gt;):
                     for ei in extra_info:
    &gt;                    depend_tree[&quot;pn&quot;][pn][ei] = vars(self.recipecache)[ei][fn]
     
KeyError: &apos;virtual:native:/big/src/intel/myBugs/poky/meta/recipes-extended/xz/xz_5.2.2.bb&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64273</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-07-21 15:56:40 +0000</bug_when>
    <thetext>As usually seems to be the case, there are multiple things going on here. For some reason the extra &apos;HOB&apos; cache is getting corrupted on disk. When the system loads this, it basically ignores the errors and loads a partial cache. We then have missing items, hence the crash below.

I have a patch which makes the invalid cache trigger a reparse which is what it should do, i.e. sanely recover. Sadly when I &quot;bitbake bash&quot; with my fix, I see:

NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 744 tasks of which 744 didn&apos;t need to be rerun and all succeeded.
NOTE: Writing buildhistory
ERROR: maximum recursion depth exceeded
Traceback (most recent call last):
  File &quot;/media/build1/poky/bitbake/lib/bb/ui/toasterui.py&quot;, line 377, in main
    buildinfohelper.close(errorcode)
  File &quot;/media/build1/poky/bitbake/lib/bb/ui/buildinfohelper.py&quot;, line 1517, in close
    self.store_log_event(tempevent)

[snip screenfuls of repeats]

    self.store_log_event(tempevent)
  File &quot;/media/build1/poky/bitbake/lib/bb/ui/buildinfohelper.py&quot;, line 1483, in store_log_event
    logger.debug(1, &quot;buildinfohelper: Saving stored event %s &quot; % tempevent)
RecursionError: maximum recursion depth exceeded

WARNING: Return value is 1

So there looks to be some other toaster issue here and also the question of how the cache gets corrupted in the first place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64497</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-07-26 16:33:17 +0000</bug_when>
    <thetext>Fixed in bitbake 51843d8f2bbe2e54db7593ca61984abe70423ef6.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>