bioatlas / ala-docker

Dockerized version of Atlas of Living Australia components
GNU Affero General Public License v3.0
12 stars 12 forks source link

Cannot start service proxy (on Mac) #28

Open dagendresen opened 6 years ago

dagendresen commented 6 years ago
dag$ make up
Starting services...
Removing nginx-proxy
psqldbimage is up-to-date
Recreating a4b16899e86b_nginx-proxy ... 
mysqldbwordpress is up-to-date
solr is up-to-date
mysqldblogger is up-to-date
mysqldbapi is up-to-date
Starting cassandradb                ... 
static is up-to-date
Starting wordpress                  ... 
Recreating a4b16899e86b_nginx-proxy ... error
Starting cassandradb                ... done
Starting wordpress                  ... done
Starting nameindex                  ... done
Starting imageservice               ... done
Starting loggerservice              ... done
Starting collectory                 ... done
Starting biocacheservice            ... 

ERROR: for a4b16899e86b_nginx-proxy  Cannot start service proxy: driver failed programming external connectivity on endpoint nginx-proxy (c3461adaf570cac0106885528646be562762a7e9d6da33066a8aefad2f307822): Error starting userland proxy: Bind fStarting biocacheservice            ... done
biocachehub is up-to-date
Starting biocachebackend            ... 
Starting biocachebackend            ... done

ERROR: for proxy  Cannot start service proxy: driver failed programming external connectivity on endpoint nginx-proxy (c3461adaf570cac0106885528646be562762a7e9d6da33066a8aefad2f307822): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE)
ERROR: Encountered errors while bringing up the project.
make: *** [up] Error 1
dagendresen commented 6 years ago

I had an Apache httpd on port 80, apachectl stop resulted in:

(...) ERROR: for dnsmasq Cannot start service dnsmasq: driver failed programming external connectivity on endpoint dnsmasq (f0b86b0407750031fdc829d56769d509dfce11f84ddef3cf8122ff93562a8981): Error starting userland proxy: Bind for 172.17.0.1:53: unexpected error (Failure EADDRNOTAVAIL)

mskyttner commented 6 years ago

The host running the docker daemon will need to have the 80 and 443 ports "free" if a proxy in a docker-compose.yml file binds to those ports when a composition is started (with docker-compose up -d).

Also if you have many different projects on the same host that you run simultaneously, only one proxy can be running - for the same reason - it is a singleton in that sense. It is possible to "break out" the singletons into a separate project - in this case it would be dnsmasq and proxy services - then you could run any number of different projects simultaneously if removing these services from those projects and making sure the same software defined networks are used across projects/compositions.

There are some important post-install steps required after installing docker on the host.

post-install steps

If the user running the docker daemon is not in the docker group various issues can pop up related to permissions on the system. There shouldn't ever be the need to use "sudo" - I think - with the docker command if properly setup. For example, see the the "usermod" step which does adds the user to the docker group here:

bash-script with docker and docker-compose installation steps

mskyttner commented 6 years ago

To update the status on this issue - the first error seem to come from another service running locally binding to the port (so the resolution is known), the second error appears to be similar - the docker process is not allowed to bind to port 53 on the host. Looks like a permissions issue. If the user running the docker process belongs to the "docker group" this shouldn't be an issue.

So @dagendresen pls confirm that the "post install steps" - which involves adding the local docker user to the docker group - is completed. If it is then this issue is due to something else and further details would be needed, such as logs etc.

Otherwise it could be marked as fixed, pending confirmation from @dagendresen.