Setting the values of *object_store_direct_upload in gitlab.rb without setting *object_store_connection values results in broken reconfigure
Summary
Setting the values of *object_store_direct_upload
in gitlab.rb
without setting *object_store_connection
values results in broken reconfigure. Also rake tasks and DB migrations cannot be executed.
Steps to reproduce
- add the following settings to your
/etc/gitlab/gitlab.rb
file without setting*object_store_connection
values:
gitlab_rails['external_diffs_object_store_enabled'] = true
gitlab_rails['external_diffs_object_store_direct_upload'] = true
gitlab_rails['external_diffs_object_store_background_upload'] = true
gitlab_rails['artifacts_object_store_enabled'] = true
gitlab_rails['artifacts_object_store_direct_upload'] = true
gitlab_rails['artifacts_object_store_background_upload'] = true
gitlab_rails['lfs_object_store_enabled'] = true
gitlab_rails['lfs_object_store_direct_upload'] = true
gitlab_rails['lfs_object_store_background_upload'] = true
- run
sudo gitlab-ctl reconfigure
What is the current bug behavior?
Reconfiguration will fail with the error (full error is shown below):
Settingslogic::MissingSetting: Missing setting 'provider' in 'connection' section in 'dependency_proxy' section in /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
What is the expected correct behavior?
Reconfiguration should be completed or should fail with friendlier error explaining the reason of the failure.
Relevant logs and/or screenshots
There was an error running gitlab-ctl reconfigure:
execute[clear the gitlab-rails cache] (gitlab::gitlab-rails line 401) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR: rake aborted!
Settingslogic::MissingSetting: Missing setting 'provider' in 'connection' section in 'dependency_proxy' section in /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:9:in `verify!'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:17:in `block (2 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:16:in `each'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:16:in `block in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:15:in `tap'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/direct_upload_support.rb:15:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => cache:clear => cache:clear:redis => environment
(See full trace by running task with --trace)
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknown
GitLab information Version: 12.0.2-ee Revision: ef76b54fc1e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.7 URL: https://hostname.tld HTTP Clone URL: https://hostname.tld/some-group/some-project.git SSH Clone URL: git@hostname.tld:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: bitbucket
GitLab Shell Version: 9.3.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 6/1 ... yes 6/2 ... yes 1/3 ... yes 1/4 ... yes 4/5 ... yes 5/6 ... yes 1/7 ... yes 6/8 ... yes 1/9 ... yes 1/10 ... yes 1/11 ... yes 1/12 ... yes 6/14 ... yes 1/15 ... yes 1/16 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 3 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished