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

Problem with Gitlab private registry and Swarm Stack using web editor #11079

Open
2 tasks done
Daxterpol opened this issue Feb 7, 2024 · 5 comments
Open
2 tasks done
Labels

Comments

@Daxterpol
Copy link

Daxterpol commented Feb 7, 2024

Before you start please confirm the following.

Problem Description

For a long time now, creating a stack using the web editor and filling a docker-compose in using a private registry which is existing in the Registries menu and that we can browse normally and see the related image, does not work as attended.
Stack fails to deploy with the following error :

Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.056607119+01:00" level=error msg="Not continuing with pull after error: errors:\ndenied: requested access to the resource is denied\nunauthorized: authentication required\n"
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.057113552+01:00" level=info msg="Ignoring extra error returned from registry" error="unauthorized: authentication required"
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.060066974+01:00" level=error msg="pulling image failed" error="pull access denied for registry.gitlab.com/toto/toto_project/toto-img, repository does not exist or may require 'docker login': denied: requested access to the resource is denied" module=node/agent/taskmanager node.id=os43f7oac0t1ldwqn6i6gxd3g service.id=hyz3frcbj571blhnbhnh0g58e task.id=xmwjcgjpfxvi6jzep19q0y62z
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.060366644+01:00" level=error msg="fatal task error" error="No such image: registry.gitlab.com/toto/toto_project/toto-img" module=node/agent/taskmanager node.id=os43f7oac0t1ldwqn6i6gxd3g service.id=hyz3frcbj571blhnbhnh0g58e task.id=xmwjcgjpfxvi6jzep19q0y62z

Even if we try to do a docker login, same error is logged without the "repository does not exist or may require 'docker login'" log.
Sometimes, it works for a couple of days before being stuck again with these errors at the next webhook or manual polling.

The same container is successfully deployed if using Services and choosing the registry in the UI, instead of Stack which does not permit to use docker compose.

It sounds like the stack is not able to successfully use Registries credentials added successfully to portainer.

Expected Behavior

Stack is successfully deployed using the Registries set in Portainer and the associatied token with no error.

Actual Behavior

Stack is not successfully deployed using the Registries set in Portainer and the associatied token with authorization / authentication errror.

Steps to Reproduce

  1. Add a private gitlab registry using the Registries menu with a token that allow to use images (or with all permission, same result)
  2. Deploy a stack with the web editor using an image in the previously created gitlab registry as a container image
  3. Stack fails to deploy the image with the previous authentication/authorization error

Portainer logs or screenshots

Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.056607119+01:00" level=error msg="Not continuing with pull after error: errors:\ndenied: requested access to the resource is denied\nunauthorized: authentication required\n"
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.057113552+01:00" level=info msg="Ignoring extra error returned from registry" error="unauthorized: authentication required"
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.060066974+01:00" level=error msg="pulling image failed" error="pull access denied for registry.gitlab.com/toto/toto_project/toto-img, repository does not exist or may require 'docker login': denied: requested access to the resource is denied" module=node/agent/taskmanager node.id=os43f7oac0t1ldwqn6i6gxd3g service.id=hyz3frcbj571blhnbhnh0g58e task.id=xmwjcgjpfxvi6jzep19q0y62z
Feb  7 09:23:15 docker dockerd[3741060]: time="2024-02-07T09:23:15.060366644+01:00" level=error msg="fatal task error" error="No such image: registry.gitlab.com/toto/toto_project/toto-img" module=node/agent/taskmanager node.id=os43f7oac0t1ldwqn6i6gxd3g service.id=hyz3frcbj571blhnbhnh0g58e task.id=xmwjcgjpfxvi6jzep19q0y62z

Portainer version

2.19.4

Portainer Edition

Business Edition (BE/EE) with Starter Plus license

Platform and Version

Docker Swarm 24.0.7

OS and Architecture

Debian 11.8 AMD64

Browser

Chrome 121

What command did you use to deploy Portainer?

version: '3.8'

services:
  appv2:
    image: registry.gitlab.com/toto/toto_project/toto-img:latest
    restart: always
    ports:
      - "6889:443"
    extra_hosts:
      - "toto.toto.chc:192.168.50.65"
    deploy:
      resources:
        limits:
          cpus: '6'
          memory: 2048M
      update_config:
        order: start-first
      restart_policy:
        condition: any

Additional Information

We did a new fresh install of Portainer 2.19.4, the result is exactly the same.

@Daxterpol Daxterpol changed the title Problem with Gitlab private registry and stack using web editor Problem with Gitlab private registry and Swarm Stack using web editor Feb 7, 2024
@dblaws97473
Copy link

I'm experiencing the same error in the same conditions, I can't pull my private images

@lpotherat
Copy link

Similar issue with private self-hosted gitlab instance, and multiple registries from the same instance with different access tokens.

@fabien-github
Copy link

I have the same issue too, can we have an update on this please ?

@Daxterpol
Copy link
Author

Hi,

Any news on that issue please ?

Thanks

@arbianqx
Copy link

Having the same issue. Multiple environments and each environment has one or two stacks. Each registry is for each stack but when I check into images I see preselected different registries.

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

No branches or pull requests

5 participants