-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Portainer fails to pull images with authenticated registry and breaks deployments #9040
Comments
I've just been attempting to replicate this myself on a fresh CE 2.18.3 installation but am not running into the same issue you are. The steps I took:
I also then made a different change to the docker-compose.yml file just to make sure (in this case, I published an additional port) and triggered the webhook again, and once again the redeployment was successful, no errors. One thing to note about my steps above is that I did not do a Are you perhaps able to give us some more information on your setup, both on the server and agent side, as well as any specifics you're able to share about your setup that might relate (networking, firewall, etc). Also, if there's anything special about your private image that you're able to share, that might help. |
I ran docker login after the issue started, so this happened without it as well.
I'm wondering though, why do we need to pull an image on the server when we want to deploy somewhere else? It's not like we're shipping the image to the agent. |
We don't - I didn't during my attempted replication of your issue. I've just checked to confirm, the image I deployed on the remote environment is not on my Portainer Server environment at all. |
@figassis Would you be able to provide your code changes via a pull request and Portainer server and agent log files? Thanks. |
@kamlad sorry for the late reply, sidetracked at work. I'll submit as soon as I clean it up a bit |
We were hit by this problem after not resisting the upgrade temptation. Here is some information that would have helped us, in case it can be useful to others... Our workaround was to go back to an earlier version (we used both 2.15.1 and 2.16.0). This being said, we saw that there were many other similar issues that did not help but we missed this one (#7792) before using the workaround... maybe this is a better solution. Please confirm if you follow that path 😃 |
After a fresh install of a 2.18.4 (latest) ce server, same problem here, steps: 1- Setup server (latest version) 4- create a edge group
Otherside, if i pull direct (connect and go to images), works fine: And compose of edge stack works because image was deployed: |
I can confirm this on a clean server (just installed from scratch). Running 2.19.1 CE. |
Same with me on 2.19.4 BE, swarm with 5 nodes. It's been happening for a while. Some times updating the stack with the "pull image" toggle turned on will work, but most of the time I receive a "Cannot find image x." This is pulling from a private ECR repo. |
As the problem has been there for a while without much visible progress, can someone from the team tell us if it has been identified and if there a good chance it will be fixed in the next release? Thanks in advance |
I can confirm the same problem after upgrading Portainer to 2.20.3 BE. We have GitLab server with mix of public and private projects with Docker registries. Credentials (username nad PAT) with access to all projects and registeries are configured in Portainer Registeries UI. I can see and pull both public and private images trough Portainer Images UI. And via When I try to Update a Service in Portainer UI with option "Re-pull image" checked, then it does not pull private images. The same issue happens when using Portainer API
In that case Portainer fails to start Tasks with status Rejected and Error message: "No such image: ...". And they are getting rejected until they start on some Node with image from previous deployment. So instead of redeploy with new images it just restarts service using old images. Partial workaround is to stop and start a Stack. In that case it pulls images fine. However only to nodes where it just started new Tasks. On other Nodes are left outdated images which may be used if Service for some reason migrates to other Nodes. Only safe workaround is to manually pull images on all Swarm Nodes before updating a service with Portainer. |
any updates on this? we used 2.20.1 CE and we facies the same issue.
|
Same here, ECR images sometimes aren't downloaded due to the expired tokens. Re-deploying the stack works, updating a single service doesn't trigger the token renewal. |
Bug description
When using private images, deployments via webhook fail with "pull access denied for mycontainer, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"
Expected behavior
Redeployment via webhook should succees is properly authenticated
Portainer Logs
This is the response I receive
Steps to reproduce the issue:
Result: webhook will fail with message below:
Technical details:
docker run -p 9443:9443 portainer/portainer
):Additional context
Looks like portainer server always tries to pull the image locally (which makes no sense if it's trying to deploy remotely), and somehow never uses the authenticated docker hub registry, it uses the anonymous one and fails. Solution would be to just leave the remote agent deal with this, but there is no option to get around this because the local pull is hardcoded. I tested the changes below with a custom image and it just works.
The text was updated successfully, but these errors were encountered: