Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

image push success , but webui not image info. #1035

Closed
skyneteye opened this issue Aug 19, 2016 · 12 comments
Closed

image push success , but webui not image info. #1035

skyneteye opened this issue Aug 19, 2016 · 12 comments

Comments

@skyneteye
Copy link

infrastructure

$ docker -v
Docker version 1.11.2, build b9f10c9
/opt/gitlab/Portus$ docker-compose -v
docker-compose version 1.8.0, build 94f7016

$ sudo docker images
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
portus_web                        latest              fa172999684a        3 hours ago         1.088 GB
registry                          2.3.1               83139345d017        5 months ago        165.8 MB
mariadb                           10.0.23             93631b528e67        6 months ago        304.6 MB
rails                             4.2.2               99b347e4bbb4        14 months ago       884.7 MB

docker server run info:

$ sudo docker ps -a
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                              NAMES
10750fdfbb61        library/registry:2.3.1    "/bin/registry /etc/d"   23 minutes ago      Up 23 minutes       0.0.0.0:5000-5001->5000-5001/tcp   portus_registry_1
a5f5350014dd        portus_web                "bin/crono"              23 minutes ago      Up 23 minutes       3000/tcp                           portus_crono_1
0c7ce13887f1        portus_web                "puma -b tcp://0.0.0."   23 minutes ago      Up 23 minutes       0.0.0.0:3000->3000/tcp             portus_web_1
7f7e8bec3a95        library/mariadb:10.0.23   "/docker-entrypoint.s"   23 minutes ago      Up 23 minutes       3306/tcp                           portus_db_1

Error library/registry:2.3.1 container logs

time="2016-08-19T06:28:36Z" level=error msg="retryingsink: error writing events: httpSink{http://onlyeric.reg:3000/v2/webhooks/events}: error posting: Post http://onlyeric.reg:3000/v2/webhooks/events: dial tcp: lookup onlyeric.reg on 8.8.8.8:53: no such host, retrying"
time="2016-08-19T06:28:36Z" level=warning msg="httpSink{http://onlyeric.reg:3000/v2/webhooks/events} encountered too many errors, backing off"

@holgerreif
Copy link

dial tcp: lookup onlyeric.reg on 8.8.8.8:53: no such host

Portus cannot resolve the name onlyeric.reg you gave to the registry. Of course, google's nameserver (8.8.8.8) does not know about your private name...

@skyneteye
Copy link
Author

@holgerreif thanks!

@monstermunchkin
Copy link
Contributor

Closing this issue since it's not a problem within Portus. As @holgerreif pointed out, make sure your host is resolvable.

@crunchy234
Copy link

I have the same issue but the hostname is resolvable.
Trace from the registry is:

registry_1  | time="2016-09-15T05:07:55Z" level=error msg="retryingsink: error writing events: httpSink{http://xeon-ubuntu-64:3000/v2/webhooks/events}: error posting: Post http://xeon-ubuntu-64:3000/v2/webhooks/events: dial tcp: lookup xeon-ubuntu-64 on 192.168.2.144:53: server misbehaving, retrying" 
registry_1  | time="2016-09-15T05:07:55Z" level=warning msg="httpSink{http://xeon-ubuntu-64:3000/v2/webhooks/events} encountered too many errors, backing off"

@crunchy234
Copy link

crunchy234 commented Sep 15, 2016

Also note that I followed this tutorial to set everything up with TLS on the same machine.
I also enabled LDAP for authentication which all works.
Things I can do:

  • login to the web interface
  • login, push and pull from the registry

Things I can't do:

  • See my containers and tags from the web interface

@crunchy234
Copy link

Ok just changed to an absolute IP and I get better trace but still no dice on viewing in the web interface.
It also seems to error out when getting the tag.
Trace:

registry_1  | time="2016-09-15T05:42:28Z" level=info msg="response completed" go.version=go1.5.3 http.request.contenttype="application/vnd.docker.distribution.manifest.v2+json" http.request.host="xeon-ubuntu-64:5000" http.request.id=cc85874f-2b3d-43ba-a723-6ed55fed0064 http.request.method=PUT http.request.remoteaddr="172.19.36.45:60428" http.request.uri="/v2/test/manifests/latest" http.request.useragent="docker/1.12.0 go/go1.6.3 git-commit/8eab29e kernel/4.4.0-36-generic os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0 \\(linux\\))" http.response.duration=15.327627ms http.response.status=201 http.response.written=0 instance.id=b17ade7f-33fe-41cc-83b6-b358ce67de09 version=v2.3.1 
registry_1  | mi.ip.is.here - - [15/Sep/2016:05:42:28 +0000] "PUT /v2/test/manifests/latest HTTP/1.1" 201 0 "" "docker/1.12.0 go/go1.6.3 git-commit/8eab29e kernel/4.4.0-36-generic os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0 \\(linux\\))"
web_1       | 
web_1       | 
web_1       | Started POST "/v2/webhooks/events" for 172.17.0.1 at 2016-09-15 05:42:28 +0000
web_1       | Cannot render console from 172.17.0.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
web_1       | Processing by Api::V2::EventsController#create as JSON
web_1       | Incoming event:
web_1       | {
web_1       |   "id": "34d5fbac-e2ce-4bd7-aaf1-cf6d3b0228da",
web_1       |   "timestamp": "2016-09-15T05:42:28.474132708Z",
web_1       |   "action": "push",
web_1       |   "target": {
web_1       |     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
web_1       |     "size": 18550,
web_1       |     "digest": "sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348",
web_1       |     "length": 18550,
web_1       |     "repository": "test",
web_1       |     "url": "https://xeon-ubuntu-64:5000/v2/test/manifests/sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348"
web_1       |   },
web_1       |   "request": {
web_1       |     "id": "cc85874f-2b3d-43ba-a723-6ed55fed0064",
web_1       |     "addr": "172.19.36.45:60428",
web_1       |     "host": "xeon-ubuntu-64:5000",
web_1       |     "method": "PUT",
web_1       |     "useragent": "docker/1.12.0 go/go1.6.3 git-commit/8eab29e kernel/4.4.0-36-generic os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0 \\(linux\\))"
web_1       |   },
web_1       |   "actor": {
web_1       |     "name": "joshc"
web_1       |   },
web_1       |   "source": {
web_1       |     "addr": "1af2a39deda8:5000",
web_1       |     "instanceID": "b17ade7f-33fe-41cc-83b6-b358ce67de09"
web_1       |   }
web_1       | }
web_1       | Handling 'push' event:
web_1       | {
web_1       |   "id": "34d5fbac-e2ce-4bd7-aaf1-cf6d3b0228da",
web_1       |   "timestamp": "2016-09-15T05:42:28.474132708Z",
web_1       |   "action": "push",
web_1       |   "target": {
web_1       |     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
web_1       |     "size": 18550,
web_1       |     "digest": "sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348",
web_1       |     "length": 18550,
web_1       |     "repository": "test",
web_1       |     "url": "https://xeon-ubuntu-64:5000/v2/test/manifests/sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348"
web_1       |   },
web_1       |   "request": {
web_1       |     "id": "cc85874f-2b3d-43ba-a723-6ed55fed0064",
web_1       |     "addr": "172.19.36.45:60428",
web_1       |     "host": "xeon-ubuntu-64:5000",
web_1       |     "method": "PUT",
web_1       |     "useragent": "docker/1.12.0 go/go1.6.3 git-commit/8eab29e kernel/4.4.0-36-generic os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0 \\(linux\\))"
web_1       |   },
web_1       |   "actor": {
web_1       |     "name": "joshc"
web_1       |   },
web_1       |   "source": {
web_1       |     "addr": "1af2a39deda8:5000",
web_1       |     "instanceID": "b17ade7f-33fe-41cc-83b6-b358ce67de09"
web_1       |   }
web_1       | }
web_1       |   Registry Load (0.2ms)  SELECT  `registries`.* FROM `registries` WHERE `registries`.`hostname` = 'xeon-ubuntu-64:5000' LIMIT 1
web_1       |   Namespace Load (0.4ms)  SELECT  `namespaces`.* FROM `namespaces` WHERE `namespaces`.`global` = 1 AND `namespaces`.`registry_id` = 1 LIMIT 1
web_1       | Could not fetch the tag for target {"mediaType"=>"application/vnd.docker.distribution.manifest.v2+json", "size"=>18550, "digest"=>"sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348", "length"=>18550, "repository"=>"test", "url"=>"https://xeon-ubuntu-64:5000/v2/test/manifests/sha256:11fe3737cb6446439d83fe9988a9a40f36d7493bf31fa87552df692b3ff90348"}
web_1       | Reason: Connection timed out - getaddrinfo
web_1       |   CACHE (0.0ms)  SELECT  `registries`.* FROM `registries` WHERE `registries`.`hostname` = 'xeon-ubuntu-64:5000' LIMIT 1  [["hostname", "xeon-ubuntu-64:5000"]]
web_1       |   CACHE (0.0ms)  SELECT  `namespaces`.* FROM `namespaces` WHERE `namespaces`.`global` = 1 AND `namespaces`.`registry_id` = 1 LIMIT 1  [["global", true]]
web_1       | ETHON: Libcurl initialized
web_1       |   Webhook Load (0.7ms)  SELECT `webhooks`.* FROM `webhooks` WHERE `webhooks`.`namespace_id` = 1
web_1       | ETHON: started MULTI
web_1       | ETHON: performed MULTI
web_1       | Completed 202 Accepted in 61ms (ActiveRecord: 4.8ms)
web_1       | [8] 172.17.0.1 - - [15/Sep/2016:05:42:28 +0000] "POST /v2/webhooks/events HTTP/1.1" 202 - 0.0664

@crunchy234
Copy link

Ah turns out it was ignoring it so I added the external registry as just the ip without port and it now works.

Sorry for the spam hopefully this helps the next person.

@robertofabrizi
Copy link

@crunchy234 Do you think that you can help me fix the issue?
My hostname is centos7.devops, but I see in the logs:


background_1  | Exception: Failed to open TCP connection to centos7.devops:443 (getaddrinfo: Name or service not known)
portus_1      | Started PATCH "/admin/registries/1" for 172.19.0.6 at 2018-02-27 16:15:31 +0000
portus_1      | Processing by Admin::RegistriesController#update as HTML
portus_1      |   Parameters: {"utf8"=>"✓", "authenticity_token"=>"oNHRuWK2KIkO6q/Y0HX4xgCCK45W0rGSG4mku8OBhDz/QbsbPQxysVPiS+V23fyh0fn204OvlrwFun2TymnVjQ==", "registry"=>{"name"=>"maas", "hostname"=>"centos7.devops", "use_ssl"=>"1", "external_hostname"=>"centos7.devops"}, "commit"=>"Update", "id"=>"1"}
portus_1      | SocketError: connection refused.
portus_1      | 
portus_1      | Registry not reachable:
portus_1      | #<Registry id: 1, name: "maas", hostname: "centos7.devops", created_at: "2018-02-27 16:11:31", updated_at: "2018-02-27 16:11:31", use_ssl: true, external_hostname: "centos7.devops">
portus_1      | SocketError: connection refused.

I'm following the examples/compose/secure example. Thank you so much!

@mssola
Copy link
Collaborator

mssola commented Feb 28, 2018

@robertofabrizi well, make sure that this is reachable from within the container, because both Portus and the background process says it isn't reachable. Make sure that you are using the right port (e.g. it's not the typical 5000 port).

@robertofabrizi
Copy link

robertofabrizi commented Feb 28, 2018

@mssola Thanks for the help mssola. I'm not exacly sure about how to do that, I simply followed the instructions here: https://github.com/SUSE/Portus/tree/master/examples/compose

I changed references of the hostname in env and nginx.conf: in particular, in .env

#MACHINE_FQDN=172.17.0.1
MACHINE_FQDN=centos7.devops 

and in nginx.conf

#server_name 172.17.0.1;
server_name centos7.devops

Then I did docker-compose up, then went to https://centos7.devops and created the default admin user, and finally set up the registry with a name (maas), hostname (centos7.devops) and ticked the "Use SSL" checkbox.

I didn't change anything else in the docker-compose.yml, and I didn't put https nor the port in the Hostname input field inside the Web Console, as per instructions at the above mentioned link.

EDIT: naturally I also generated some self signed certificates that are being used both by the Portus Web Console and by Docker login (I imported my self generated CA in the trust CA to be able to docker login to the private registry).

@mssola
Copy link
Collaborator

mssola commented Mar 7, 2018

@robertofabrizi let's keep the conversation in #1709 😉 .

@ehsanrocket
Copy link

ehsanrocket commented Oct 19, 2020

#2243 (comment)
this works for me
setting the PORTUS_BACKGROUND_SYNC_STRATEGY=update-delete in background section of the docker-compose file

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

No branches or pull requests

7 participants