1
votes

I'm trying to install gitlab with docker and my own docker-compose.yml file on my synology NAS according to the documentation

When i run this file on my synology (with terminal), i have an error with exited code 1 :

Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1

How can i configure my directory or docker-compose file to correct this error?

I have execute chmod -R 777 and chown -R root:root on data & logs & config.

web:
   image: 'gitlab/gitlab-ce:latest'
   restart: always
   hostname: 'gitlab.example.com'
   environment:
     GITLAB_OMNIBUS_CONFIG: |
       external_url 'https://gitlab.example.com'
       # Add any other gitlab.rb configuration here, each on its own line
   ports:
     - '80:80'
     - '443:443'
     - '22:22'
   volumes:
     - '/srv/gitlab/config:/etc/gitlab'
     - '/srv/gitlab/logs:/var/log/gitlab'
     - '/srv/gitlab/data:/var/opt/gitlab

The container exit fail (return 1) with the error below :

[2019-02-10T08:15:49+00:00] INFO: Running queued delayed notifications before re-raising exception [2019-02-10T08:15:49+00:00] ERROR: Running exception handlers [2019-02-10T08:15:49+00:00] ERROR: Exception handlers complete [2019-02-10T08:15:49+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out [2019-02-10T08:15:49+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2019-02-10T08:15:49+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions] (gitlab::gitlab-shell line 101) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ---- STDOUT: STDERR: /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:30:in initialize': Permission denied @ rb_sysopen - /var/log/gitlab/gitlab-shell/gitlab-shell.log (Errno::EACCES) from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:30:in open' from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:30:in initialize' from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:120:in new' from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_logger.rb:120:in <top (required)>' from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_keys.rb:4:in require_relative' from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_keys.rb:4:in <top (required)>' from /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys:24:in require' from /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys:24:in `' ---- End output of /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions ---- Ran /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-keys check-permissions returned 1

1

1 Answers

0
votes

I've replicated your setup and the last output given from docker logs (web_container_id) was

=> /var/log/gitlab/gitlab-rails/sidekiq_exporter.log <==
[2019-02-11 17:16:20] 127.0.0.1 - - [11/Feb/2019:17:16:20 UTC] "GET /metrics HTTP/1.1" 200 1298 "-" "Prometheus/2.5.0"

Your issue is related to accessing your directory from the user executing docker, since it inherits permissions from the folder and the /srv folder it's a super user folder.

You made the after configurations for docker installation on linux?

https://docs.docker.com/install/linux/linux-postinstall/

Beyond that, you need to ensure that your host directory is accessible to the user executing docker-compose, afterwards, it will not work either. You said that you used chown -R root:root after a chmod 777? It will cause no effect if you are running without root.

Dockerfile:

version: "3"
services:
  web:
   image: gitlab/gitlab-ce:latest
   restart: always
   hostname: gitlab.example.com
   environment:
     GITLAB_OMNIBUS_CONFIG: |
       external_url 'https://gitlab.example.com'
   ports:
     - 80:80
     - 443:443
     - 22:22
   volumes:
     - /srv/gitlab/config:/etc/gitlab
     - /srv/gitlab/logs:/var/log/gitlab
     - /srv/gitlab/data:/var/opt/gitlab