-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problems applying patch #2
Comments
hmm maybe try to remove line 8? Pro tip: always enclose code or logs in triple backticks to make it easier to read: and then it looks like this:
|
Yeah that formating was.. horrible :) I'll clean that out, removing the chmod at least got it started. |
cool awesome, please let me know how it works, I'll remove it from the code here if it works for you. I think it's just something I tried at some point and I don't know if it's even necessary anyway, I thought I already cleaned all the unnecessary things, but maybe i didn't :) |
Still some strange stuff with the database, here is my full log i think: to start it:
And then the log itself from within the container. posting it shortly.. |
That's quite the mouthfull ;) |
I think you used a different character, on PC and laptops so anything else than Macs the backtick key ` is right before 1. |
I did clear out /storage if that's what you are asking. |
can you run these commands ? maybe it will help figure out which service failed.
|
last 2 are a problem. |
we have to figure out why |
there seems to be an error with the way PostgreSQL is initialized I also just remembered I also did this along the way: https://github.com/snowsnoot/unifi-unvr-arm64#issues-with-remote-access |
Yeah did the above, does not help. i did see the core service turn on for a brief second but then died again. |
I compared my logs and the only thing so far I noticed that I don't have this error If you want we could also have a call in the weekend or some time when we both are free to debug this together. Unfortunately I can't reproduce it on my side, at least not yet. |
Those logfiles do not seem to be accesable outside of the container for soem reason, i'de expect them do be found somewhere within /storage but no.
FATAL is obviously bad, why this happens or dosen't happen (creation of needed things) is the question :) |
Comparing with my logs, I see all of them, except
I removed the
Can you share your docker-compose.yml file? |
I've disabled apparmor, but that should not do anything i think. Using ubuntu 22.xx LTS, what are you using ? docker version Server: Docker Engine - Community |
I'm using latest NixOS, but not sure how much that matters, but I see that I do have an older version of Docker Engine:
|
Digging into the DB error, this seems very similar error to what we get around |
https://stackoverflow.com/questions/49697082/node-postgres-connection-terminated-unexpectedly It could be that Postgres is too slow when running in an emulator like this one? That's the reason I had to increase the timeouts for the services as well, but I don't see an easy way to increase the postgresql connection timeouts from the nodejs app because it's obsfucated here What kind of CPU are you using in the host? It could be that I didn't have this issue because I'm using a 16 core machine. |
it's on a vm with 8 cores of X5675 @ 3.07GHz + 12 gigs, i guess that could be it, but it's not THAT slow still :) |
ok, so definitely not that, you have a beefy machine |
I tried running it on a Ryzen 16 core Manjaro vm with Docker 23 version, and it also works fine, so most definitely the version doesn't seem to matter. I will try to run it with only a few cores and see if that affects it in any way |
I ended up giving less resources to the container using Docker, and it seems I was able to replicate the error, however it's ridiculously slow, I think it's nowhere close to what you experience, but it seems to be the same error.
|
Hmm strange, i'm also running my vm's of ssd so should be fine there speedwise. |
The main problem is not about SSD, but the overhead that comes with emulation from X86 to ARM64. I originally thought it will be more reliable and less overhead than this, but I think it's unmanageable unless we run this thing on Raspberry PI or something that has arm64 on it, otherwise it can be quite unstable. And that's the last thing you want in an NVR, to crash randomly. Here's some discussions on emulators: https://stackoverflow.com/questions/1554099/why-is-the-android-emulator-so-slow-how-can-we-speed-up-the-android-emulator If someone makes it work faster, please teach me, for now I'll give up because I don't have the time to invest in it. |
Well thankfully i kinda thought of this and ordered something equal or slighty better and at a much better price than a rasp 4 a week ago or so, let's hope that works better. Thanks for the help :) |
@gurkburk76 can I ask what device did you order? I had a RPI 4 and I'm playing with it, but still having some issue. However I can clearly see the difference in speed, initial setup takes ~ 30 seconds vs 5 minutes on my emulated x86 to aarch64 16 core machine. |
I have this on the way + i'll plugin a ssd via usb and hopefully be done with it. |
@kiwimato you can try Quartz64 https://pine64.com/product/quartz64-model-a-4gb-single-board-computer/ |
@bkchaw thanks for the suggestion! |
To continue from this, markdegrootnl#17
Yeah it wasen't fully obvious to me from the docs that i should run docker-compose and use that yaml file you made, point taken and taken into account :)
Still having issues when trying to apply the patch, i made some modifications to the paths:
version: '3.8'
services:
unifi-protect:
image: unifi-patch
build:
context: patch
dockerfile: Dockerfile.patch
container_name: unifi-protect
platform: linux/arm64/v8
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /etc/localtime:/etc/localtime
- /storage/srv:/srv
- /storage/data:/data
- /storage/persistent:/persistent
#environment:
# - STORAGE_DISK=/dev/sda1
restart: unless-stopped
cap_add:
- dac_read_search
- sys_admin
security_opt:
- apparmor=unconfined
tmpfs:
- /run
- /run/lock
- /tmp
privileged: true
network_mode: host
The error i get is this, i also chmod 777 just to be damned sure (tm) that it's not some silly permission thing:
root@streams:/home/apa/protect/unifi-protect-arm64# chmod -R 777 /storage/
root@streams:/home/apa/protect/unifi-protect-arm64# docker-compose up
Building unifi-protect
[+] Building 1.9s (5/5) FINISHED
=> [internal] load build definition from Dockerfile.patch 0.0s
=> => transferring dockerfile: 579B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/markdegroot/unifi-protect-arm64:latest 0.0s
=> CACHED [1/2] FROM docker.io/markdegroot/unifi-protect-arm64:latest 0.0s
=> ERROR [2/2] RUN sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protec 1.7s
Dockerfile.patch:4
3 | # this is just a patch to prevent the unifi-core service stopping every 2 minutes because it hits the systemd timeout
4 | >>> RUN sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service
5 | >>> && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protect.service
6 | >>> && sed -i -e 's/#ForwardToConsole=no/ForwardToConsole=yes/g' /etc/systemd/journald.conf
7 | >>> && mkdir -p /data/unifi-core/logs/
8 | >>> && chmod 777 /persistent
9 |
ERROR: failed to solve: process "/bin/sh -c sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protect.service && sed -i -e 's/#ForwardToConsole=no/ForwardToConsole=yes/g' /etc/systemd/journald.conf && mkdir -p /data/unifi-core/logs/ && chmod 777 /persistent" did not complete successfully: exit code: 1
ERROR: Service 'unifi-protect' failed to build : Build failed
Also tried to nuke everything under /storage and see if it rebuilds what's needed, no luck.
redid the dirs, still no luck.
root@streams:/home/apa/protect/unifi-protect-arm64# mkdir /storage/persistent
root@streams:/home/apa/protect/unifi-protect-arm64# mkdir /storage/data
root@streams:/home/apa/protect/unifi-protect-arm64# mkdir /storage/srv
root@streams:/home/apa/protect/unifi-protect-arm64# docker-compose up
Building unifi-protect
[+] Building 1.5s (5/5) FINISHED
=> [internal] load build definition from Dockerfile.patch 0.0s
=> => transferring dockerfile: 579B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/markdegroot/unifi-protect-arm64:latest 0.0s
=> CACHED [1/2] FROM docker.io/markdegroot/unifi-protect-arm64:latest 0.0s
=> ERROR [2/2] RUN sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protec 1.4s
Dockerfile.patch:4
3 | # this is just a patch to prevent the unifi-core service stopping every 2 minutes because it hits the systemd timeout
4 | >>> RUN sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service
5 | >>> && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protect.service
6 | >>> && sed -i -e 's/#ForwardToConsole=no/ForwardToConsole=yes/g' /etc/systemd/journald.conf
7 | >>> && mkdir -p /data/unifi-core/logs/
8 | >>> && chmod 777 /persistent
9 |
ERROR: failed to solve: process "/bin/sh -c sed -i -e 's/Restart=always/Restart=always\nTimeoutStartSec=600/g' /lib/systemd/system/unifi-core.service && sed -i -e 's/TimeoutStartSec=180/TimeoutStartSec=600/g' /lib/systemd/system/unifi-protect.service && sed -i -e 's/#ForwardToConsole=no/ForwardToConsole=yes/g' /etc/systemd/journald.conf && mkdir -p /data/unifi-core/logs/ && chmod 777 /persistent" did not complete successfully: exit code: 1
ERROR: Service 'unifi-protect' failed to build : Build failed
it's obviously complaining about the persistent dir, but i'm too blind to see what i did wrong.
The text was updated successfully, but these errors were encountered: