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

Can't start daemon : "failed to allocate gateway (172.18.0.1): Address already in use" #419

Closed
idkw opened this issue May 2, 2017 · 5 comments

Comments

@idkw
Copy link

idkw commented May 2, 2017

I have followed the guides to install the panel (v0.5.7) and the daemon (v0.3.7).
The panel works properly. However I don't manage to start the daemon.
I have used the auto installer for the daemon.
I have added the node json config under /srv/daemon/config/core.json as shown in the docs
But then when starting the daemon as root with npm start I get


root@LC-13234:/srv/daemon# npm start

> pterodactyl-daemon@0.3.7 start /srv/daemon
> node src/index.js | node_modules/bunyan/bin/bunyan -o short

13:56:50.560Z  INFO wings: + ------------------------------------ +
13:56:50.563Z  INFO wings: | Running Pterodactyl Daemon v0.3.7    |
13:56:50.564Z  INFO wings: |        https://pterodactyl.io        |
13:56:50.564Z  INFO wings: |  Copyright 2015 - 2016 Dane Everitt  |
13:56:50.564Z  INFO wings: + ------------------------------------ +
13:56:50.564Z  INFO wings: Loading modules, this could take a few seconds.
13:56:50.950Z  INFO wings: Modules loaded, starting Pterodactyl Daemon...
13:56:50.959Z  INFO wings: Checking container networking environment...
13:56:50.966Z  INFO wings: Attempting to start SFTP service container...
13:56:51.008Z  WARN wings: No isolated network interface for containers was detected, creating one now.
13:56:51.015Z  WARN wings: Unable to locate a suitable SFTP container in the configuration, creating one now.
13:56:51.016Z  INFO wings: Checking if we need to update the SFTP container image quay.io/pterodactyl/scrappy:latest, if so it will happen now.
13:56:51.025Z FATAL wings: A fatal error caused the daemon to stop abruptly.
    Error: (HTTP code 500) server error - failed to allocate gateway (172.18.0.1): Address already in use
        at /srv/daemon/node_modules/docker-modem/lib/modem.js:239:17
        at getCause (/srv/daemon/node_modules/docker-modem/lib/modem.js:269:7)
        at Modem.buildPayload (/srv/daemon/node_modules/docker-modem/lib/modem.js:238:5)
        at IncomingMessage.<anonymous> (/srv/daemon/node_modules/docker-modem/lib/modem.js:214:14)
        at emitNone (events.js:91:20)
        at IncomingMessage.emit (events.js:185:7)
        at endReadableNT (_stream_readable.js:974:12)
        at _combinedTickCallback (internal/process/next_tick.js:80:11)
        at process._tickDomainCallback (internal/process/next_tick.js:128:9)
    --
    additional: {
      "reason": "server error",
      "statusCode": 500,
      "json": {
        "message": "failed to allocate gateway (172.18.0.1): Address already in use"
      }
    }


Can you help me figure this out ?

Thanks

Versions:

System: Linux LC-13234 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
PHP: PHP 7.0.18-1~dotdeb+8.1
Docker: Docker version 17.04.0-ce, build 4845c56
NPM: 3.10.10
NodeJS: v6.10.2
Pterodactyl panel: v0.5.7
Pterodactyl dameon: v0.3.7

@idkw
Copy link
Author

idkw commented May 2, 2017

Ok I have found a workaround after digging into the daemon code.

The IP 172.18.0.1 comes from here : https://github.com/Pterodactyl/Daemon/blob/0a44d9ce34ce469f8481db06a1a6036efc82a4d7/src/controllers/network.js#L70

I have added this to my core.json config and now it works.
This should be added to the docs for other people facing the same issue.

 "docker": {
    "socket": "/var/run/docker.sock",
    "autoupdate_images": true,
    "network": {
      "interfaces": {
        "v4": {
          "subnet": "172.19.0.0/16",
          "gateway": "172.19.0.1"
        }
      }
    },
    "interface": "172.19.0.1"
  },

@parkervcp
Copy link
Member

You already have the pterodactyl ip addresses in use in docker.

You can edit the core.json to change the pterodactyl_nw ip address.

Similar to this.
https://gist.github.com/parkervcp/fa4c85eae05cb95f6242773cd1e38a9a

@DaneEveritt
Copy link
Member

It is such a rare issue that we don't have it prominently linked anywhere, however there is documentation in the sidebar for the Daemon.

https://daemon.pterodactyl.io/docs/customizing-network-interfaces

@idkw
Copy link
Author

idkw commented May 2, 2017

Ok thank you

@dhalucario
Copy link

It is such a rare issue that we don't have it prominently linked anywhere, however there is documentation in the sidebar for the Daemon.

https://daemon.pterodactyl.io/docs/customizing-network-interfaces

Updated link just in case some other people stumble upon this:
https://pterodactyl.io/daemon/configuration.html#custom-network-interfaces

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

No branches or pull requests

4 participants