Skip to content

Dependency Proxy configuration is improperly loading

Summary

The Dependency Proxy feature seems to be enabled automatically without needing to be enabled unlike how it is described in the documentation. It appears in the Packages and Registries menu in the group screen, can be toggled on and off, and can be accessed via the docker commands and responds as expected.

However, even when manually enabled, the ::Gitlab.config.dependency_proxy configuration lookup returns "enabled" => false.

Despite being in all other ways functional, the Dependency Proxy does not respond as expected via the API. Specifically, it is not possible to clear the cache via the API as described here: https://docs.gitlab.com/ee/api/dependency_proxy.html.

Steps to reproduce

  1. Ensure that gitlab_rails['dependency_proxy_enabled'] is NOT set to false and that Dependency Proxy is enabled in the test group on the web interface.
  2. Use the Dependency Proxy as describe here: https://docs.gitlab.com/ee/user/packages/dependency_proxy/index.html#use-the-dependency-proxy-for-docker-images.
  3. Check the Dependency Proxy page for the test group on the web interface and see that the number of blobs has increased.
  4. Attempt to clear the cache using the API.
  5. Notice that the number of blobs does not go down.

To actually remove the blobs (workaround):

  1. Open the gitlab-rails console.
  2. Enter @group = Group.find_by_id(group_id) where "group_id" is the group_id of the test group.
  3. Enter @group.dependency_proxy_blobs.destroy_all
  4. Confirm that the number of blobs has gone down on the web interface.

Example Project

What is the current bug behavior?

  1. The Dependency Proxy feature is enabled even if not enabled in the gitlab.rb.
  2. The ::Gitlab.config.dependency_proxy configuration lookup returns "enabled" => false even when enabled in the gitlab.rb and gitlab.yml files.
  3. Cannot purge the Dependency Proxy cache using the API

What is the expected correct behavior?

  1. The Dependency Proxy feature should only be enabled if enabled in the gitlab.rb as described here: https://docs.gitlab.com/ee/administration/packages/dependency_proxy.html
  2. The ::Gitlab.config.dependency_proxy configuration lookup should return "enabled" => true when enabled in the gitlab.rb and gitlab.yml files.
  3. Can purge the Dependency Proxy cache using the API

Relevant logs and/or screenshots

dependency_proxy_enable

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

System information
System:		Ubuntu 18.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.6.6p146
Gem Version:	2.7.10
Bundler Version:1.17.3
Rake Version:	12.3.3
Redis Version:	5.0.9
Git Version:	2.28.0
Sidekiq Version:5.2.9
Go Version:	unknown

GitLab information
Version:	13.5.3-ee
Revision:	b9d194b6b91
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	11.9
URL:		https://REDACTED
HTTP Clone URL:	https://REDACTED/some-group/some-project.git
SSH Clone URL:	git@REDACTED:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	13.11.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 >= 13.11.0 ? ... OK (13.11.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: 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: ... 3/1 ... yes 3/2 ... yes 3/3 ... yes 4/4 ... yes 11/6 ... yes 2/7 ... yes 2/8 ... yes 4/9 ... yes 2/10 ... yes 2/11 ... yes 11/12 ... yes 11/13 ... yes 11/14 ... yes 11/15 ... yes 11/16 ... yes 2/19 ... yes 2/21 ... yes 7/22 ... yes 19/23 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.24.0 ? ... yes (2.28.0) Git user has default SSH configuration? ... yes Active users: ... 4 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 6.x - 7.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by Caleb Cooper