<?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>2218</bug_id>
          
          <creation_ts>2012-04-01 02:24:59 +0000</creation_ts>
          <short_desc>Useradd command fails after 10 retries</short_desc>
          <delta_ts>2012-04-17 08:58:23 +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>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(1.2) 2012-04-10: 0% implemented, running debuging tests</status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Scott Garman">scott.a.garman</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>jiajun.xu</cc>
    
    <cc>liang.li2</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>scott.a.garman</cc>
    
    <cc>sgw</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>19761</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2012-04-01 02:24:59 +0000</bug_when>
    <thetext>Tree/branch: poky/1.2_M4
Commit: 4d9f4d6ac25f39fe6d5491d05c7a26195bab648b

Following the wiki page: https://wiki.yoctoproject.org/wiki/PAM_Integration
to build a image with PAM support. Image do_rootfs failed:

| --
| WARNING: useradd command did not succeed. Retrying...
| WARNING: useradd command did not succeed. Retrying...
| WARNING: useradd command did not succeed. Retrying...
| WARNING: useradd command did not succeed. Retrying...
| WARNING: useradd command did not succeed. Retrying...
| ERROR: tried running useradd command 10 times without success, giving up
| xserver-nodm-init           ##################################################
|  Adding system startup for /buildarea2/yzhao-test/poky-test/build-pam/tmp/work/qemumips-poky-linux/core-image-sato-1.0-r0/rootfs/etc/init.d/xserver-nodm.
| xrandr                      ##################################################
| update-rc.d                 ##################################################
| sysvinit-pidof              ###########ERROR: Function failed: do_rootfs (see /buildarea2/yzhao-test/poky-test/build-pam/tmp/work/qemumips-poky-linux/core-image-sato-1.0-r0/temp/log.do_rootfs.18567 for further information)
| #######################################
| 
NOTE: package core-image-sato-1.0-r0: task do_rootfs: Failed
ERROR: Task 8 (/buildarea2/yzhao-test/poky-test/meta/recipes-sato/images/core-image-sato.bb, do_rootfs) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 4695 tasks of which 455 didn&apos;t need to be rerun and 1 failed.

Summary: 1 task failed:
  /buildarea2/yzhao-test/poky-test/meta/recipes-sato/images/core-image-sato.bb, do_rootfs
Summary: There were 24 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20070</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2012-04-09 16:19:38 +0000</bug_when>
    <thetext>This failure is apparently a nondeterministic error that is appearing randomly.

The useradd class now uses code which checks that the user account or group account was created in the passwd and group files, respectively. If the account was not created (which is verified via a grep command), the script sleeps for 1 second and tries again, up to 10 times. This is intended to avoid lockfile races, as useradd and groupadd lock the passwd and group files when creating accounts.

I&apos;ll take this bug, I have the most familiarity with the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20164</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2012-04-11 05:11:38 +0000</bug_when>
    <thetext>The root cause of this bug is that, despite efforts to ensure base-passwd and (if needed) shadow packages get installed first, they are actually not. I&apos;ve found that the do_rootfs logs for the final image when this bug occur show the useradd retry failure up until the point that the shadow package is installed. After that fact, any package installations that need to call useradd will succeed. 

Further research is ongoing to discover why shadow is not being installed by RPM earlier in the rootfs generation process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20204</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Garman">scott.a.garman</who>
    <bug_when>2012-04-12 00:07:36 +0000</bug_when>
    <thetext>Richard fixed this in oe-core and poky master as of:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0923ee40ae59133c91a95e0727eb1ab95aca13b8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20514</commentid>
    <comment_count>4</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2012-04-17 08:58:23 +0000</bug_when>
    <thetext>Verified with 1.2 rc3.

Tree/branch: poky/1.2_M4
Commit: fae1c7a5fdcea199338b5f91efaafd7c72aec5dd</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>