portainer: Cannot edit/duplicate a container when registry is not registered in Portainer

Description I started to use portainer from today, and want to edit environment variables through webui against a running container, but I can’t with this error message.

Cannot read property 'URL' of undefined

Steps to reproduce the issue:

  1. I started portainer like this.
$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
  1. And accessed to webui, and set authentification.
  2. When I can see the running docker container to access /#/containers/, I choose a running container.
  3. And clicked the Duplicate/Edit button
  4. Clicked Env tab
  5. Changed a value
  6. Clicked Start container button
  7. I checked this sentence and clicked Replace.
A container with the same name already exists. Portainer can automatically remove it and re-create one. Do you want to replace it?
  1. I checked this uri called(it was DELETE method) and this response status was 200.
https://portainer-XXXXXXXX.com/api/endpoints/1/docker/containers/YYYYYY?force=true&v=1
  1. The target container was kill and removed, and docker logs optimistic_fermi(portainer's container name) was no output when this error was shown.

Is there any way to trace any other logs?

Technical details:

  • Portainer version:
$ docker images|grep porta
portainer/portainer                                 latest              47dbf4321bb4        8 days ago          10.7MB
  • Target Docker version (the host/cluster you manage):
$ rpm -qa|grep docker
docker-engine-selinux-17.05.0.ce-1.el7.centos.noarch
docker-engine-17.05.0.ce-1.el7.centos.x86_64
  • Platform (windows/linux): GCP instance
$ uname -r
3.10.0-514.26.2.el7.x86_64
$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer):
$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
  • Target Swarm version (if applicable): not used.

  • Browser: Google Chrome 60.0.3112.101(Official Build) on Mac 10.12.6

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 25 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@msudak As a workaroud I think you can add the registry to portainer (Registries menu) with these infos :

Name : Asia GCR
URL : asia.gcr.io

Then when in Duplicate/Edit view, verify that the image and registry are ok before pressing “Start container”

Can confirm Knall0 issue…

"The Docker registry for the arm32v7/wordpress:latest image is not registered inside Portainer, you will not be able to create a container. Please register that registry first. "

While trying to duplicate/Edit the container.

Thanks for the report @knall0

We’re currently reviewing the UX/functionalites regarding how you specify images inside Portainer, see the discussion in #1434

Maybe I discovered a related bug; Docker.io seems not to be recognized as the Dockerhub-Registry and the same Error occurs. Steps to reproduce this Error:

  1. Start a (fresh) Portainer instance in docker docker run -d -p 9000:9000 --name="portainer" --privileged --restart=unless-stopped -v /var/run/docker.sock:/var/run/docker.sock -v /portainerdata:/data -e portainer/portainer:1.15.3
  2. Start a Jenkins instance in docker: docker run --privileged -p 8080:8080 -p 50000:50000 --name jenkins -v /jenkins/home:/var/jenkins_home jenkins/jenkins:2.73.2
  3. Go to container Jenkins and hit Duplicate/edit
  4. Edit Image Configuration Name to: docker.io/jenkins/jenkins:2.73.3
  5. Go again to container Jenkins and hit Duplicate/edit –> The Gui shows this Error: The Docker registry for the docker.io/jenkins/jenkins:2.73.3 image is not registered inside Portainer, you will not be able to create a container. Please register that registry first.

Workaround: If I use in step 4 the image tag jenkins/jenkins:2.73.3 instead - so without the docker.io/ - there will be no error. But the dropdown menu suggests only image tags with docker.io/, so this will be the first one to try.

I would try to recognize docker.io as dockerhub, so that the registry is registered.

Right this might be problematic indeed, I’ll investigate a bit. Thanks for the details @masudak

EDIT: normally, if the registry is not known by Portainer, it should default to Dockerhub.