docker-unifi-controller icon indicating copy to clipboard operation
docker-unifi-controller copied to clipboard

Can't connect

Open thom-nic opened this issue 9 years ago • 4 comments

Apologies as I suspect this is a PEBCAK but for some reason even though I can see the listening ports and running java process, every connect attempt is closed immediately.

if I docker-machine ssh into the box I can see the listening ports and running java process but still can't connect:

docker@dev:~$ netstat -anlt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
tcp        0      0 10.0.2.15:22            10.0.2.2:53390          ESTABLISHED 
tcp        0      0 :::8080                 :::*                    LISTEN      
tcp        0      0 :::8880                 :::*                    LISTEN      
tcp        0      0 :::22                   :::*                    LISTEN      
tcp        0      0 :::8443                 :::*                    LISTEN      
tcp        0      0 :::37117                :::*                    LISTEN      
tcp        0      0 :::2376                 :::*                    LISTEN      
docker@dev:~$ curl http://localhost:8080
curl: (52) Empty reply from server
docker@dev:~$ curl http://localhost:8880
curl: (52) Empty reply from server
docker@dev:~$ curl https://localhost:8443
curl: (35) Unknown SSL protocol error in connection to localhost:8443 

Java process is running but not mongod:

docker@dev:~$ ps ax|grep java
 7196 ?        SNl    0:04 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java -Xmx256M -jar /usr/lib/unifi/lib/ace.jar start
 7467 pts/0    S+     0:00 grep java
docker@dev:~$ ps ax|grep mongo
 7478 pts/0    S+     0:00 grep mongo

However no errors in the log:

$ docker logs unifi
/usr/lib/python2.7/dist-packages/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2016-01-20 14:38:59,688 CRIT Supervisor running as root (no user in config file)
2016-01-20 14:38:59,688 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2016-01-20 14:38:59,704 INFO RPC interface 'supervisor' initialized
2016-01-20 14:38:59,704 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-01-20 14:38:59,704 INFO supervisord started with pid 1
2016-01-20 14:39:00,708 INFO spawned: 'unify' with pid 8
2016-01-20 14:39:01,709 INFO success: unify entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Any thoughts?

thom-nic avatar Jan 20 '16 14:01 thom-nic

check the logs directory inside your data volume mount point check host firewalling are you using a preexisting data dir?

rednut avatar Jan 20 '16 19:01 rednut

I did use -v as described in the README like so -v /usr/local/lib/unifi/data:/usr/lib/unifi/data but the directory is empty on my host side. Should I only use it if I have a preexisting unifi controller data dir? I was expecting the dockerized controller to bootstrap and add data to that directory on first boot but it's still empty. No logs directory.

Although now I wonder if I'm experiencing this https://github.com/docker-library/mysql/issues/44#issuecomment-73318805 since yes, I am on osx and using docker-machine which uses boot2docker under the hood...

thom-nic avatar Jan 20 '16 20:01 thom-nic

yup, looks like the issue was with volume permissions between OSX and boot2docker. I removed the -v line and the I can connect to the controller webapp now.

Although I think I have to change the network configuration of my boot2docker VM - since by default it's NAT'ed I think it's not going to find any APs on my network until I change the network configuration to bridged. But that's a separate issue. Thanks for pointing me in the right direction!

thom-nic avatar Jan 20 '16 20:01 thom-nic

u cannot reliabaly mount osx paths into your docker containers using stock boot2docker... yet....

use a data volume container instead...

rednut avatar Feb 01 '16 23:02 rednut