<?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>12413</bug_id>
          
          <creation_ts>2017-12-11 16:51:38 +0000</creation_ts>
          <short_desc>Add a more helpful error message if the workdir is owned by uid/gid 0</short_desc>
          <delta_ts>2024-05-09 14:56:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>CROPS</product>
          <component>crops-default</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>https://github.com/crops/poky-container/issues/20</bug_file_loc>
          <status_whiteboard>   </status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Lock">joshuagloe</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</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>78664</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-12-11 16:51:38 +0000</bug_when>
    <thetext>Currently if the uid or gid of the workdir are 0, then the user will get a relatively cryptic message

Refusing to use a gid of 0
Traceback (most recent call last):
  File &quot;/usr/bin/usersetup.py&quot;, line 62, in &lt;module&gt;
    subprocess.check_call(cmd.split(), stdout=sys.stdout, stderr=sys.stderr)
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command &apos;[&apos;sudo&apos;, &apos;restrict_groupadd.sh&apos;, &apos;0&apos;, &apos;pokyuser&apos;]&apos; returned non-zero exit status 1

This should be changed to something more user friendly explaining what may have happened.

In the most common case, the argument passed as --workdir and was bind mounted wasn&apos;t yet created before docker starts. For example if the below command was used:

docker run -it --rm -v /foo:/workdir crops/poky --workdir=/workdir

If /foo didn&apos;t exist before running docker, then docker will create /foo and give it a uid:gid of 0. While this behavior seems like the wrong action to take, docker chose to preserve it due to reasons of &quot;not breaking workflows&quot;.

At that point all the user has to remove the directory docker created, and instead create it manually with the appropriate uid:gid.

Since the &quot;--mount&quot; option to docker will instead error if the directory doesn&apos;t exist, then the documentation could be changed to point out the &quot;--mount&quot; option as well. It however, can&apos;t be used on older version of docker.

Copied from https://github.com/crops/poky-container/issues/20</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98984</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-05-09 14:56:40 +0000</bug_when>
    <thetext>The GitHub issue [1] was marked as closed with:

https://github.com/crops/extsdk-container/commit/6e512f007829647351c50722bd4afb8472da7e1a


[1] https://github.com/crops/poky-container/issues/20</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>