Docker Image gitlab/gitlab-ce not starting properly due to random system error
Summary
When running the container gitlab-ce version 16.9.2-ce.0 on my NAS using Docker, it shuts down during the configuration process due to the following error: /opt/gitlab/embedded/lib/ruby/3.1.0/securerandom.rb:75:in `urandom': failed to get urandom (RuntimeError)
Steps to reproduce
- On the registry download the gitlab/gitlab-ce version 16.9.2-ce.0 image
- Launch the image with the following configurations (using the UI application on Synology): high-privilege (said to be root privileges), no resource limitations, Environment variables: (GITLAB_SSH=30001, GITLAB_PORT=30000), ports: (22 -> 30001, 443 -> 30002, 80 -> 30000), Paths: (/etc/gitlab -> gitlab/config, /var/opt/gitlab -> gitlab/data, /var/log/gitlab -> gitlab/logs)
- Start the container, look at the logs in order to see the error
Example Project
Unfortunately not possible with my specific setup, because I'm using a NAS DS415+
What is the current bug behavior?
The container starts, and after running for approximately for two seconds, it shuts down "unexpectedly".
What is the expected correct behavior?
The container starts, and gitlab starts, without the container crashing after two seconds of running
Relevant logs and/or screenshots
Full logs from the container:
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=16.9.2-ce.0
Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:
docker exec -it gitlab editor /etc/gitlab/gitlab.rb
docker restart gitlab
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
If this container fails to start due to permission problems try to fix it by executing:
docker exec -it gitlab update-permissions
docker restart gitlab
Cleaning stale PIDs & sockets
cat: /var/opt/gitlab/gitlab-rails/VERSION: No such file or directory
Preparing services...
Starting services...
Configuring GitLab...
/opt/gitlab/embedded/lib/ruby/3.1.0/securerandom.rb:75:in `urandom': failed to get urandom (RuntimeError)
from /opt/gitlab/embedded/lib/ruby/3.1.0/securerandom.rb:75:in `singleton class'
from /opt/gitlab/embedded/lib/ruby/3.1.0/securerandom.rb:42:in `<module:SecureRandom>'
from /opt/gitlab/embedded/lib/ruby/3.1.0/securerandom.rb:41:in `<top (required)>'
from <internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /opt/gitlab/embedded/cookbooks/package/libraries/settings_dsl.rb:21:in `<top (required)>'
from /opt/gitlab/embedded/cookbooks/package/libraries/deprecations.rb:3:in `require_relative'
from /opt/gitlab/embedded/cookbooks/package/libraries/deprecations.rb:3:in `<top (required)>'
from <internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/opt/gitlab/embedded/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /opt/gitlab/embedded/service/omnibus-ctl/check_config.rb:18:in `load_file'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:192:in `eval'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:192:in `load_file'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:187:in `block in load_files'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:186:in `each'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:186:in `load_files'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:29:in `<top (required)>'
from /opt/gitlab/embedded/bin/omnibus-ctl:25:in `load'
from /opt/gitlab/embedded/bin/omnibus-ctl:25:in `<main>'