pducharme / UniFi-Video-Controller

Docker for Unifi-Video Controller (Ubiquiti Networks)
199 stars 105 forks source link

3.9.2 Recordings are missing from GUI #75

Closed Mike1082 closed 6 years ago

Mike1082 commented 6 years ago

I believe something changed in the recording path with this version. Since updating today, all of my recordings have disappeared from the GUI (they all still exist in their respective folders).

My container path for "Recording Path" has been set to "/var/lib/unifi-video/videos", but in the System Configuration GUI, it is now appearing as "/usr/lib/unifi-video/data/videos" (which is not listed in the dockerfile). If I try to change this path in the GUI, I get an error:

Validation Failed
/var/lib/unifi-video/videos path is not accessible.
Please correct permissions or ownership and try again.

In the logs, I see lots of errors referencing this path:

java.io.FileNotFoundException: /usr/lib/unifi-video/data/videos/9d23058c-3d53-3b5e-b07d-f290f5fe136e/2018/01/29/1517254547165_1517254549165_1517252347798_6166117.mp4 (No such file or directory)

Mike1082 commented 6 years ago

FWIW, I tried rolling back using the 3.9.0 tag, but it appears that the firmware that the camera was updated to is not supported in 3.9.0

fryfrog commented 6 years ago

Can you show me your docker run command?

fryfrog commented 6 years ago

My mapping is currently -v /data/unifi-video/videos:/var/lib/unifi-video/videos, but it also worked when I had -v /data/unifi-video/videos:/usr/lib/unifi-video/data/videos on the new image.

I did recently adjust the volume definition to go to the real place, but I'm not sure why that would cause this problem.

Edit: Never mind, I haven't pushed that to release. Could you try the :testing tag and see if it fixes things?

fryfrog commented 6 years ago

There is also a perms.txt file somewhere on your volume, if you remove it the docker will fix permissions at start up.

Mike1082 commented 6 years ago

@fryfrog I am using unRaid, so the template is handling the run command. That said, these are the details:

image

When I apply the template to start the container, this is the generated command:

docker run -d --name="UniFi-Video" --net="bridge" --privileged="true" -e TZ="America/New_York" -e HOST_OS="unRAID" -p 6666:6666/tcp -p 7080:7080/tcp -p 7442:7442/tcp -p 7443:7443/tcp -p 7445:7445/tcp -p 7446:7446/tcp -p 7447:7447/tcp -v "/mnt/cache/appdata/unifi-video-logs/":"/var/log/unifi-video":rw -v "/mnt/cache/appdata/unifi-video/":"/var/lib/unifi-video":rw -v "/mnt/user/securitycameras/":"/var/lib/unifi-video/videos":rw pducharme/unifi-video-controller

fryfrog commented 6 years ago

Where does it get the Dockerfile/template? The :latest one removed the 1st one which is the logs path and still has the 2nd one and the 3rd one still points at /usr/lib/unifi-video/data/videos.

If you flip to :testing, the logs one should be gone and it switches the 2nd one to be what you have there.

I don't use unRaid, I'm not entirely sure what is going on?

https://hub.docker.com/r/pducharme/unifi-video-controller/~/dockerfile/

https://github.com/pducharme/UniFi-Video-Controller/blob/release/Dockerfile

https://github.com/pducharme/UniFi-Video-Controller/blob/master/Dockerfile

fryfrog commented 6 years ago

I don't see why it'd fix it, but maybe just remove the logs volume?

fryfrog commented 6 years ago

Also, to roll back to 3.9.0 you'd have to downgrade the firmware on your cameras manually.

Mike1082 commented 6 years ago

Sorry, I was not showing "Advanced" in the container config screen. If I had been, you would see the "Docker HUB URL" field, which has the following:

https://registry.hub.docker.com/u/pducharme/unifi-video-controller/

I will try removing the volume mapping for the Logs volume.

Mike1082 commented 6 years ago

Basically, unRaid gives you a GUI to configure Docker containers, instead of using the CLI. I can resort to CLI if I need to.

fryfrog commented 6 years ago

Can you refresh it somehow? The logs volume is gone from both latest and testing. And for some reason, the README.md and Dockerfile is from the last thing to build, which was testing.

fryfrog commented 6 years ago

I've pushed master -> release and made a 3.9.2 tag. It should build in 5-15 minutes. Then refresh your template somehow and see if it helps? :/

Mike1082 commented 6 years ago

Ok, I was able to fix this. In case anyone else updates their container using unRaid, follow these steps:

Go to the Community Applications plugin (or "Apps" tab). Search for "unifi video" Click the button shown below to reinstall the container using default values: image Note that the container path for videos is now /videos: (template must have been recently updated) image Set your host path to the correct volume Click Apply to update/run the container Login to UVC, and go to Settings > System Configuration Update the recording path to /videos image Under "Tools", check "Restore Recordings" and click "Analyze": image After this I got a popup indicating that my recordings had been restored: image After going back to view Recordings, I was pleased to see they had all become visible again.

Hopefully this helps someone else. Thank you so much @fryfrog for the assist!

Mike1082 commented 6 years ago

One last note: The logs volume is still present in the unRaid template, so I left it in place.

pducharme commented 6 years ago

We will update the Unraid docker template soon. This is not in the same repo than the docker itself.

fryfrog commented 6 years ago

Hey @Mike1082, I think I'd re-fiddle your setup a little. I don't think /videos is a good place for it inside the container because you'll have to remember it every time. The default is /var/lib/unifi-video/videos and should be fine to map into.

I've also put up a commit to fix up the template.

Mike1082 commented 6 years ago

Thanks, I will leave it as is for now, then check the template for updates before updating the container again.

fryfrog commented 6 years ago

It is actually totally fine to leave your videos in /videos on the inside, just remember you did that if you ever re-install or something. :)

Mike1082 commented 6 years ago

Technically I didn't change it at all.. I just went by how the template was configured 👍