Can't get the web interface to work

Support for the docker image maintained by dlandon
Post Reply
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Can't get the web interface to work

Post by ilan »

Following the instruction in https://community.home-assistant.io/t/z ... ion/162974
I have zone minder up and running. sudo docker ps gives

Code: Select all

f8e5404aeac8        dlandon/zoneminder             "/sbin/my_init"          43 minutes ago      Up 8 seconds                  443/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:8080->80/tcp   Zoneminder
The next step is Step 3: Configure Zoneminder: for which I should use the web interface.
This is shown in https://zoneminder.readthedocs.io/en/st ... arted.html

Code: Select all

http://<IP_of_docker>:8080/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=600
but it tells me the connection was reset.
I tried looking at viewtopic.php?t=10394, but couldn't find any solution there.

My code is

Code: Select all

sudo docker run -d --name="Zoneminder" \
--net="bridge" \
--privileged="true" \
-p 8080:80/tcp \
-p 9000:9000/tcp \
-e TZ="Israel/Haifa" \
-e SHMEM="50%" \
-e PUID="1000" \
-e PGID="1000" \
-e INSTALL_HOOK="1" \
-e INSTALL_FACE="1" \
-e INSTALL_TINY_YOLO="1" \
-e INSTALL_YOLO="0" \
-v "/home/ilan/ilan/docker/Zoneminder":"/config":rw \
-v "/home/ilan/ilan/docker/Zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder
I find the contents generated by Zoneminder in the zoneminder directory (which is what I expect to find). So the program is running, and I just can't get control over setting the options.

Thanks in advance,
Ilan
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Can't get the web interface to work

Post by burger »

Did you let the zoneminder container initialize fully before you accessed it? i.e. If you restart a container while it's starting for the first time, it can break things...

Homepage URL is http://localhost:80/zm/, not whatever you had. Although you might try http://localhost:8080/zm Docker will route to localhost (and maybe 0.0.0.0, not sure) by default.

You may want to use docker-compose.

Anyways, this looks like a pebkac issue. You should be able to troubleshoot it via logs on container, or via general docker troubleshooting (if you can't route to the container).
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I'm not 100% sure if I allowed enough time at the first access. I certainly let the sudo docker run -d finish before trying to attach.

I tried again both http://localhost:80/zm/ as well as the 8080 version. Both refuse to connect.
I decided to delete the contents of the zoneminder directory and then start zoneminder app again.
This would regenerate the files without the previous attempts.
I got
zone.png
zone.png (61.05 KiB) Viewed 14139 times
The docker command is my file, what I showed the last time around to start zoneminder.
An interesting one is mysql. This one said "This link cannot be used because its target '/config/mysql' doesn't exist".
Where is it supposed to exist, inside docker itself? That part is blind to me, but on my disk I have conf and not config.
I see in docker I have

Code: Select all

-v "/home/ilan/ilan/docker/Zoneminder":"/config":rw \
-v "/home/ilan/ilan/docker/Zoneminder/data":"/var/cache/zoneminder":rw \
There is the config, which is presumably referring to the docker contents.
I looked in my ubuntu partition and there is no /config and no /var/cache/zoneminder.

I see among the generated files is zoneminder/opencv/opencv.sh. It has something to do with nvidia, which is my display card.
Do I need to run something here??

I will try to move the commands over to docker-compose but I am afraid of doing more harm than good at this stage.
(I have home assistant running from docker-compose.)

BTW, several times I did do "rm" on the ps file and "rmi" on the image file.
Then I would regenerate them again with the docker command. So I had several attempts at the "initialization".
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

Update:
Since I got the strange mysql error, I thought that may be the problem.
I didn't have mysql running, so I set up both a server and client.
After mysql was up, I did another "rm" on the ps, and another "rmi" on the image.
I then did a clean up of the Zoneminder directory above, leaving only the docker command file.

Again I did another run of sudo docker run -d ..., exactly as shown on the first entry of this thread.
Instead of getting all the entries shown on my above screen shot, it added only an empty "data" folder inside Zoneminder.
There was a definite change between having mysql running or not running.

In spite of my hopes neither http://localhost:80/zm nor the 8080 worked. Both still refuse connection.
Can anyone suggest how to continue???
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I also thought I would try the ffmpeg command, which I had never seen.
First I used ifconfig to find the docker0 ip (I tried some of the other ips as well)

Code: Select all

ilan@ilan-AM1M-S2H:~$ ffmpeg -i rtsp://172.17.0.1:554/path output.mp4
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
.....
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[tcp @ 0x558c90753780] Connection to tcp://172.17.0.1:554?timeout=0 failed: Connection refused
rtsp://172.17.0.1:554/path: Connection refused
It isn't clear to me which paths I should look through, but I don't suppose I can if there is connection refused?
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I was wrong that only the data folder comes up with mysql running.
All the folders come up, only that they take a LONG time to do so.
Maybe I am starting zm before it finishes configuration?? But how long can the configuration take, hours??
How can I know it is finished??

This morning I looked at docker/Zoneminder/conf/zm.default

Code: Select all

# ==========================================================================
#
# ZoneMinder Base Configuration
#
# ==========================================================================
#
# *** DO NOT EDIT THIS FILE ***
#
# To make custom changes to the variables below, create a new configuration
# file, with an extention of .conf, under the /etc/zm/conf.d
# folder, containing your desired modifications.
#

# Path to installed data directory, used mostly for finding DB upgrade scripts
ZM_PATH_DATA=/usr/share/zoneminder

# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/bin

# Path to ZoneMinder libraries (none at present, for future use)
ZM_PATH_LIB=/usr/lib/x86_64-linux-gnu

# Path to ZoneMinder configuration (this file only at present)
ZM_PATH_CONF=/etc/zm
......
I looked on my Linux partition and most of these folders don't exist.
My only guess is that these folders exist inside docker, which I haven't been able to see.
Docker is a container which is still closed to me.

I have question if my definitions are reasonable, as to where to store the zm information.
In the code on the first page it has

Code: Select all

-v "/home/ilan/ilan/docker/Zoneminder":"/config":rw \
-v "/home/ilan/ilan/docker/Zoneminder/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder
Maybe putting it on my home partition, instead of the Liinux partition, is a mistake?

While I was at it, I looked at the available log files. Mostly they were binary and not text.
I looked with a hex editor but didn't get any useful information.

I must have some major mistake in what I am doing, but since I pretty much copied what was suppose to work, it isn't clear where my blunder could be.
Can anyone give me some help?

Thanks,
Ilan
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Can't get the web interface to work

Post by burger »

ilan wrote: Tue Sep 29, 2020 6:11 am But how long can the configuration take, hours??
No, a few minutes at most.
ilan wrote: Tue Sep 29, 2020 6:11 am
Can anyone give me some help?
You indicated that you don't know how to login to the docker container. It seems you're missing a basic understanding of Docker. Either read a book on Docker, or just use ZM without it. Docker adds overhead to setup sometimes.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I have been reading documentation all the time. One critical thing I still haven't found is how I can attach a terminal to the docker. The documentation talks about: docker login localhost:8080, which doesn't do a whole lot. Generally the login is to the docker hub which doesn't interest me because I have nothing there.
Early on I did see a video where the presenter had 2 terminals running, one to the host OS and the other to what was running inside docker. I haven't been able to figure out how she did that. It would be useful to be able to look inside docker and compare it to the outside world.

In the meantime I found a docker-compose for zm. I ran it and it was MUCH more helpful. It gave a lot of messages about what it was doing. I managed to see that it got hung up on MariaDB. I was used to mysql, so I learned what the differences were, and started to use it. I had permissions problems and managed to solve them. It is almost certain that I had the same problems, but since there were almost no messages in sudo docker run -d --name="Zoneminder", I didn't know that MariaDB was a problem.
I thought that zm was working entirely inside docker, but it is now clear that it is communicating with the outside world to MariaDB as well. To date I have the docker-compose working, but still no communication with localhost:8443.

I also have home assistant working inside docker. That does have connection to localhost but I need to add zm to get it to do something useful.
In addition I have some medical software which stores patient data inside a database (called Orthanc) and that part as well works inside docker.

The zm is primarily an exercise to see if I can get control over the software. If it works, then I can see if I can actually do something with it.
So far I am deep in the trenches.
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I thought I would try to run zoneminder on my laptop. That would give me a new point of view.
This time I knew up front to put in MariaDB. I used the docker-compose I have been using on this machine.
Things went smoothly and I expected the same problem, when I would attach a browser.

After a couple of wrong ports, I got it to reply. The address was https://localhost:8443/zm/.
It gave me warnings about an untrusted certificate, but I pushed on. To my surprise, up came zoneminder!
So I know it works using my docker-compose. I may have something else broken on this machine.
(Something connected to working with a browser. I tried both Firefox and Chromium and both fail.)

In any case one of the principle goals was to get more hands on experience with docker.
If you can point me in the direction of being able to get a second terminal going, it would be great.
I want one to get results from inside docker, in addition to the usual one to get results from the OS.
I saw this working in a video on docker and I would like to be able to do the same thing.
ilan
Posts: 8
Joined: Thu Sep 24, 2020 10:51 am

Re: Can't get the web interface to work

Post by ilan »

I finally found out how to look inside docker

Code: Select all

sudo docker exec -it zoneminder/bin/bash
With that I could verify that Issac Connor's fix of 15 August for local usb cameras in indeed included in v1.34.21.
It seems that my Logitech HD 720p usb camera is simply not supported.
Never mind I ordered a TP-Link Tapo HD C200, which I expect will work.
Post Reply