<?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>16457</bug_id>
          
          <creation_ts>2026-10-17 17:44:19 +0000</creation_ts>
          <short_desc>Creating sstate for images breaks</short_desc>
          <delta_ts>2026-10-17 17:48:51 +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>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>ARM</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Denys Dmytriyenko">denis</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</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>107093</commentid>
    <comment_count>0</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-10-17 17:44:19 +0000</bug_when>
    <thetext>Force creating sstate for images by adding to local.conf:

SSTATE_SKIP_CREATION:task-image-complete:forcevariable = &quot;0&quot;
SSTATE_SKIP_CREATION:task-populate-sdk:forcevariable = &quot;0&quot;
SSTATE_SKIP_CREATION:task-populate-sdk-ext:forcevariable = &quot;0&quot;
SSTATE_SKIP_CREATION:task-create-image-spdx:forcevariable = &quot;0&quot;
SSTATE_SKIP_CREATION:task-create-image-sbom-spdx:forcevariable = &quot;0&quot;

$ bitbake core-image-minimal

ERROR: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_func_python() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:sstate_report_unihash(d)
     0003:
File: &apos;/OE/core-master/meta/classes-global/sstate.bbclass&apos;, lineno: 920, function: sstate_report_unihash
     0916:    report_unihash = getattr(bb.parse.siggen, &apos;report_unihash&apos;, None)
     0917:
     0918:    if report_unihash:
     0919:        ss = sstate_state_fromvars(d)
 *** 0920:        report_unihash(os.getcwd(), ss[&apos;task&apos;], d)
     0921:}
     0922:
     0923:#
     0924:# Shell function to decompress and prepare a package for installation
File: &apos;/OE/core-master/bitbake/lib/bb/siggen.py&apos;, lineno: 790, function: report_unihash
     0786:
     0787:            if &quot;.&quot; in self.method:
     0788:                (module, method) = self.method.rsplit(&apos;.&apos;, 1)
     0789:                locs[&apos;method&apos;] = getattr(importlib.import_module(module), method)
 *** 0790:                outhash = bb.utils.better_eval(&apos;method(path, sigfile, task, d)&apos;, locs)
     0791:            else:
     0792:                outhash = bb.utils.better_eval(self.method + &apos;(path, sigfile, task, d)&apos;, locs)
     0793:
     0794:            try:
File: &apos;/OE/core-master/bitbake/lib/bb/utils.py&apos;, lineno: 489, function: better_eval
     0485:    if extraglobals:
     0486:        ctx = copy.copy(ctx)
     0487:        for g in extraglobals:
     0488:            ctx[g] = extraglobals[g]
 *** 0489:    return eval(source, ctx, locals)
     0490:
     0491:@contextmanager
     0492:def fileslocked(files, *args, **kwargs):
     0493:    &quot;&quot;&quot;Context manager for locking and unlocking file locks. Uses
File: &apos;&lt;string&gt;&apos;, lineno: 1, function: &lt;module&gt;
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;

File: &apos;/OE/core-master/meta/lib/oe/sstatesig.py&apos;, lineno: 722, function: OEOuthashBasic
     0718:                update_hash(&quot;\n&quot;)
     0719:
     0720:            # Process this directory and all its child files
     0721:            if include_root or root != &quot;.&quot;:
 *** 0722:                process(root)
     0723:            for f in files:
     0724:                if f == &apos;fixmepath&apos;:
     0725:                    continue
     0726:                process(os.path.join(root, f))
File: &apos;/OE/core-master/meta/lib/oe/sstatesig.py&apos;, lineno: 661, function: process
     0657:                    except KeyError as e:
     0658:                        msg = (&quot;KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn&apos;t match &quot;
     0659:                            &quot;any user/group on target. This may be due to host contamination.&quot; %
     0660:                            (e, os.path.abspath(path), s.st_uid, s.st_gid))
 *** 0661:                        raise Exception(msg).with_traceback(e.__traceback__)
     0662:
     0663:                if include_timestamps:
     0664:                    # Need to clamp to SOURCE_DATE_EPOCH
     0665:                    if s.st_mtime &gt; source_date_epoch:
File: &apos;/OE/core-master/meta/lib/oe/sstatesig.py&apos;, lineno: 655, function: process
     0651:                    else:
     0652:                        add_perm(stat.S_IXOTH, &apos;x&apos;)
     0653:
     0654:                    try:
 *** 0655:                        update_hash(&quot; %10s&quot; % pwd.getpwuid(s.st_uid).pw_name)
     0656:                        update_hash(&quot; %10s&quot; % grp.getgrgid(s.st_gid).gr_name)
     0657:                    except KeyError as e:
     0658:                        msg = (&quot;KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn&apos;t match &quot;
     0659:                            &quot;any user/group on target. This may be due to host contamination.&quot; %
Exception: Exception: KeyError: &apos;getpwuid(): uid not found: 1000&apos;
Path /OE/core-master/build/tmp/work/qemuarm-oe-linux-gnueabi/core-image-minimal/1.0/sstate-build-image_complete is owned by uid 1000, gid 1000, which doesn&apos;t match any user/group on target. This may be due to host contamination.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107094</commentid>
    <comment_count>1</comment_count>
    <who name="Denys Dmytriyenko">denis</who>
    <bug_when>2026-10-17 17:48:51 +0000</bug_when>
    <thetext>BTW, this is with the default OEEquivHash:

BB_HASHSERVE = &quot;auto&quot;
BB_SIGNATURE_HANDLER = &quot;OEEquivHash&quot;

When switching to OEBasicHash, the sstate gets created fine, but the image always gets re-generated with do_rootfs() even when it exists in sstate.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>