Giter Club home page Giter Club logo

Comments (9)

seanchann avatar seanchann commented on May 12, 2024 3

@ywk253100 +1

from harbor.

xiahaoshawn avatar xiahaoshawn commented on May 12, 2024

@seanchann,It seems duplicate with #79

from harbor.

seanchann avatar seanchann commented on May 12, 2024

docker_ui-1.txt

same error when I rm mysql and any volume, then rebuild all image from scratch.
In Deploy/docker-compose.yml Not found any link or depends_on with mysql for ui, the hostname ‘mysql’ will be not found, may be that is a reason for this error

from harbor.

seanchann avatar seanchann commented on May 12, 2024

docker_mysql.txt

mysql container logs, may be helpful

from harbor.

reasonerjt avatar reasonerjt commented on May 12, 2024

could you please tar all your logs and attach to this issue?

from harbor.

seanchann avatar seanchann commented on May 12, 2024

Hi :

docker version:
Docker version 1.11.0, build 4dc5990

docker-compose version:
docker-compose version 1.6.2, build 4d72027

docker network:

NETWORK ID          NAME                DRIVER
1f513b5253f9        bridge              bridge              
54afb3da86ee        deploy_default      bridge              
bd5ac05a7fd4        host                host                
a6d96cec144d        none                nul

docker inspect deploy_default:

$ docker network inspect deploy_default 
[
    {
        "Name": "deploy_default",
        "Id": "54afb3da86ee885edcf96e041272e033b597ee10b8cf853d9606d68110c75cdb",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.21.0.0/16",
                    "Gateway": "172.21.0.1/16"
                }
            ]
        },
        "Internal": false,
        "Containers": {
            "25c08323f63baf7282cab323aa0cea20e168a77357dbb149dd027a766979f915": {
                "Name": "deploy_log_1",
                "EndpointID": "c0a776d7ac10df0607f56931133784d4919f95be74488d00a625bb1beaeaeef0",
                "MacAddress": "02:42:ac:15:00:02",
                "IPv4Address": "172.21.0.2/16",
                "IPv6Address": ""
            },
            "66820cd2726daa1ecfdaad41d12b523ea628ffca29b93b78310e8378e5adab17": {
                "Name": "deploy_registry_1",
                "EndpointID": "f90a79e2dc8920790da85be9df26825188e5be7565ed94e638757d49d867b416",
                "MacAddress": "02:42:ac:15:00:05",
                "IPv4Address": "172.21.0.5/16",
                "IPv6Address": ""
            },
            "b59d737375019f1c0f1a15b69a4e1b6b379b6713e85b79240a1d814f8c5ee074": {
                "Name": "deploy_mysql_1",
                "EndpointID": "5cf52f7a7fceff39b1a54c17b599a4a87b425c4989cf5c87eb0704ca2b404350",
                "MacAddress": "02:42:ac:15:00:04",
                "IPv4Address": "172.21.0.4/16",
                "IPv6Address": ""
            },
            "d31c0d001f63417f67892e5bd696f86bab63cf0e131a3831d45dab56a1ec917e": {
                "Name": "deploy_proxy_1",
                "EndpointID": "3489487707a18ab0170d78eb1ff69aca8742953b918861c80a190a65ca6f4391",
                "MacAddress": "02:42:ac:15:00:06",
                "IPv4Address": "172.21.0.6/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

all logs about this error:

harbor.tar.gz

from harbor.

ywk253100 avatar ywk253100 commented on May 12, 2024

Can you ping mysql in UI container before it crashes?

from harbor.

seanchann avatar seanchann commented on May 12, 2024

Hi:
I delete search dockerregistry.com line in resolv.conf on host, then ui connected db success.
anyone can tell me what happen.

@ywk253100
I ping mysql in UI container, this IP addr is right for mysql
but ui program get a wrong ip for mysql, it use mysql.dockerregistry.com to connection mysql

from harbor.

ywk253100 avatar ywk253100 commented on May 12, 2024

The error caused by the way how the Go DNS resolver resolves names.

There are two types of resolvers in golang, one is the pure Go resolver that sends DNS requests directly to the servers listed in /etc/resolv.conf, and other one uses a cgo-based resolver that calls C library routines such as getaddrinfo and getnameinfo. And by default the pure Go resolver is used.

The /etc/resolv.conf in your UI container should be like this:

search dockerregistry.com
nameserver 127.0.0.11
options ndots:0

Because the configuration "ndots" is set to 0, when you want to resolve "mysql", the resolver should try resolve "mysql." first, and then "mysql.dockerregistry.com.". But in the implements of the pure Go resolver, it will set "ndots" to 1 when "ndots" less than 1. So the pure Go resolver will try resolve "mysql.dockerregistry.com." first. As it happened, in your DNS, this domain name was valid, so you got a weird IP address. This also explains why ping works will in container, because ping handles "ndots" correctly.

There are two workarounds to solve this problem:

  1. Add "GODEBUG=netdns=cgo" to harbor/Deploy/templates/ui/env. This will make Go to use cgo-based resolver.
  2. Modify "mysql" in harbor/Deploy/docker-compose.yml to "mysql.harbor".

from harbor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.