<?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>8078</bug_id>
          
          <creation_ts>2015-07-29 20:13:15 +0000</creation_ts>
          <short_desc>useradd.bbclass: useradd_preinst not run when rebuilding on second MACHINE</short_desc>
          <delta_ts>2017-04-13 14:16: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>1.8</version>
          <rep_platform>All</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>major</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Tollerton">rich.tollerton</reporter>
          <assigned_to name="Maxin B. John">maxin.john</assigned_to>
          <cc>jku</cc>
    
    <cc>ken.sharp</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>rich.tollerton</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</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>52715</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Tollerton">rich.tollerton</who>
    <bug_when>2015-07-29 20:13:15 +0000</bug_when>
    <thetext>I suppose this qualifies as a regression of [YOCTO #4739].

To reproduce:

1) Start with a clean unmodified oe-core, no layers (I used master but this reproduces on fido)
2) Create meta/recipes-core/useraddtest-a.bb:

SUMMARY = &quot;useradd test A&quot;
LICENSE = &quot;MIT&quot;
LIC_FILES_CHKSUM = &quot;file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420&quot;

ALLOW_EMPTY_${PN} = &quot;1&quot;
inherit allarch useradd
USERADD_PACKAGES = &quot;${PN}&quot;

GROUPADD_PARAM_${PN} = &quot; --system foo&quot;
USERADD_PARAM_${PN} = &quot;-N -g foo foo&quot;



3) Create meta/recipes-core/useraddtest-b_1.0.bb:

DEPENDS += &quot;useraddtest-a&quot;
LICENSE = &quot;MIT&quot;
LIC_FILES_CHKSUM = &quot;file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420&quot;

FILES_${PN} = &quot;${datadir}/foo&quot;

do_install () {
	   mkdir -p ${D}${datadir}
	   echo foo &gt; ${D}${datadir}/foo
	   chown foo:foo ${D}${datadir}/foo
}


4) Build useraddtest-b for qemux86: `bitbake useraddtest-b`
5) Build useraddtest-b for qemuarm: `MACHINE=qemuarm bitbake useraddtest-b`

The qemuarm build fails when building useraddtest-b with:

| DEBUG: Executing shell function do_install
| chown: invalid user: &apos;foo:foo&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54860</commentid>
    <comment_count>1</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2015-10-01 09:05:35 +0000</bug_when>
    <thetext>Recreated the failure on master branch (commit: 979de7703cf3e468aa2923da1445138e1c93d234 ) 

for qemux86:
$ bitbake useraddtest-b

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: QA Issue: useraddtest-b: /useraddtest-b/usr/share/foo is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
NOTE: Tasks Summary: Attempted 732 tasks of which 709 didn&apos;t need to be rerun and all succeeded.

for qemuarm:
$ MACHINE=qemuarm bitbake useraddtest-b

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_install (log file is located at /home/maxin/poky/build/tmp/work/armv5e-poky-linux-gnueabi/useraddtest-b/1.0-r0/temp/log.do_install.16684)
ERROR: Logfile of failure stored in: /home/maxin/poky/build/tmp/work/armv5e-poky-linux-gnueabi/useraddtest-b/1.0-r0/temp/log.do_install.16684
Log data follows:
| DEBUG: Executing shell function do_install
| chown: invalid user: &apos;foo:foo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60919</commentid>
    <comment_count>2</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-07 15:10:18 +0000</bug_when>
    <thetext>One ugly work-around is to add this line in useradd.bbclass:

do_install[nostamp] = &quot;1&quot;

Other obvious way will be not to use the users/groups created by useradd inheriting packages in other packages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61076</commentid>
    <comment_count>3</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-12 10:53:32 +0000</bug_when>
    <thetext>As RP mentioned here:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7724#c16

Reverting the commit 0aed04a49ec13c3331169ca4fd2c820b03faf19c help in resolving this bug:
commit 0aed04a49ec13c3331169ca4fd2c820b03faf19c
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Tue Sep 23 20:01:28 2014 +0100

    layer.conf: Add in useradd dependencies as ABISAFE dependencies
    
    Currently allarch recipes using useradd rebuild each time MACHINE
    changes which is not desireable. Adding the useradd dependencies
    to this list ensures they do not change under these circumstances.
    
    (From OE-Core rev: 7743a309017f0fb9286f00b1f6f546ee95c05303)
    
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61280</commentid>
    <comment_count>4</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-04-15 12:12:18 +0000</bug_when>
    <thetext>This bug is quite similar to the issue already reported in #7724: 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7724

Late for 2.1. Moving to 2.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63389</commentid>
    <comment_count>5</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-06-28 09:09:24 +0000</bug_when>
    <thetext>Moving to M2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67130</commentid>
    <comment_count>6</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-10-11 12:07:10 +0000</bug_when>
    <thetext>
As per the comment, tried to save copies of the original master/group entries. However, it is really difficult to keep track when we clean the &quot;base-passwd&quot; package.

Couldn&apos;t resolve it on time. Moving to 2.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67421</commentid>
    <comment_count>7</comment_count>
      <attachid>3484</attachid>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-10-20 15:08:33 +0000</bug_when>
    <thetext>Created attachment 3484
proposed fix

update sstate_rundepfilter in sstatesig.py by providing a special case for useradd packages</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69038</commentid>
    <comment_count>8</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-12-12 13:53:49 +0000</bug_when>
    <thetext>patch sent to oe-core mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2016-December/130047.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70023</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-01-23 15:57:29 +0000</bug_when>
    <thetext>I&apos;d suggest this is retested now recipe specific sysroots has merged as I&apos;m hoping this solves the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70080</commentid>
    <comment_count>10</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-01-24 14:54:34 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; I&apos;d suggest this is retested now recipe specific sysroots has merged as I&apos;m
&gt; hoping this solves the problem.

Tested with both latest &quot;master&quot; and &quot;rpurdie/wip-rss&quot;. Still the error seems to be there (reproducible in the first build itself - no need for second build which depends on sstate)

Have also updated the &quot;useraddtest-b.bb&quot; from 
DEPENDS += &quot;useraddtest-a&quot;
to
RDEPENDS_${PN} += &quot;useraddtest-a&quot;

This doesn&apos;t seems to have an effect on the build failure.

# bitbake useraddtest-b
...
| chown: invalid user: ‘foo:foo’
| WARNING: /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/useraddtest-b/1.0-r0/temp/run.do_install.22893:1 exit 1 from &apos;chown foo:foo /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/useraddtest-b/1.0-r0/image/usr/share/foo&apos;
| ERROR: Function failed: do_install (log file is located at /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/useraddtest-b/1.0-r0/temp/log.do_install.22893)
ERROR: Task (/home/maxin/clone/poky/meta/recipes-core/useraddtest/useraddtest-b.bb:do_install) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 634 tasks of which 0 didn&apos;t need to be rerun and 1 failed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72406</commentid>
    <comment_count>11</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-04-12 19:12:38 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; I&apos;d suggest this is retested now recipe specific sysroots has merged as I&apos;m
&gt; &gt; hoping this solves the problem.
&gt; 
&gt; Tested with both latest &quot;master&quot; and &quot;rpurdie/wip-rss&quot;. Still the error
&gt; seems to be there (reproducible in the first build itself - no need for
&gt; second build which depends on sstate)

Can you test the scenario with https://patchwork.openembedded.org/series/6324/ ?

&gt; 
&gt; Have also updated the &quot;useraddtest-b.bb&quot; from 
&gt; DEPENDS += &quot;useraddtest-a&quot;
&gt; to
&gt; RDEPENDS_${PN} += &quot;useraddtest-a&quot;
&gt; 
&gt; This doesn&apos;t seems to have an effect on the build failure.
&gt; 
&gt; # bitbake useraddtest-b
&gt; ...
&gt; | chown: invalid user: ‘foo:foo’
&gt; | WARNING:
&gt; /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/
&gt; useraddtest-b/1.0-r0/temp/run.do_install.22893:1 exit 1 from &apos;chown foo:foo
&gt; /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/
&gt; useraddtest-b/1.0-r0/image/usr/share/foo&apos;
&gt; | ERROR: Function failed: do_install (log file is located at
&gt; /home/maxin/clone/poky/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/
&gt; useraddtest-b/1.0-r0/temp/log.do_install.22893)
&gt; ERROR: Task
&gt; (/home/maxin/clone/poky/meta/recipes-core/useraddtest/useraddtest-b.bb:
&gt; do_install) failed with exit code &apos;1&apos;
&gt; NOTE: Tasks Summary: Attempted 634 tasks of which 0 didn&apos;t need to be rerun
&gt; and 1 failed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72459</commentid>
    <comment_count>12</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-04-13 14:02:02 +0000</bug_when>
    <thetext>
&gt; Can you test the scenario with
&gt; https://patchwork.openembedded.org/series/6324/ ?
&gt; 
Applying this patch and adding DEPENDS += &quot;shadow-native&quot; to useraddtest-b.bb (as per RP&apos;s suggestion) fixes this error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72460</commentid>
    <comment_count>13</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2017-04-13 14:16:51 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=master-next&amp;id=8a186adf857d708cf204277790eb651fd2ae989a</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3484</attachid>
            <date>2016-10-20 15:08:33 +0000</date>
            <delta_ts>2016-10-20 15:08:33 +0000</delta_ts>
            <desc>proposed fix</desc>
            <filename>0001-sstatesig.py-update-sstate_rundepfilter-for-useradd-.patch</filename>
            <type>text/plain</type>
            <size>1616</size>
            <attacher name="Maxin B. John">maxin.john</attacher>
            
              <data encoding="base64">RnJvbSAzMmUxNjY5M2ZlYmU0OGQyNzNiYzljYzYxOTVlNDQ4NjE2ODllMjNhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiAiTWF4aW4gQi4gSm9obiIgPG1heGluLmpvaG5AaW50ZWwuY29t
PgpEYXRlOiBUaHUsIDIwIE9jdCAyMDE2IDE1OjMzOjMwICswMzAwClN1YmplY3Q6IFtQQVRDSF0g
c3N0YXRlc2lnLnB5OiB1cGRhdGUgc3N0YXRlX3J1bmRlcGZpbHRlciBmb3IgdXNlcmFkZCBwYWNr
YWdlcwoKV2l0aG91dCB0aGlzIGNoYW5nZSwgc3N0YXRlIGRlcGVuZGVuY3kgZmlsdGVyIG1vZGlm
aWVzIGRlcGVuZGVuY2llcwpvZiBwYWNrYWdlcyB3aGljaCBpbmhlcml0cyB1c2VyYWRkIGNsYXNz
IHdoaWxlIHJlYnVpbGRpbmcgaXQgZm9yIGFub3RoZXIKTUFDSElORS4KCkZpeGVzIFtZT0NUTyAj
ODA3OF0KClNpZ25lZC1vZmYtYnk6IE1heGluIEIuIEpvaG4gPG1heGluLmpvaG5AaW50ZWwuY29t
PgotLS0KIG1ldGEvbGliL29lL3NzdGF0ZXNpZy5weSB8IDcgKysrKysrKwogMSBmaWxlIGNoYW5n
ZWQsIDcgaW5zZXJ0aW9ucygrKQoKZ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