<?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>14773</bug_id>
          
          <creation_ts>2022-03-31 20:11:21 +0000</creation_ts>
          <short_desc>AB-INT: prservice.BitbakePrTests.test_import_export_replace_db Failure expanding variable</short_desc>
          <delta_ts>2022-04-13 21:52:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Functional (self) Testing</product>
          <component>oe-selftest</component>
          <version>unspecified</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>AB-INT</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandre Belloni">alexandre.belloni</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>alexandre.belloni</cc>
    
    <cc>richard.purdie</cc>
          
          
          <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>92907</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandre Belloni">alexandre.belloni</who>
    <bug_when>2022-03-31 20:11:21 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3325/steps/14/logs/stdio

oe-selftest-fedora fedora34-ty-1


2022-03-27 04:39:57,068 - oe-selftest - INFO - ======================================================================
2022-03-27 04:39:57,069 - oe-selftest - INFO - FAIL: prservice.BitbakePrTests.test_import_export_replace_db (subunit.RemotedTestCase)
2022-03-27 04:39:57,069 - oe-selftest - INFO - ----------------------------------------------------------------------
2022-03-27 04:39:57,069 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/prservice.py&quot;, line 95, in test_import_export_replace_db
    self.run_test_pr_export_import(&apos;m4&apos;)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/prservice.py&quot;, line 87, in run_test_pr_export_import
    self.assertEqual(import_result.status, 0, msg=&quot;PR Service database import failed: %s&quot; % import_result.output)
  File &quot;/usr/lib64/python3.9/unittest/case.py&quot;, line 837, in assertEqual
    assertion_func(first, second, msg=msg)
  File &quot;/usr/lib64/python3.9/unittest/case.py&quot;, line 830, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: 1 != 0 : PR Service database import failed: NOTE: Started PRServer with DBfile: /home/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-2926744/cache/prserv.sqlite3, Address: 127.0.0.1:36081, PID: 780141
Loading cache...done.
Loaded 0 entries from dependency cache.
Parsing recipes...WARNING: /home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/recipes-core/images/core-image-minimal-mtdutils.bb: Exception during build_dependencies for do_rootfs
WARNING: /home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/recipes-core/images/core-image-minimal-mtdutils.bb: Error during finalise of /home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/recipes-core/images/core-image-minimal-mtdutils.bb
ERROR: ExpansionError during parsing /home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/recipes-core/images/core-image-minimal-mtdutils.bb
Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oe/rootfs.py&quot;, line 6, in &lt;module&gt;:
     from oe.utils import execute_pre_post_process
    &gt;from oe.package_manager import *
     from oe.manifest import *
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oe/package_manager/__init__.py&quot;, line 17, in &lt;module&gt;:
     import string
    &gt;from oe.gpg_sign import get_signer
     import hashlib
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1004, in _find_and_load(name=&apos;oe.gpg_sign&apos;, import_=&lt;built-in function __import__&gt;)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 158, in _ModuleLockManager.__enter__()
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 110, in _ModuleLock.acquire()
bb.data_smart.ExpansionError: Failure expanding variable do_rootfs[vardeps], expression was  PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS ${@rootfs_variables(d)} which triggered exception KeyError: 139622474778432
The variable dependency chain for the failure is: do_rootfs[vardeps]
ERROR: Parsing halted due to errors, see error messages above</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92913</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-01 10:06:51 +0000</bug_when>
    <thetext>This was a routine master build, RP&apos;s sys.modules fixes were not present.

https://bugs.python.org/issue43546

has similarities and the comment:

&quot;&quot;&quot;
It looks like method _ModuleLock.acquire() was re-entered in the same thread.

* Enter acquire() first time, set _blocking_on[tid].
* Trigger some callback (profiler, debugger, tracemalloc) which uses import and calls acquire() again from the same thread.
* Enter acquire() second time, set _blocking_on[tid].
* Delete _blocking_on[tid] and leave the second acquire().
* Try to leave the first acquire() and delete _blocking_on[tid] again.
&quot;&quot;&quot;

is similar.

We&apos;ve also see this in memres bitbake testing:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3382/steps/15/logs/stdio

which is in oe.data and in the OE_IMPORTS instead of oe,gpg_sign in a different import location.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92920</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-01 20:30:52 +0000</bug_when>
    <thetext>The second traceback, different code but probably the same issue:

  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/signing.py&quot;, line 72, in test_signing_packages
    self.setup_gpg()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/signing.py&quot;, line 32, in setup_gpg
    nsysroot = get_bb_var(&quot;RECIPE_SYSROOT_NATIVE&quot;, &quot;gnupg-native&quot;)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/utils/commands.py&quot;, line 281, in get_bb_var
    return get_bb_vars([var], target, postconfig)[var]
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/utils/commands.py&quot;, line 243, in get_bb_vars
    bbenv = get_bb_env(target, postconfig=postconfig)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/utils/commands.py&quot;, line 237, in get_bb_env
    return bitbake(&quot;-e %s&quot; % target, postconfig=postconfig).output
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/utils/commands.py&quot;, line 229, in bitbake
    return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/utils/commands.py&quot;, line 207, in runCmd
    raise AssertionError(&quot;Command &apos;%s&apos; returned non-zero exit status %d:\n%s&quot; % (command, result.status, exc_output))
AssertionError: Command &apos;bitbake  -e gnupg-native&apos; returned non-zero exit status 1:
NOTE: Reconnecting to bitbake server...
ERROR: Unable to parse Var &lt;OE_IMPORTED[:=]&gt;
Traceback (most recent call last):
  File &quot;Var &lt;OE_IMPORTED[:=]&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/classes/base.bbclass&quot;, line 30, in oe_import(d=&lt;bb.data_smart.DataSmart object at 0x7fba6a689760&gt;):
                 # Make a python object accessible from the metadata
    &gt;            bb.utils._context[toimport.split(&quot;.&quot;, 1)[0]] = __import__(toimport)
             except AttributeError as e:
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1004, in _find_and_load(name=&apos;oe.path&apos;, import_=&lt;built-in function __import__&gt;)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 158, in _ModuleLockManager.__enter__()
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 110, in _ModuleLock.acquire()
bb.data_smart.ExpansionError: Failure expanding variable OE_IMPORTED[:=], expression was ${@oe_import(d)} which triggered exception KeyError: 140438942700992
The variable dependency chain for the failure is: OE_IMPORTED[:=]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92921</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-01 20:31:11 +0000</bug_when>
    <thetext>https://bugs.python.org/issue47195</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92922</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-02 09:10:20 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/3358/steps/14/logs/stdio 

  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/devtool.py&quot;, line 1363, in test_devtool_deploy_target
    machine = get_bb_var(&apos;MACHINE&apos;)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/utils/commands.py&quot;, line 281, in get_bb_var
    return get_bb_vars([var], target, postconfig)[var]
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/utils/commands.py&quot;, line 243, in get_bb_vars
    bbenv = get_bb_env(target, postconfig=postconfig)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/utils/commands.py&quot;, line 239, in get_bb_env
    return bitbake(&quot;-e&quot;, postconfig=postconfig).output
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/utils/commands.py&quot;, line 229, in bitbake
    return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/utils/commands.py&quot;, line 207, in runCmd
    raise AssertionError(&quot;Command &apos;%s&apos; returned non-zero exit status %d:\n%s&quot; % (command, result.status, exc_output))
AssertionError: Command &apos;bitbake  -e&apos; returned non-zero exit status 1:
NOTE: Reconnecting to bitbake server...
WARNING:   File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/bin/bitbake-server&quot;, line 52, in &lt;module&gt;
    bb.server.process.execServer(lockfd, readypipeinfd, lockname, sockname, timeout, xmlrpcinterface)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/server/process.py&quot;, line 558, in execServer
    server.run()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/server/process.py&quot;, line 110, in run
    ret = self.main()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/server/process.py&quot;, line 219, in main
    self.command_channel_reply.send(self.cooker.command.runCommand(command))
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/command.py&quot;, line 89, in runCommand
    self.cooker.updateCacheSync()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cooker.py&quot;, line 1643, in updateCacheSync
    self.initConfigurationData()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cooker.py&quot;, line 407, in initConfigurationData
    self.databuilder.parseBaseConfiguration()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cookerdata.py&quot;, line 267, in parseBaseConfiguration
    self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cookerdata.py&quot;, line 452, in parseConfigurationFiles
    data = _inherit(bbclass, data)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cookerdata.py&quot;, line 162, in wrapped
    return func(fn, *args)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cookerdata.py&quot;, line 191, in _inherit
    bb.parse.BBHandler.inherit(bbclass, &quot;configuration INHERITs&quot;, 0, data)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/parse_py/BBHandler.py&quot;, line 63, in inherit
    include(fn, file, lineno, d, &quot;inherit&quot;)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/parse_py/ConfHandler.py&quot;, line 67, in include
    include_single_file(parentfn, fn, lineno, data, error_out)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/parse_py/ConfHandler.py&quot;, line 90, in include_single_file
    bb.parse.handle(fn, data, True)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/__init__.py&quot;, line 107, in handle
    return h[&apos;handle&apos;](fn, data, include)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/parse_py/BBHandler.py&quot;, line 124, in handle
    statements.eval(d)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/ast.py&quot;, line 19, in eval
    statement.eval(data)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/parse/ast.py&quot;, line 117, in eval
    val = e.expand(groupd[&quot;value&quot;], key + &quot;[:=]&quot;)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/data_smart.py&quot;, line 477, in expand
    return self.expandWithRefs(s, varname).value
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/data_smart.py&quot;, line 454, in expandWithRefs
    s = __expand_python_regexp__.sub(varparse.python_sub, s)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/data_smart.py&quot;, line 144, in python_sub
    value = utils.better_eval(codeobj, DataContext(self.d), {&apos;d&apos; : self.d})
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/utils.py&quot;, line 429, in better_eval
    return eval(source, ctx, locals)
  File &quot;Var &lt;OE_IMPORTED[:=]&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/classes/base.bbclass&quot;, line 26, in oe_import
    import oe.data
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1024, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 171, in __enter__
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cooker.py&quot;, line 168, in acquire
    return orig_acquire(self)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 110, in acquire
  File &quot;/usr/lib64/python3.10/asyncio/base_events.py&quot;, line 685, in __del__
    _warn(f&quot;unclosed event loop {self!r}&quot;, ResourceWarning, source=self)
  File &quot;/usr/lib64/python3.10/warnings.py&quot;, line 112, in _showwarnmsg
    _showwarnmsg_impl(msg)
  File &quot;/usr/lib64/python3.10/warnings.py&quot;, line 28, in _showwarnmsg_impl
    text = _formatwarnmsg(msg)
  File &quot;/usr/lib64/python3.10/warnings.py&quot;, line 128, in _formatwarnmsg
    return _formatwarnmsg_impl(msg)
  File &quot;/usr/lib64/python3.10/warnings.py&quot;, line 56, in _formatwarnmsg_impl
    import tracemalloc
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1024, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 171, in __enter__
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cooker.py&quot;, line 167, in acquire
    bb.warn(&quot;\n&quot;.join(traceback.format_stack()))
ERROR: Unable to parse Var &lt;OE_IMPORTED[:=]&gt;
Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/classes/base.bbclass&quot;, line 26, in oe_import(d=&lt;bb.data_smart.DataSmart object at 0x7fe4723c5270&gt;):
     
    &gt;    import oe.data
         for toimport in oe.data.typed_value(&quot;OE_IMPORTS&quot;, d):
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1024, in _find_and_load(name=&apos;oe.data&apos;, import_=&lt;built-in function __import__&gt;)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 171, in _ModuleLockManager.__enter__()
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-fedora/build/bitbake/lib/bb/cooker.py&quot;, line 168, in _ModuleLock.acquire():
                         bb.warn(&quot;\n&quot;.join(traceback.format_stack()))
    &gt;                return orig_acquire(self)
     
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 123, in _ModuleLock.acquire()
bb.data_smart.ExpansionError: Failure expanding variable OE_IMPORTED[:=], expression was ${@oe_import(d)} which triggered exception KeyError: 140619389032256
The variable dependency chain for the failure is: OE_IMPORTED[:=]

which shows us it is from a warning in garbage collection from asycio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93045</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2022-04-13 21:52:24 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00
https://git.yoctoproject.org/poky/commit/?id=b868387c425cca35c06179b90d44422fbaf2a9ab</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>