Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot give access to gitlab registry when there are multiple defined #3839

Closed
ghost opened this issue May 20, 2020 · 1 comment · Fixed by #3870
Closed

Cannot give access to gitlab registry when there are multiple defined #3839

ghost opened this issue May 20, 2020 · 1 comment · Fixed by #3870

Comments

@ghost
Copy link

ghost commented May 20, 2020

Bug description
Portainer allows adding multiple gitlab 'registries' as there is one allocated for each project. When there are multiple defined, you cannot give access to them as you get the error Failure a registry is already defined for this URL

Expected behavior
This error should not be thrown.

Portainer Logs

portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 Templates already registered inside the database. Skipping template import.
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 Instance already has defined endpoints. Skipping the endpoint defined via CLI.
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 server: Reverse tunnelling enabled
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 server: Fingerprint f3:fb:dd:6b:60:54:1e:19:3e:f5:81:cd:8b:1b:fe:13
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 server: Listening on 0.0.0.0:8000...
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 Starting Portainer 1.23.2 on :9000
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:40 [DEBUG] [chisel, monitoring] [check_interval_seconds: 10.000000] [message: starting tunnel management process]
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:36:42 http error: Invalid JWT token (err=Invalid JWT token) (code=401)
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/19 23:58:03 http error: Invalid JWT token (err=Invalid JWT token) (code=401)
portainer_portainer.1.xqq9ek88zzt8@owner    | 2020/05/20 00:05:30 http error: Another registry with the same URL already exists (err=A registry is already defined for this URL) (code=409)

Steps to reproduce the issue:

  1. Add multiple gitlab projects as registries
    image

  2. Click manage access beside one and try to assign access for your team

  3. See error Failure a registry is already defined for this URL
    image

Technical details:

  • Portainer version: 1.23.2 & develop
  • Docker version (managed by Portainer): 19.03.8
  • Platform (windows/linux): Linux
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer): docker stack deploy
  • Browser: FireFox
@deviantony deviantony added this to the 2.0 milestone May 20, 2020
@ghost ghost added the severity/high label May 20, 2020
@deviantony deviantony added priority/high Core team priority priority/normal Core team priority and removed priority/high Core team priority labels May 20, 2020
@chiptus
Copy link
Contributor

chiptus commented May 28, 2020

It's reproducible using the above steps. I can add to step 2 to click save, I thought it should appear when I click manage access.

The problem is that each GitLab registry actually has the same URL (registry.gitlab.com), but each of them has a different registry.Gitlab.projectPath if I understand correctly. so the solution would be to check the type of the registry, and if it is GitLab, then check also the projectPath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants