<?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>13279</bug_id>
          
          <creation_ts>2019-04-12 18:03:58 +0000</creation_ts>
          <short_desc>Make sure users/groups exist for package_write_* tasks</short_desc>
          <delta_ts>2023-12-11 21:13:08 +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>oe-core other</component>
          <version>2.7</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.0 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Kjellerstedt">peter.kjellerstedt</reporter>
          <assigned_to name="Eilís Ní Fhlannagáin">pidge</assigned_to>
          <cc>pidge</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tgamblin</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>83532</commentid>
    <comment_count>0</comment_count>
      <attachid>4472</attachid>
    <who name="Peter Kjellerstedt">peter.kjellerstedt</who>
    <bug_when>2019-04-12 18:03:58 +0000</bug_when>
    <thetext>Created attachment 4472
Make sure users/groups exist for package_write_* tasks

If the populate_lic task and any of the package_write_* tasks need to run, but the package task can be restored from the sstate cache, then the fetch task, which is a dependency of populate_lic, will wipe out the RSS including any users/groups that have been created. This results in that the package_write_* tasks are run without any user/group information, which causes them to fallback to either use the root user for any unknown users/groups (rpm) or to use the numeric UIDs/GIDs (deb/ipk). Neither solution will yield correct packages.

To resolve this problem, I devised a patch that adds handling of the package_write_* tasks to useradd.bbclass and submitted it to the openembedded-core mailing list (also attached to this bug report). However, Richard was not convinced this is the proper solution, and commented:

&gt; This may be a bigger problem than just package_write_*.
&gt; 
&gt; This feels like a bad thing to do since there may be other tasks which also rely on the user information being present. This probably only fixes one corner case but there are likey others :(.
&gt; 
&gt; Possible solutions might be:
&gt; 
&gt; a) To wipe out all sstate tasks if we&apos;re rerunning do_fetch
&gt; b) Preserve the user/group information around the cleaning of the sysroot
&gt; 
&gt; I think we may need to fix this generically...

I don&apos;t think preserving user/group information when cleaning the sysroot is the right thing to do, so I am now looking for pointers/ideas on how to wipe out all sstate tasks when do_fetch is rerun.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84023</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-05-31 13:11:41 +0000</bug_when>
    <thetext>You asked for a hint about ways to solve this problem. It took me a bit of digging but I remembered/found:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=3d3194a68fceba3fcc6b072ae9956870a8b5c4fd

which attempted to solve an older but similar problem.

That code basically forces some sstate to be skipped if certain other tasks will rerun. Whilst the need for that case was removed with RSS, the same mechanism may work here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84024</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-05-31 13:19:55 +0000</bug_when>
    <thetext>Option 2 may be to change:

python clean_recipe_sysroot() {
    # We remove these stamps since we&apos;re removing any content they&apos;d have added with
    # cleandirs. This removes the sigdata too, likely not a big deal,
    oe.path.remove(d.getVar(&quot;STAMP&quot;) + &quot;*addto_recipe_sysroot*&quot;)
    return
}

to include wiping out any setscene stamps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84683</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-08-15 15:23:39 +0000</bug_when>
    <thetext>Robert or Peter, could one of you work on this defect for M3 or even M4?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96057</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:21:58 +0000</bug_when>
    <thetext>Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96452</commentid>
    <comment_count>5</comment_count>
    <who name="Trevor Gamblin">tgamblin</who>
    <bug_when>2023-09-14 15:56:16 +0000</bug_when>
    <thetext>Moved to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97091</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-30 15:29:15 +0000</bug_when>
    <thetext>Bulk move to 5.0 M1. -- Randy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97505</commentid>
    <comment_count>7</comment_count>
    <who name="Peter Kjellerstedt">peter.kjellerstedt</who>
    <bug_when>2023-12-11 19:29:09 +0000</bug_when>
    <thetext>Richard asked me for a selftest for this issue, or instructions for a way to reproduce it. When I failed to reproduce it I went back in time to find the reason and I had to go all the way back to Zeus. There, in commit 27ce69861edb7e52078b59ebf8fefc9201e9a228, Richard removed the clean_recipe_sysroot() function mentioned above, and with it the cause of the recipe sysroot being wiped out in case the fetch task happens to be triggered. So it appears this issue was resolved more than four years ago.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97506</commentid>
    <comment_count>8</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-12-11 21:13:08 +0000</bug_when>
    <thetext>Thanks Peter, that is extremely helpful and much appreciated!

https://git.openembedded.org/openembedded-core/commit/?id=27ce69861edb7e52078b59ebf8fefc9201e9a228

is the link to the commit which fixed this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>4472</attachid>
            <date>2019-04-12 18:03:58 +0000</date>
            <delta_ts>2019-04-12 18:05:30 +0000</delta_ts>
            <desc>Make sure users/groups exist for package_write_* tasks</desc>
            <filename>0001-useradd.bbclass-Make-sure-users-groups-exist-for-pac.patch</filename>
            <type>text/plain</type>
            <size>3051</size>
            <attacher name="Peter Kjellerstedt">peter.kjellerstedt</attacher>
            
              <data encoding="base64">RnJvbSBhODBhZTc4OTQ0NjYwN2M5NGQ1YWYzYTMyYTcyZmIxYTRhYmMwODIyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBLamVsbGVyc3RlZHQgPHBrakBheGlzLmNvbT4KRGF0
ZTogV2VkLCAzIEFwciAyMDE5IDAzOjAyOjU1ICswMjAwClN1YmplY3Q6IFtQQVRDSF0gdXNlcmFk
ZC5iYmNsYXNzOiBNYWtlIHN1cmUgdXNlcnMvZ3JvdXBzIGV4aXN0IGZvcgogcGFja2FnZV93cml0
ZV8qIHRhc2tzCgpJZiB0aGUgcG9wdWxhdGVfbGljIHRhc2sgYW5kIGFueSBvZiB0aGUgcGFja2Fn
ZV93cml0ZV8qIHRhc2tzIG5lZWQgdG8KcnVuLCBidXQgdGhlIHBhY2thZ2UgdGFzayBjYW4gYmUg
cmVzdG9yZWQgZnJvbSB0aGUgc3N0YXRlIGNhY2hlLCB0aGVuCnRoZSBmZXRjaCB0YXNrLCB3aGlj
aCBpcyBhIGRlcGVuZGVuY3kgb2YgcG9wdWxhdGVfbGljLCB3aWxsIHdpcGUgb3V0CnRoZSBSU1Mg
aW5jbHVkaW5nIGFueSB1c2Vycy9ncm91cHMgdGhhdCBoYXZlIGJlZW4gY3JlYXRlZC4gVGhpcwpy
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