Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

If a port is already bound, script should abort #15

Open
marpaia opened this issue Feb 14, 2017 · 2 comments
Open

If a port is already bound, script should abort #15

marpaia opened this issue Feb 14, 2017 · 2 comments
Labels

Comments

@marpaia
Copy link
Contributor

marpaia commented Feb 14, 2017

I had 8025 bound already and run demo.sh up and got an appropriate error message for the bound port, but the script continued and the webserver did not ultimately bind to the claimed port.

$ ./demo.sh up                                                                                                                                                                                                               3:18PM 02/14/17
Enter CN for self-signed SSL certificate [default 'kolide']:
Unable to find image 'kolide/openssl:latest' locally
latest: Pulling from kolide/openssl
b7f33cc0b48e: Already exists
e7284c3d8862: Pull complete
Digest: sha256:f88c701a7a92b4791626cc44b7aad365d63b34c94f98e4838bb1ba205444cc39
Status: Downloaded newer image for kolide/openssl:latest
Generating RSA private key, 2048 bit long modulus
........................................................................................................................................+++
..............................+++
e is 65537 (0x10001)
writing RSA key
Signature ok
subject=/CN=kolide
Getting Private key
Creating network "kolidequickstart_default" with the default driver
Creating kolidequickstart_mailhog_1
Creating kolidequickstart_redis_1
Creating kolidequickstart_mysql_1

ERROR: for mailhog  Cannot start service mailhog: driver failed programming external connectivity on endpoint kolidequickstart_mailhog_1 (0bf73a6e630c7bd1d4631b52b5def2b858e2d1f01d4f93037307869d180c743d): Bind for 0.0.0.0:8025 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.
Waiting for MySQL to accept connections...........
Kolide server should now be accessible at https://127.0.0.1:8412 or https://kolide:8412.
Note that a self-signed SSL certificate will generate a warning in the browser.
To allow other hosts to enroll, you may want to create a DNS entry mapping kolide to the IP of this host.
@groob
Copy link
Contributor

groob commented Feb 14, 2017

We defaulted the kolide from port 8080 to 8124 here for this exact reason. too many things use port 8080

Any thoughts on having it use a different port in addition to aborting?

@marpaia
Copy link
Contributor Author

marpaia commented Feb 14, 2017

I'm fine with it not working if there is a port conflict, but after the appropriate log about the port conflict error, execution continues:

Waiting for MySQL to accept connections...........
Kolide server should now be accessible at https://127.0.0.1:8412 or https://kolide:8412.

I'd have to test this flow again, since I killed the other service that was bound to 8025, but even with the above log, the server wasn't being hosted on https://127.0.0.1:8412. That's why I think execution should just exit 1 if a port is bound to instead of continuing.

@groob groob added the bug label Feb 15, 2017
groob added a commit to groob/kolide-quickstart that referenced this issue Feb 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants