New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chown: invalid user: 'aosp:aosp' #19

Closed
Wanchen7 opened this Issue Jan 6, 2017 · 10 comments

Comments

Projects
None yet
6 participants
@Wanchen7

Wanchen7 commented Jan 6, 2017

ocker_entrypoint: Creating user UID/GID [501/20]
groupadd: GID '20' already exists
docker_entrypoint: Creating user UID/GID [501/20] - done
docker_entrypoint: Copying .gitconfig and .ssh/config to new user home
cp: cannot create regular file '/home/aosp/.gitconfig': No such file or directory
docker_entrypoint: Creating /tmp/ccache and /aosp directory
chown: invalid user: 'aosp:aosp'

@kylemanna

This comment has been minimized.

Owner

kylemanna commented Jan 6, 2017

Problem here is that your primary group id collides with an existing system group id in the container.

Your user setup on your host is unusual, most Linux systems expert user ids > 1000 for users and 500-999 for system accounts. Same for group ids. See /etc/login.defs

Why is your group ID so low?

@Wanchen7

This comment has been minimized.

Wanchen7 commented Jan 9, 2017

I'm using the MBP with macOS 10.12. The UID start from 501 by default. I'm trying to change UID to 1001,seemed that create a brand new user, all the applications must be reinstall. So I drop this incredible way to build android source code. Thanks for answer my questions.

@Wanchen7 Wanchen7 closed this Jan 9, 2017

@kylemanna

This comment has been minimized.

Owner

kylemanna commented Jan 9, 2017

Well, running directly on macOS would likely lead to alot of headaches with the performance of hte volume mounting through the VM. I used to build Android on macOS in a Docker container (via Linux VM) a few years ago, and wouldn't recommend it.

kylemanna added a commit that referenced this issue Jan 9, 2017

README: Add macOS warning
* Warn about macOS performance and suggest workaround
* Closes #20 #19
@muyiou

This comment has been minimized.

muyiou commented May 15, 2017

Can this problem be solved ?

@yunair

This comment has been minimized.

yunair commented Jul 2, 2017

Use root user will solve it

@vbisbest

This comment has been minimized.

vbisbest commented Aug 22, 2017

How do you use root user? What commands do you run to set it? Thanks.

@yunair

This comment has been minimized.

yunair commented Aug 23, 2017

use root user to run command.

@vbisbest

This comment has been minimized.

vbisbest commented Aug 25, 2017

This seems random. Sometimes it works and sometimes it still throws the error. So the command is:
sudo AOSP_VOL=$PWD/build bash ./build-marshmallow.sh

And most of the time it still throws:
docker_entrypoint: Creating /tmp/ccache and /aosp directory
chown: changing ownership of '/tmp/ccache': Operation not permitted
chown: changing ownership of '/aosp': Operation not permitted

@vbisbest

This comment has been minimized.

vbisbest commented Aug 25, 2017

I was able to work around this issue.

  1. Had to delete aosp-root in the home folder.
  2. manually create the build, aosp and ccache folders in your working folder
  3. run sudo AOSP_VOL=$PWD/build bash ./build-marshmallow.sh

This gets it going on OSX

@joekiller

This comment has been minimized.

joekiller commented May 7, 2018

You can also just change the $AOSP_HOST_ID_ARGS in

docker run $AOSP_ARGS $AOSP_HOST_ID_ARGS $SSH_AUTH_ARGS $AOSP_EXTRA_ARGS \
to both be zero (0) and fix the ownership of the build directory afterwards with something like,

sudo chown -R $uid:$(id -g) build/

slightly less risky than doing a sudo docker ... command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment