Open gnbon opened 3 months ago
Any update on this, I am having the same issue.
I spent quite some time looking into this.
So far, I have the following findings with this image: stable - Unifi is unable to capture storage edge - Unifi is unable to capture storage Once you connect to a doorbell it partially works. Somehow it is recording, but Protect doesn't see it is recording. The app somehow can playback video, but from a web browser it doesn't work. Big disadvantage, you can't configure e.g. smart detection zones because the web browser want's you to connect a storage. I also have problems with a smart chime continuously rebooting or reconnecting (which may or may not be related to this, anyhow the chime worked perfectly on the previous image I used from markdegroot).
What I tried, because people describe this image is actually working, to use the following tag: UNVR4.al324.v3.2.12.7765dbb.240126.0152
The key difference is that this image runs Unifi OS v3 instead of v4. This is actually working. It comes with an old protect app, but once running you can update Protect to v4.1.53 (which works as long as you don't remove the container and re-create it).
I tried, with a working config, to update the container to the latest again, but this breaks the storage. I checked the error logs, maybe this gives a hint:
2024-09-13T20:01:27.307Z - error: [unvrFlashStorageMigration] Failed to check rwfs migration info via ustorage: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at WD (file:///usr/share/unifi-core/app/service.js:197:56072) at Kye (file:///usr/share/unifi-core/app/service.js:197:57153)
This whole exercise does make me wonder. I use a Raspberry Pi 4 with a clean install of Debian Bookworm, following all instructions on the main page using exactly the compose file in this repo (adjusting STORAGE_DISK). @dciancu Did you actually test the image with Unifi OS v4? Or is there someone who can confirm this is actually working with above setup? It makes a whole lot of difference if I try to fix something that does not work on my setup instead of fixing something that is not working at all :)
One thing to add, looking at the dockerfile used to make this container, it seems to always use debian 11, both for containers running Unifi OS v3 and v4. Just a random thought I had, would it be possible the infrastructure of Unifi OS v4 is created around debian 12?
I had the same problem with the newer versions and tried to fix it today.
I could fix it by changing two things.
sbytes=$(df -B1 --output=size -k /srv | awk 'NR==2 {print $1}')
sbytes=$(( sbytes * 1024 ))
sused=$(df -B1 --output=used -k /srv | awk 'NR==2 {print $1}')
sused=$(( sused * 1024 ))
I'm planning to create a merge request for it.
I had the same problem with the newer versions and tried to fix it today. I could fix it by changing two things.
- docker exec into your unifi protect docker container
- Edit /usr/bin/ustorage and replace the two lines beginning with sbytes= and sused= to the following lines:
sbytes=$(df -B1 --output=size -k /srv | awk 'NR==2 {print $1}') sbytes=$(( sbytes * 1024 )) sused=$(df -B1 --output=used -k /srv | awk 'NR==2 {print $1}') sused=$(( sused * 1024 ))
- Open /usr/share/unifi-core/app/service.js and replace all useGrpc:!0 with useGrpc:!!0
- Restart docker container
I'm planning to create a merge request for it.
Good Job! I can confirm, that this is working.
I appreciate the great work on this project. While setting it up, I encountered an issue where my storage was not recognized at all. I'm currently troubleshooting this problem. I of course changed the hostname and added boot commands as well. Either if I have the wrong settings or there are any known issues related to this, please let me know.
Environments
df -h output
host
docker
docker-compose.yml
I've also attached two screenshots showing additional information. Please let me know if you need any further details or clarification on this issue.