Issues with GitLab CE Docker Upgrade


#1

3 months ago I setup a Gitlab CE Docker container with ease and it has been running great since. Today I noticed it was very outdated so following the directions at https://docs.gitlab.com/omnibus/docker/ I stopped the container, removed the container and re-created it using the proper command.

After this, the GitLab CE will not run. looking at the console I see the following output:

Configuring GitLab...                                                                                                                                                                           
                                                                                                                                                                                                
================================================================================                                                                                                                
Error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]'                                                                                
================================================================================                                                                                                                
                                                                                                                                                                                                
Mixlib::ShellOut::ShellCommandFailed                                                                                                                                                            
------------------------------------                                                                                                                                                            
Failed asserting that mode permissions on "/var/opt/gitlab/git-data/repositories" is 2770                                                                                                       
---- Begin output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----                                               
STDOUT:                                                                                                                                                                                         
STDERR: + grep -o ....$+ readlink -f /var/opt/gitlab/git-data/repositories                                                                                                                      
                                                                                                                                                                                                
+ stat --printf=%04a /var/opt/gitlab/git-data/repositories                                                                                                                                      
+ [ 0770 = 2770 ]                                                                                                                                                                               
---- End output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----                                                 
Ran set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] returned 1                                                          
                                                                                                                                                                                                
Cookbook Trace:                                                                                                                                                                                 
---------------                                                                                                                                                                                 
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command'                                                                          
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate'                                                                         
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index'                                                                                
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate'                                                                                  
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!'                                                                                  
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/definitions/storage_directory.rb:35:in `block (3 levels) in from_file'                                                                   

I tried to run the following commands to repair permissions but it doesn’t change the startup error.

docker exec -it gitlab update-permissions                                                                                                    
docker restart gitlab

Is there anything I can do to get this running again or have I lost everything? I’m fairly new to Docker and GitLab CE.


#2

I was able to resolve this by running chmod 2770 data/repositories and restarting the docker container. Once it had permission to the folder, it was able to perform the upgrade.


#3

I am running gitlab on docker (docker-compose) on a mac.
I had to run this command, on the mac host, before I started up my container for the first time:

mkdir -p /Users/Shared/gitlab/data/git-data/repositories
sudo chmod g+s /Users/Shared/gitlab/data/git-data/repositories