Closed EinAeffchen closed 3 months ago
Hi @EinAeffchen
Thank you for using HomeGallery and reporting your issue here with detailed logs.
It seems that the api server has an invalid response which is not a json format.
What is your api server settings, which is apparently <censored>
in the provided info. It should be http://api:3000
which than uses the api container of your docker compose setting.
If you use a different api server, please check that the responses are valid.
Thanks for the quick help! You're right I mistakenly put my url in there instead of the api url. However, I realized I can't get the API Image to run, it errors with the following logs, independent of the backend I set via env:
node[1]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
1: 0xb87bc0 node::Abort() [node]
2: 0xb87c3e [node]
3: 0xbf50fe [node]
4: 0xbf51e1 node::NodePlatform::NodePlatform(int, v8::TracingController*, v8::PageAllocator*) [node]
5: 0xb458f3 node::InitializeOncePerProcess(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::ProcessFlags::Flags) [node]
6: 0xb45f4b node::Start(int, char**) [node]
7: 0x7fd56f3a01ca [/lib/x86_64-linux-gnu/libc.so.6]
8: 0x7fd56f3a0285 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
9: 0xac3f4e _start [node]
Running the container manually via docker run and adding --priviliged
makes it look like non of the Backends are known (same error independent of set backend:
[eval]:1
BACKEND=node
^
[eval]:1
BACKEND=cpu
^
ReferenceError: cpu is not defined
at [eval]:1:1
at Script.runInThisContext (node:vm:123:12)
at Object.runInThisContext (node:vm:299:38)
at node:internal/process/execution:82:21
at [eval]-wrapper:6:24
at runScript (node:internal/process/execution:81:62)
at evalScript (node:internal/process/execution:103:10)
at node:internal/main/eval_string:29:3
Node.js v18.18.0
Command used: docker run --privileged -it xemle/home-gallery-api-server -e BACKEND=cpu
Hi @EinAeffchen
IMHO --privileged
does not need to be set. Is there a reason not to run the default wasm backend for the moment?
Since the errors are provided with some context, could you provide more context such host machine, architecture, OS and your docker commands to trigger these errors? Otherwise it is difficult to follow, to validate and provide further help.
Hi @xemle, I assumed so too, but didn't want to leave anything untried. With independent of the backend, I mean that no matter which one I choose (wasm, node, cpu) it's always the same error.
The machine I'm running this on:
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
docker-compose --version
Docker Compose version v2.27.0
Docker version 20.10.7, build f0df350
Otherwise I started the system with the above docker-compose running the commands as described in your guide:
mkdir -p data
echo "CURRENT_USER=$(id -u):$(id -g)" >> .env
docker compose run gallery run init --source /data/Pictures
docker compose up -d
Hi @EinAeffchen
thank you for the details. Currently I do not have a clue why the gallery on your side stuck. Which os architecture you are using? Do you run it on your bare metal or do you use any cloud provider? How much RAM does the ubuntu machine has?
Have you tried a subset with disabled or the public api-server?
I ran
mkdir -p data
echo "CURRENT_USER=$(id -u):$(id -g)" >> .env
docker compose run gallery run init --source /data/Pictures
docker compose up -d
from my Ubuntu 24.04 amd64 laptop with docker 26.1.2 and docker compose 26.1.2. It worked as expected.
How can we proceed? Do you have further ideas?
Anyway: thank you so much for your time and reports
Hi @xemle,
thanks for following up with me. I tried running the api on docker desktop for Windows and run into the exact same problem. However, removing the env variable completely worked on windows to get the api running. Though on my ubuntu machine this doesn't seem to work.
I sadly never really worked with node.js to know anything about what might be going wrong here, though I'd assume the fact that it's running in docker should make it pretty much independent of where the docker installation itself is running. What's interesting however is that I seem to get different node.js versions depending on if I run the image on windows or on ubuntu:
[eval]:1
BACKEND=cpu
^
ReferenceError: cpu is not defined
at [eval]:1:1
at runScriptInThisContext (node:internal/vm:209:10) at node:internal/process/execution:118:14 at [eval]-wrapper:6:24
at runScript (node:internal/process/execution:101:62)
at evalScript (node:internal/process/execution:133:3)
at node:internal/main/eval_string:51:3
Node.js v20.13.1
Before when I posted this error it stated at the bottom that it was using Node.js 18.18? Did you update the image since I started this issue?
EDIT: So updating my docker version from ~20 to ~26 and using the new api image without setting an env seems to work!
I tried running the api on docker desktop for Windows
So your target host would be Windows? Have you tried the binary distribution of the gallery? ... and you would like to have your own api server locally running via WSL and docker?
Before when I posted this error it stated at the bottom that it was using Node.js 18.18? Did you update the image since I started this issue?
Yes. I am trying to fix the CI jobs to build the docker images via github actions for #136. However somehow the jobs stucks while locally I can build the images. So now the node version is 20 LTS for the docker images if you build them from source.
So your target host would be Windows?
No no I just tried to run it on windows to see if the problem is my linux system. The target is linux. Yes preferably I'd like to have my local api Server running to be able to run the system as independent as possible.
But as I wrote, with the new image and removing the BACKEND env variable from the api everything is running! The api crashes from time to time without any error, but a simple restart fixes that, which is enough for me for now.
Thank you for your help!
Closing this issue due inactivity.
Please reopen it, if it becomes active again.
Hey, so I tried setting up your system using the docker-compose guide. And I got the system running for a short while and can open it in the browser, however there is nothing to see and checking the logs I get the following error:
SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse ()
at /app/node_modules/@home-gallery/storage/dist/write-storage-file.js:16:30
at /app/node_modules/@home-gallery/common/dist/fs/write-safe.js:15:7
at FSReqCallback.oncomplete (node:fs:192:23)
Node.js v18.20.2`
Logs from the gallery.log:
I am mounting a samba volume onto my machine and then mount it into docker. Though I don't assume that this is causing the problem as its able to see and process the images for a bit. My docker-compose for reference: