<?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>15365</bug_id>
          
          <creation_ts>2024-01-23 20:00:38 +0000</creation_ts>
          <short_desc>bitbake-layers layerindex-fetch (or layerindex-show-depends) backtrace when layerbranch of dependent layer does not exist</short_desc>
          <delta_ts>2024-03-01 00:34:36 +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>5.0</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>5.1</target_milestone>
          
          <blocked>13954</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97965</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-23 20:00:38 +0000</bug_when>
    <thetext>Related to issue originally reported in https://bugzilla.yoctoproject.org/show_bug.cgi?id=13954

On dunfell:

$ bitbake-layers layerindex-show-depends meta-intel
NOTE: Starting bitbake server...
Loading https://layers.openembedded.org/layerindex/api/;branch=dunfell...
Traceback (most recent call last):
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/bin/bitbake-layers&quot;, line 95, in &lt;module&gt;
    ret = main()
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/bin/bitbake-layers&quot;, line 88, in main
    return args.func(args)
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/bblayers/layerindex.py&quot;, line 209, in do_layerindex_show_depends
    self.do_layerindex_fetch(args)
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/bblayers/layerindex.py&quot;, line 119, in do_layerindex_fetch
    (dependencies, invalidnames) = lIndex.find_dependencies(names=args.layername, ignores=ignore_layers)
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 442, in find_dependencies
    (dependencies, invalid) = _resolve_dependencies(layerbranches, ignores, dependencies, invalid)
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 385, in _resolve_dependencies
    deplayerbranch = layerdependency.dependency_layerBranch
  File &quot;/srv/build/ttorling/workspace-dunfell/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 914, in __getattr__
    raise AttributeError(&apos;%s not in datastore&apos; % name)
AttributeError: dependency_layerBranch not in datastore

This is happening in this case because meta-intel-qat LayerBranch does not exist for &apos;dunfell&apos; Branch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97966</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-23 20:03:13 +0000</bug_when>
    <thetext>Also happens on &quot;master&quot;:

$ bitbake-layers layerindex-show-depends meta-intel
NOTE: Starting bitbake server...
Loading https://layers.openembedded.org/layerindex/api/;branch=nanbield...
Traceback (most recent call last):
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 389, in _resolve_dependencies
    deplayerbranch = layerdependency.dependency_layerBranch
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 922, in __getattr__
    raise AttributeError(&apos;%s not in datastore&apos; % name)
AttributeError: dependency_layerBranch not in datastore

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/bin/bitbake-layers&quot;, line 95, in &lt;module&gt;
    ret = main()
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/bin/bitbake-layers&quot;, line 88, in main
    return args.func(args)
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/bblayers/layerindex.py&quot;, line 243, in do_layerindex_show_depends
    self.do_layerindex_fetch(args)
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/bblayers/layerindex.py&quot;, line 146, in do_layerindex_fetch
    (dependencies, invalidnames) = lIndex.find_dependencies(names=args.layername, ignores=ignore_layers)
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 450, in find_dependencies
    (dependencies, invalid) = _resolve_dependencies(layerbranches, ignores, dependencies, invalid)
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 392, in _resolve_dependencies
    logger.warning(&apos;layerdependency.dependency_layerBranch %s&apos; % layerdependency.dependency_layerBranch)
  File &quot;/srv/build/ttorling/workspace-upgrades/poky/bitbake/lib/layerindexlib/__init__.py&quot;, line 922, in __getattr__
    raise AttributeError(&apos;%s not in datastore&apos; % name)
AttributeError: dependency_layerBranch not in datastore

In this case it is because meta-dpdk &apos;nanbield&apos; LayerBranch does not exist.

$ bitbake-layers layerindex-show-depends meta-dpdk
NOTE: Starting bitbake server...
Loading https://layers.openembedded.org/layerindex/api/;branch=nanbield...
ERROR: Layer &quot;meta-dpdk&quot; not found in layer index

While this exposes gaps in Layerindex Metadata, it is still a bug in bitbake/lib/layerindexlib.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97968</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-23 21:29:00 +0000</bug_when>
    <thetext>Beginnings of a better error message:

https://git.yoctoproject.org/poky-contrib/log/?h=timo/layerindex-show-depends-debug

$ bitbake-layers layerindex-show-depends meta-acrn
NOTE: Starting bitbake server...
Loading https://layers.openembedded.org/layerindex/api/;branch=nanbield...
WARNING: layerdependency.dependency_layerBranch does not exist for meta-dpdk:nanbield
WARNING: Consider reaching out the to the layer maintainers or the layerindex admins
Layer                                              Git repository (branch)                                 Subdirectory
=============================================================================================================================
local:HEAD:openembedded-core                       https://git.yoctoproject.org/poky-contrib.git (timo/layerindex-show-depends-debug) meta
  required by: meta-acrn meta-intel meta-python meta-oe
  recommended by: meta-intel
layers.openembedded.org:nanbield:meta-intel        git://git.yoctoproject.org/meta-intel (nanbield)
  required by: meta-acrn
local:HEAD:meta-oe                                 https://git.openembedded.org/meta-openembedded-contrib (master) meta-oe
  required by: meta-python
local:HEAD:meta-python                             https://git.openembedded.org/meta-openembedded-contrib (master) meta-python
  required by: meta-acrn
layers.openembedded.org:nanbield:meta-acrn         https://github.com/intel/meta-acrn (nanbield)
Repository git://git.yoctoproject.org/meta-intel needs to be fetched
Repository https://github.com/intel/meta-acrn needs to be fetched</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98267</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-02-22 16:23:30 +0000</bug_when>
    <thetext>This was not ready in time for 5.0M3 feature freeze, so move it to 5.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98319</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-02-23 21:04:35 +0000</bug_when>
    <thetext>Submitted:

https://lore.kernel.org/bitbake-devel/20240223205833.2442592-1-tim.orling@konsulko.com/T/#u

https://patchwork.yoctoproject.org/project/bitbake/patch/20240223205833.2442592-1-tim.orling@konsulko.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98367</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-03-01 00:34:36 +0000</bug_when>
    <thetext>Fix merged in:
https://git.openembedded.org/bitbake/commit/?id=96cbe8f87209a927c157ebcf469f8b9d54fcf92e</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>