Docker-gitlab: Changing permissions of '/home/git/data/repositories': Operation not permitted

Created on 25 Feb 2016  路  10Comments  路  Source: sameersbn/docker-gitlab

Hi,

I'm using RancherOS with docker and I'm getting this error with the gitlab container.
Redis and PostgreSQL are up and running.

2/25/2016 9:10:03 PMInitializing datadir...
2/25/2016 9:10:03 PM+ initialize_datadir
2/25/2016 9:10:03 PM+ echo 'Initializing datadir...'
2/25/2016 9:10:03 PM+ chmod 755 /home/git/data
2/25/2016 9:10:03 PM+ chown git: /home/git/data
2/25/2016 9:10:03 PM+ mkdir -p /home/git/data/ssh
2/25/2016 9:10:03 PM+ chown -R root: /home/git/data/ssh
2/25/2016 9:10:03 PM+ mkdir -p /home/git/data/repositories
2/25/2016 9:10:03 PM+ chown git: /home/git/data/repositories
2/25/2016 9:10:03 PM+ chmod ug+rwX,o-rwx /home/git/data/repositories
2/25/2016 9:10:03 PM+ exec_as_git chmod g+s /home/git/data/repositories
2/25/2016 9:10:03 PM++ whoami
2/25/2016 9:10:03 PM+ [[ root == git ]]
2/25/2016 9:10:03 PM+ sudo -HEu git chmod g+s /home/git/data/repositories
2/25/2016 9:10:03 PMchmod: changing permissions of '/home/git/data/repositories': Operation not permitted

Do you have any idea?

wontfix

Most helpful comment

What permissions would be those that gitlab expects? I have the very same problem with chmod/chown right now. I'm currently trying to establish a NFS gitlab docker mountpoint and I'm greeted with the following messages:

...
postgresql_1  | find: `/var/lib/postgresql/9.4/main/base/1/._11995': Operation not permitted
...

I have a /Volumes/docker mounted as a NAS mount point. I get tons of this messages all the time.

Don't know how to really fix this.

All 10 comments

How did you fix this error? Iv'e been wrestling with it for a while now.

@blandes I didn't solve it, I switched from RancherOS to Ubuntu with Rancher. I had the same problem with GlusterFS and NFS (since permission/ownership with NFS volumes doesn't work like that).

At the end I extended this image to modify the script, the chmod was not required in my case.

Maybe @sameersbn in yours docker images (since you do it for most of them), the chmod/chown should be allowed to fail with a warning.

Yeah, I had to make a clone of gitlab without the initialization, bash into it, and chmod/chown then make the original gitlab install correctly then turned off the clone. Odd, but I'm running into other Docker related permissions errors as well.

Maybe @sameersbn in yours docker images (since you do it for most of them), the chmod/chown should be allowed to fail with a warning.

I am not so sure about this. Gitlab expects the files and directories to have certain permissions. Not having the right permissions could effect merges requests, etc. I'll try adding an environment variable to be lenient with the chmod/chown operations.

What permissions would be those that gitlab expects? I have the very same problem with chmod/chown right now. I'm currently trying to establish a NFS gitlab docker mountpoint and I'm greeted with the following messages:

...
postgresql_1  | find: `/var/lib/postgresql/9.4/main/base/1/._11995': Operation not permitted
...

I have a /Volumes/docker mounted as a NAS mount point. I get tons of this messages all the time.

Don't know how to really fix this.

@oomathias Could you please re-open this issue? I'm having the exact same problem as @ninrod right now.

I think in most cases the problem is that the group id and user id of the volumes have to be shared between the host and the docker container.

Exporting two variables GID and UID, and using them to create the GITLAB_USER or PG_USER may solve the problem. I've seen a bunch of images doing this to solve related problems with NFS storage.

Have you tried to mount the volumes with the :Z volume label? https://docs.docker.com/engine/tutorials/dockervolumes/#/volume-labels

Hi guys,

Thanks for the quick responses. I've figured out why this happens, and actually it has nothing to do with this repo. I believe that the problem lies with a limitation of the cifs file system. I also believe that this install assumes nfs, as the installation medium. I was naively using cifs, which I read only allows one user:group pair to own the files or subfolders within a directory.

When I mounted my share with nfs the docker container worked like a charm.

I'm using nfs and I get the issue.

Attaching to gitlab_redis_1, gitlab_postgresql_1, gitlab_gitlab_1
redis_1       | chown: changing ownership of '/var/lib/redis': Operation not permitted
postgresql_1  | Initializing datadir...
gitlab_1      | Initializing logdir...
postgresql_1  | chown: changing ownership of '/var/lib/postgresql': Operation not permitted
gitlab_1      | Initializing datadir...
gitlab_1      | chown: changing ownership of '/home/git/data': Operation not permitted
gitlab_redis_1 exited with code 1
gitlab_postgresql_1 exited with code 1
gitlab_gitlab_1 exited with code 1

The weird thing is that it worked yesterday. Power went out, things came back on. Now it doesn't work.

This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings