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

[Deployment Issue] Unable to access all ports of a container #1959

Open
skiv71 opened this issue Dec 13, 2023 · 1 comment
Open

[Deployment Issue] Unable to access all ports of a container #1959

skiv71 opened this issue Dec 13, 2023 · 1 comment

Comments

@skiv71
Copy link

skiv71 commented Dec 13, 2023

I have an IPFS docker container which exposes 4001, 5001 & 8080.

If I run the container on my local machine using docker, it all works ok... but in caprover, there appears to be an issue, where only 4001 is accessible.

With regards to connection, I'm only talking about within the caprover network (i.e. srv-captain--)

I've seen this issue #853 and I'm not sure I'm struggling with something similar?

I used caprover a few years ago and never had this issue.

I've tried running a terminal in another container to check the local docker network connectivity and this fails for anything but 4001

I've done some debugging and this is what I've found: -

docker service ps srv-captain--ipfs 

ID             NAME                      IMAGE                 NODE      DESIRED STATE   CURRENT STATE             ERROR                              PORTS
igihkqj2wjcu   srv-captain--ipfs.1       img-captain-ipfs:22   prod      Running         Running 52 minutes ago                                       
pmom5au7s53r    \_ srv-captain--ipfs.1   img-captain-ipfs:22   prod      Shutdown        Failed 52 minutes ago     "No such container: srv-captai…"   
3x31n3qs8w2z    \_ srv-captain--ipfs.1   img-captain-ipfs:22   prod      Shutdown        Shutdown 52 minutes ago                                      

docker ps

CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS                  PORTS                                                                      NAMES
db80051e34fb   alpine:latest                      "/bin/sh"                6 seconds ago    Up Less than a second                                                                              srv-captain--alpine.1.2e5jlblgdlsmxv3y90n1k1013
1644a1b7ce28   img-captain-ipfs:22                "./entrypoint.sh"        54 minutes ago   Up 54 minutes           4001/tcp, 5001/tcp, 8080-8081/tcp                                          srv-captain--ipfs.1.igihkqj2wjcutxiwtkmoe9ot1
4102cd1a9577   caprover/certbot-sleeping:v1.6.0   "/bin/sh -c 'sleep 9…"   42 hours ago     Up 42 hours             80/tcp, 443/tcp                                                            captain-certbot.1.dj2pnmkebt17qjr3ib2sw0j2j
e1a816c0a1f9   nginx:1.24                         "/docker-entrypoint.…"   42 hours ago     Up 42 hours             0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   captain-nginx.1.ejfandb6wuus84azpy6y88f6m
2ed730bde9d1   caprover/caprover:1.11.1           "docker-entrypoint.s…"   42 hours ago     Up 42 hours             0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                  captain-captain.1.f7f1rjehegogwtc5pfgge54mv

docker network inspect captain-overlay-network

[
    {
        "Name": "captain-overlay-network",
        "Id": "ng3g786zj4i6m0qugquj5t1k5",
        "Created": "2023-12-11T20:31:38.533749864Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.1.0/24",
                    "Gateway": "10.0.1.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "1644a1b7ce28ebd1547014b70db5d11f6bd580a091a2214f2394fc395c840c45": {
                "Name": "srv-captain--ipfs.1.igihkqj2wjcutxiwtkmoe9ot1",
                "EndpointID": "ada3c180da5437962284ae98b575af0c3caa4ec29c32c45c45f7be47e94c85d1",
                "MacAddress": "02:42:0a:00:01:c5",
                "IPv4Address": "10.0.1.197/24",
                "IPv6Address": ""
            },
            "2ed730bde9d1cf3d6de17eea26c2dd889d3e9a2d25bbfa562a96d5280df0b6bb": {
                "Name": "captain-captain.1.f7f1rjehegogwtc5pfgge54mv",
                "EndpointID": "f8d6f4a4ad2930a8f550236003616e8f25d816e496578474d162b2221c18b37e",
                "MacAddress": "02:42:0a:00:01:04",
                "IPv4Address": "10.0.1.4/24",
                "IPv6Address": ""
            },
            "e1a816c0a1f9f92945ab2b0a8845d00883122bf6bc51ff718673fcb53acf90d4": {
                "Name": "captain-nginx.1.ejfandb6wuus84azpy6y88f6m",
                "EndpointID": "0ce5ebbbd80e0daa699824f01d97d0d6ba3bdd2b858e931e93bc1a57253434ac",
                "MacAddress": "02:42:0a:00:01:07",
                "IPv4Address": "10.0.1.7/24",
                "IPv6Address": ""
            },
            "lb-captain-overlay-network": {
                "Name": "captain-overlay-network-endpoint",
                "EndpointID": "092f5bc602d24abfbdd33d698824021217ad7fc504a19a603003d31c84e538d9",
                "MacAddress": "02:42:0a:00:01:05",
                "IPv4Address": "10.0.1.5/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "c012a1aeb14a",
                "IP": "138.x.y.z"
            }
        ]
    }
]

@githubsaturn
Copy link
Collaborator

A common problem is when your source is only binding to a specific IP address. Connections work if they are set up like this: 0.0.0.0:5001

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

No branches or pull requests

2 participants