kerberos-io / kerberos-docker

Run Kerberos Open Source inside a docker container.
http://doc.kerberos.io/opensource/installation#docker
103 stars 31 forks source link

Kerberos docker images not working #2

Closed luismbo closed 7 years ago

luismbo commented 7 years ago

I've set up the kerberos.io docker image as follows:

$ cat docker-compose.yml
machinery:
    image: kerberos/machinery
    ports:
    - "8889"

web:
    image: kerberos/web
    ports:
    - "80"
    volumes_from:
    - machinery
    links:
    - machinery

$ sudo docker-compose up
Recreating kerberos_machinery_1
Recreating kerberos_web_1
Attaching to kerberos_machinery_1, kerberos_web_1
machinery_1 | 2017-01-05 22:09:01,015 CRIT Set uid to user 0
machinery_1 | 2017-01-05 22:09:01,055 INFO RPC interface 'supervisor' initialized
machinery_1 | 2017-01-05 22:09:01,057 CRIT Server 'unix_http_server' running without any HTTP authentication checking
machinery_1 | 2017-01-05 22:09:01,057 INFO supervisord started with pid 6
web_1       | 2017-01-05 22:09:01,384 CRIT Set uid to user 0
web_1       | 2017-01-05 22:09:01,424 INFO RPC interface 'supervisor' initialized
web_1       | 2017-01-05 22:09:01,426 CRIT Server 'unix_http_server' running without any HTTP authentication checking
web_1       | 2017-01-05 22:09:01,426 INFO supervisord started with pid 6
machinery_1 | 2017-01-05 22:09:02,061 INFO spawned: 'machinery' with pid 9
web_1       | 2017-01-05 22:09:02,430 INFO spawned: 'php5-fpm' with pid 9
web_1       | 2017-01-05 22:09:02,439 INFO spawned: 'nginx' with pid 10
machinery_1 | 2017-01-05 22:09:03,064 INFO success: machinery entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
web_1       | 2017-01-05 22:09:03,519 INFO success: php5-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
web_1       | 2017-01-05 22:09:03,520 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

I can see the two containers running:

$ sudo docker ps
CONTAINER ID        IMAGE                COMMAND               CREATED             STATUS              PORTS                            NAMES
489650de249f        kerberos/web         "/bin/bash /run.sh"   3 minutes ago       Up 3 minutes        443/tcp, 0.0.0.0:32772->80/tcp   kerberos_web_1
f1b26bb71054        kerberos/machinery   "/bin/bash /run.sh"   3 minutes ago       Up 3 minutes        0.0.0.0:32771->8889/tcp          kerberos_machinery_1

I can login into the web interface, but this is what I get:

screenshot from 2017-01-05 22-23-02

screenshot from 2017-01-05 22-24-15

I went into the settings panel and tried to set up an IPCamera pointing it to http://user:pass@192.168.1.118/video.cgi (I've confirmed this mjpg stream works from my browser) but nothing shows up in the logs.

Any hints on how I can troubleshoot this? (Thanks in advance!)

cedricve commented 7 years ago

Hey, this might be an issue with URL formatting do you have any other output streams (RTSP)?

luismbo commented 7 years ago

@cedricve thanks for your quick reply. I have a cheap D-link DCS-932LB. AFAICT, it does not support RTSP. Googling turned up some potential RTSP URLs I might be able to use with this camera, but I couldn't connect using VLC.

I've tried to input many different URLs into Kerberos.io's settings, but nothing ever shows up in the system log. Is that expected? (I was expecting to see some connection failures or similar.)

cedricve commented 7 years ago

Well that's an issue with current version of Kerberos.io. If the ip camera is connected to the wifi, Kerberos.io will keep trying to access the endpoint, although the endpoint may not exists. For the moment there is no way to detect this. You need to be sure about the endpoint, other wise it is stuck for ever.. Try to restart the virtual machine after your configured a new endpoint.

Hope this will be fixed in next versions..

Check this issue for more information kerberos-io/machinery#48

luismbo commented 7 years ago

@cedricve That might have been it. docker rm and docker-compose up seems to have fixed things: I can now see the live stream on the dashboard page. However, something strange started happening: clicking on the "Settings" takes me to the dashboard instead, so I can no longer change any settings.

cedricve commented 7 years ago

Can you send me the system files, which you can download on the system page.

luismbo commented 7 years ago

Here you go! kerberosio-configuration.tar.gz

cedricve commented 7 years ago

Looks ok. Can you remove the docker containers again, and add a project prefix:

docker-compose -p camera-frontdoor up -d

luismbo commented 7 years ago

Same thing. After I set up the camera, accessing /settings returns a 302 Found (rather than the usual 200 OK) with the Location header pointing to /.

cedricve commented 7 years ago

Can you ssh into the docker container and send me the contents of following file /var/www/web/app/storage/logs/laravel.log.

It looks like there is still something cached, you should try to remove all the images as well, so the kerberos images are downloaded again.

luismbo commented 7 years ago

Here it is: laravel.log.txt.

BTW, it's my first time using docker. I got into the docker container using sudo docker exec -i -t camerafrontdoor_web_1 /bin/bash. Is there a better way?

cedricve commented 7 years ago

@luismbo no that's fine 👍

By the way from the logs I see that it tries to load http://localhost:32778//capture//1483734134_6-372374_frontdoor_98-0-630-479_7875_20.jpg, but it can't.

Can you click on "Remove images" on the system tab, probably you will then be able to access the settings page again.

luismbo commented 7 years ago

Yep, that worked. Thanks!

cedricve commented 7 years ago

Can you fake some motion, and see if images occur on the daily overview and if you then can still access the settings page?

luismbo commented 7 years ago

I didn't have to fake any motion. After the stream resumes, it seems like the first frame is always considered motion and then the settings page stops working.

cedricve commented 7 years ago

True, after a restart it will take an initial frame. Can we open a teamviewer session? Easier to debug. You can add me on skype: cedricverst

luismbo commented 7 years ago

Yes, sure. Setting it up.

luismbo commented 7 years ago

Not sure how TeamViewer works. Want to guide me through it via https://appear.in/kerberos-docker-issue-2?

cedricve commented 7 years ago

After debugging, we can conclude this is a a docker related issue. I will check this and come back to you @luismbo.

cedricve commented 7 years ago

@luismbo issue will be resolved for docker in a couple of minutes. Currently Travis-CI is checking the building and create a new docker image. Progress over here: https://travis-ci.org/kerberos-io/web/builds/189856280

luismbo commented 7 years ago

Grabbed a new docker image, but now I'm back to square 1. It seems to be getting stuck trying to connect to my IPCamera. I suppose I'll wait for a fix to https://github.com/kerberos-io/machinery/issues/48 so the logs give me some sort of hint what's going on. I'm using the same URL as before: double-checked that against the configuration tarball I sent you before.

cedricve commented 7 years ago

This is typical behaviour with cheap IP camera's, you could try to restart the IP camera and your docker container.