ccarney16 / pterodactyl-containers

Pterodactyl Panel within a docker container
230 stars 78 forks source link

error on fresh machine #100

Open mzramna opened 3 years ago

mzramna commented 3 years ago

i've installed following the wiki into a new machine using the same config files in the old one,the new machine only has a portainer-agent container , but even with this ,this error appear dont know why: failed to configure docker environment error=Error response from daemon: Pool overlaps with other one on this address space Stacktrace only the network created by the repo script exist in the computer additional info:

SSL=false
SSL_CERT="/etc/certs/cert.pem"
SSL_CERT_KEY="/etc/certs/cert.key"

##
# Panel Variables
# These variables can be used within pterodactyl.conf (.env when symlinked 
# into the docker webroot). These variables are also set via pterodactyl:env
# and pterodactyl:mail.
##
APP_URL=http://localhost/
APP_ENV=production
APP_DEBUG=false # DO NOT ENABLE!!! This toggles the ability to enable debug messages on errors.
APP_TIMEZONE=America/Sao_paulo
APP_ENVIRONMENT_ONLY=true

# Cache/Session Settings
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis

# Redis Settings
REDIS_HOST=cache
REDIS_PORT=6379

# MySQL Settings
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=pterodactyl
DB_USERNAME=ptero
DB_PASSWORD=pterodbpass

# Mail Settings
MAIL_DRIVER=mail
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM=no-reply@example.com

into the previous machine i've used the same config file,but intead of localhost i've used the local ip,i've tried the same here,but no difference

the generated configuration file that returned this issue was this:

debug: false
uuid: dc4cdf4e-13af-42be-a7ae-7874159f725b
token_id: FWl0bBshiL5X6zCT
token: LbIZKQjXN9k6As89KeYO0J8uP9n3T7OVMpNH6J6UMqaJPpjNoL3cP0un20MEqndP
api:
  host: 0.0.0.0
  port: 8080
  ssl:
    enabled: false
    cert: /etc/letsencrypt/live/192.168.0.<>/fullchain.pem
    key: /etc/letsencrypt/live/192.168.0.<>/privkey.pem
  upload_limit: 100
system:
  data: /var/lib/pterodactyl/volumes
  sftp:
    bind_port: 2022
allowed_mounts: []
remote: 'http://192.168.0.<>'

i've tried remove all the related files to the repo,recreated this node multiple times,also nothing changed,removed and recreated all the docker related files/data and it was not enough to fix

ccarney16 commented 3 years ago

You need to change the IP address pool the daemon is set to, otherwise the daemon will attempt to use the pool 172.18.0.0/16, which is most likely used by another network. You can configure networking within its yaml config. Its an odd feature and I'm not really too sure why pterodactyl is designed with knowing the IP addressing scheme beforehand.

Dungeonseeker commented 3 years ago

Got the exact same issue here. I'm running a fresh install of Ubuntu Server 20.04.2, have installed nothing else except Docker and Portainer.

All the other containers in the stack are connected to the pterodactyl_default network that is automatically created (in my case 172.18.0.0/16) but the daemon only connects for a split second when its started then it drops off and sits in an endless loop. My Docker default bridge is on 172.17.0.0 so I cannot work out why the daemon is having issues, its on a totally different subnet.

Could you give instructions on how exactly to change the pool? (as all my efforts have so far resorted in failure)

Cheers

TekExplorer commented 3 years ago

Just edit the wings config file from 172.18.0.1 to some other ip like 172.20.0.1 or something like that

On Tue, Apr 27, 2021, 12:02 PM Dungeonseeker @.***> wrote:

Got the exact same issue here. I'm running a fresh install of Ubuntu Server 20.04.2, have installed nothing else except Docker and Portainer.

All the other containers in the stack are connected to the pterodactyl_default network that is automatically created (in my case 172.18.0.0/16) but the daemon only connects for a split second when its started then it drops off and sits in an endless loop. My Docker default bridge is on 172.17.0.0 so I cannot work out why the daemon is having issues, its on a totally different subnet.

Could you give instructions on how exactly to change the pool? (as all my efforts have so far resorted in failure)

Cheers

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ccarney16/pterodactyl-containers/issues/100#issuecomment-827724741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHDKZXHUTS6KFUBXTUUCRTTK3NZZANCNFSM4ZEMGZIQ .

Dungeonseeker commented 3 years ago

Do you mean config.yml in the conf.d/daemon folder? When you create a new node in Pteradactyl it only gives you a very basic config file which doesn't contain any networking options other than the daemon listen IP/Port & SFTP listen IP/Port. You can see it above.

The issue is that because the daemon doesn't ever fully start it never connects to the panel to populate the config file fully so you're stuck in a loop where you need to change the IP to get the daemon to start but have nothing to actually change until it starts at least once.

I have even tried adding in the network section and changing the IP to another subnet, exact same result.

Unless I've wasted over an hour being dumb assuming the api: 0.0.0.0 is a listen address when its actually a broadcast address?

ccarney16 commented 3 years ago

This has been a problem with the golang daemon, as with the older nodejs daemon allows the user to make the network and it would autofill. usually after a single start, the daemon should be populating the rest of the config file. The problem stems from docker-compose taking 172.18.0.0/16 for the project's network. This could be avoided by generating the pterodactyl_nw network after installing docker, but this does not work on an already existing system with compose (unless if you force it to ignore 172.18.0.0/16)

Pfuenzle commented 3 years ago

I ran into this error too, but apparently I'm to dumb to change the subnet. I checked both the docker-compose and the config.yml for the daemon, but I didn't find any subnet value I could change. Could someone please pinpoint me in the right direction? Thanks

ZaxLofful commented 2 years ago

Does anyone know how to fix this issue? I just ran into it and I need some help to move forward.....

Mx772 commented 2 years ago

So, I'm getting the same issue here, and I am wondering if we can very direct answer of where we need to make this change because I cannot seem to find a way to resolve this.

Normally my go to would be define a separate network in the docker-compose file for the daemon service like so:

version: '2.3'
services:
<....>
  daemon:
    networks:
      - daemon_network
      <....>
networks:
  daemon_network:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.29.0.0/16
          gateway: 172.29.0.1

Which still gives me that error. I have checked via ifconfig that no other network besides the docker-created one is on that subnet.

If I check the status of that network it doesn't seem to be attached to any containers:

    {
        "Name": "pterodactyl_daemon_network",
        "Id": "abc123",
        "Created": "2022-01-23T16:02:03.015104868Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.29.0.0/16",
                    "Gateway": "172.29.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "daemon_network",
            "com.docker.compose.project": "pterodactyl",
            "com.docker.compose.version": "1.29.2"
        }

However, looking at the daemon container:

            "Bridge": "",
            "SandboxID": "39ba5f2eb25a0b479890561e49cbbe93dfbc551065ae2ead6afe129ccb2c67a8",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/39ba5f2eb25a",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "pterodactyl_daemon_network": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "9fa386b4f8fe",
                        "daemon"
                    ],
                    "NetworkID": "818d8e320df7560ef057683ca5152ea72a44cd6a4cdc32e263bd65a0d21deec5",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }```

Now comparing it to something like the panel, we _should_ have an IP/gateway defined here. However, even if I assign it a IP in that network in the docker-compose like:
```     daemon:
    networks:
      daemon_network:
        ipv4_address: 172.29.0.5

It throws the same error, even though the container does have a valid IP.

So my ask is exactly what file should change and could we get an example?

I see some mentioning the 'daemon yaml', the 'wings config', and 'daemon config' but could we get some clarification?

Edit for anyone else who gets this: Do docker system prune - https://docs.docker.com/engine/reference/commandline/system_prune/ You may have a down container/network that is using those subnets. Found I had a one that was using it within docker. Pruning it resolved it here.

ccarney16 commented 2 years ago

I am not too sure what you are asking, the compose network generated by compose is not the one used for the game servers. you have to change conf.d/daemon/config.yml to change out subnets. The reason I never declared the game network under compose is largely due to issues with compose 1.x managing networks. (ive been running v2.x for some time, on both docker/podman, and it appears to be more loose with defining networks, as external networks are no longer a thing and would just generate it if the network doesnt exist). Compose would error out when trying to destroy a network intended for that project if it is still populated with containers.

DieKatzchen commented 2 years ago

I would also like to know what, specifically, do we change in config.yml in order to "change out subnets". I can't see anything in there that sets subnet. I see two IP address lines, host: 0.0.0.0 and remote: 'http://192.168.0.<>'. Which one should be changed?

thomaswilliams123 commented 1 year ago

Hi, I am unsure of which setting to change in which config file. I seem to go around and around in circles with this. I know not a very informed question, but how do I change to address and what address should I change it to?

ameinild commented 1 year ago

I'm having the exact same issue. I have existing Docker networks, and I've tried following the guide to define a separate network for the daemon, but I still get the error, even though I can see the Daemon starts being attached to the network (I defined 172.64.0.0).

Is there anywhere else you need to define that the Daemon should "ignore" the network 172.18.0.0/16? Also, if someone could provide explicit guidance if anything needs to be edited in conf.d/daemon/config.yml to change subnets. It seems some of us here doesn't understand the subtle hints that are thrown.

Many thanks in advance.

Juganooo commented 1 month ago

I had the same issue and think i manage to resolve it by forcing the network in the config.yml by adding

docker:
  network:
    name: <name_of_the_network>

you can get the name of the network by

docker network ls