Skip to content

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

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

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

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

Wanchen7 opened this issue Jan 6, 2017 · 10 comments

Comments

@Wanchen7
Copy link

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
Copy link
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
Copy link
Author

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 as completed Jan 9, 2017
@kylemanna
Copy link
Owner

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
* Warn about macOS performance and suggest workaround
* Closes #20 #19
@muyiou
Copy link

muyiou commented May 15, 2017

Can this problem be solved ?

@yunair
Copy link

yunair commented Jul 2, 2017

Use root user will solve it

@vbisbest
Copy link

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

@yunair
Copy link

yunair commented Aug 23, 2017

use root user to run command.

@vbisbest
Copy link

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
Copy link

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants