<?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>16203</bug_id>
          
          <creation_ts>2026-03-16 17:15:37 +0000</creation_ts>
          <short_desc>bitbake-setup fails with key error when updating and using local repositories</short_desc>
          <delta_ts>2026-03-19 18:05:43 +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>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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jason Gauthier">jagauthier</reporter>
          <assigned_to name="Alexander Kanavin">alex.kanavin</assigned_to>
          <cc>ccasciato</cc>
    
    <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>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>104671</commentid>
    <comment_count>0</comment_count>
    <who name="Jason Gauthier">jagauthier</who>
    <bug_when>2026-03-16 17:15:37 +0000</bug_when>
    <thetext>The scenario I&apos;ve reproduced is follows:
I&apos;ve created a json configuration.  Included in that json config are some standard yocto entries like so:
    &quot;sources&quot;: {
        &quot;bitbake&quot;: {
            &quot;git-remote&quot;: {
                &quot;remotes&quot;: {
                    &quot;origin&quot;: {
                        &quot;uri&quot;: &quot;https://git.openembedded.org/bitbake&quot;
                    }
                },
                &quot;branch&quot;: &quot;2.16&quot;,
                &quot;rev&quot;: &quot;2.16&quot;
            }
        },
        &quot;openembedded-core&quot;: {
            &quot;git-remote&quot;: {
                &quot;remotes&quot;: {
                    &quot;origin&quot;: {
                        &quot;uri&quot;: &quot;https://git.openembedded.org/openembedded-core&quot;
                    }
                },
                &quot;branch&quot;: &quot;whinlatter&quot;,
                &quot;rev&quot;: &quot;whinlatter&quot;
            }
        },

Additionally, I have added a repository that is hosted on the local disk that I am using for development (adding images, recipes, etc)
        &quot;meta-custom&quot;: {
            &quot;git-remote&quot;: {
                &quot;remotes&quot;: {
                    &quot;origin&quot;: {
                        &quot;uri&quot;: &quot;https://github.com/name/meta-custom.git&quot;
                    }
                },
                &quot;branch&quot;: &quot;whinlatter&quot;,
                &quot;rev&quot;: &quot;whinlatter&quot;
            }
        }

Since bitbake strips the git information and manages the repo, I use &quot;-L&quot; to initialize everything, like so:
 
 ./bitbake/bin/bitbake-setup --setting default top-dir-prefix . --setting default top-dir-name build init --non-interactive mymachine.conf.json mymachine

I get output that the build environment is created. With the custom entry having a symlink created:

Making a symbolic link /home/jgauthier/yocto/whinlatter_build/build/mymachine/layers/meta-custom pointing to /home/jgauthier/yocto/whinlatter_build/sources/meta-custom

I then build and deploy my image and make sure everything works perfectly.  But I want to extend it now.

So, I attempt to add a new entry, for ROS, to my JSON, like so:
        &quot;meta-ros2&quot;: {
            &quot;git-remote&quot;: {
                &quot;remotes&quot;: {
                    &quot;origin&quot;: {
                        &quot;uri&quot;: &quot;https://github.com/ros/meta-ros.git&quot;
                    }
                },
                &quot;branch&quot;: &quot;whinlatter&quot;,
                &quot;rev&quot;: &quot;whinlatter&quot;
            }
        }

bitbake-setup status shows me:
diff --git a/config-upstream.json b/config-upstream.json
index a1fa4a6..e749505 100644
--- a/config-upstream.json
+++ b/config-upstream.json
@@ -98,6 +98,17 @@
                     &quot;rev&quot;: &quot;whinlatter&quot;
                 }
             },
+            &quot;meta-ros2&quot;: {
+                &quot;git-remote&quot;: {
+                    &quot;branch&quot;: &quot;whinlatter&quot;,
+                    &quot;remotes&quot;: {
+                        &quot;origin&quot;: {
+                            &quot;uri&quot;: &quot;https://github.com/ros/meta-ros.git&quot;
+                        }
+                    },
+                    &quot;rev&quot;: &quot;whinlatter&quot;
+                }
+            },
             &quot;meta-virtualization&quot;: {
                 &quot;git-remote&quot;: {
                     &quot;branch&quot;: &quot;whinlatter&quot;,


Now, I when I run &quot;bitbake-setup update&quot; to apply the changes to the build environment I get this error:
Traceback (most recent call last):
  File &quot;/home/jgauthier/yocto/whinlatter_build/build/mymachine/layers/bitbake/bin/bitbake-setup&quot;, line 1012, in &lt;module&gt;
    main()
  File &quot;/home/jgauthier/yocto/whinlatter_build/build/mymachine/layers/bitbake/bin/bitbake-setup&quot;, line 1005, in main
    args.func(top_dir, all_settings, args, d)
  File &quot;/home/jgauthier/yocto/whinlatter_build/build/mymachine/layers/bitbake/bin/bitbake-setup&quot;, line 638, in build_update
    build_status(top_dir, settings, args, d, update=True)
  File &quot;/home/jgauthier/yocto/whinlatter_build/build/mymachine/layers/bitbake/bin/bitbake-setup&quot;, line 623, in build_status
    update_build(new_upstream_config, confdir, setupdir, layerdir, d,
  File &quot;/home/jgauthier/yocto/whinlatter_build/build/mmymachine/layers/bitbake/bin/bitbake-setup&quot;, line 336, in update_build
    layer_config[k][&quot;git-remote&quot;] = v[&quot;git-remote&quot;]
                                    ~^^^^^^^^^^^^^^
KeyError: &apos;git-remote&apos;

From what I can see in bitbake-setup, a function called update_build():
    layer_config = copy.deepcopy(config[&quot;data&quot;][&quot;sources&quot;])
    layer_overrides = config[&quot;source-overrides&quot;][&quot;sources&quot;]
    for k,v in layer_overrides.items():
        if k in layer_config:
            layer_config[k][&quot;git-remote&quot;] = v[&quot;git-remote&quot;] 

It&apos;s looking for a &quot;git-remote&quot; in the &quot;source-overrides&quot; section of &quot;config-upstream.json&quot; and it&apos;s simply not there because it is a &quot;local repository&quot;
I have not been able to work around this error.   I can build a new environment, and that works, but then I have to do a complete build which takes a fairly long time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104748</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2026-03-19 17:05:13 +0000</bug_when>
    <thetext>Hello Jason,

I think this was fixed in bitbake master branch with 
https://git.openembedded.org/bitbake/commit/?id=adc18646459d9ff3110d2b5459a913d15d9cf8e6

Can you check if that helps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104749</commentid>
    <comment_count>2</comment_count>
    <who name="Jason Gauthier">jagauthier</who>
    <bug_when>2026-03-19 18:05:43 +0000</bug_when>
    <thetext>I confirmed that the update_build() function in master resolves this.  I&apos;ve updated my templates. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>