I
Immich•2y ago
Tommy

500 when accessing web server URL

when accessing the web server I'm getting the response "500 self-signed certificate", my config is this:
IMMICH_SERVER_URL=http://api.immich.service.consul:{{ env "NOMAD_HOST_PORT_api" }}
PUBLIC_IMMICH_SERVER_URL=https://immich.mydomain.com/api
IMMICH_SERVER_URL=http://api.immich.service.consul:{{ env "NOMAD_HOST_PORT_api" }}
PUBLIC_IMMICH_SERVER_URL=https://immich.mydomain.com/api
am I doing something wrong here?
62 Replies
Tommy
TommyOP•2y ago
(I'm currently only running the api server and the web server containers, trying to set this up corretly piece by piece)
Alex Tran
Alex Tran•2y ago
Is there any reason why you are not using the recommended approach in https://immich.app/docs/install/docker-compose
Docker Compose [Recommended] | Immich
Docker Compose is the recommended method to run Immich in production. Below are the steps to deploy Immich with Docker Compose.
Tommy
TommyOP•2y ago
I run a nomad cluster
Alex Tran
Alex Tran•2y ago
ah
bo0tzz
bo0tzz•2y ago
@Alex this is like my kubernetes madness but even more off the rails ;)
Alex Tran
Alex Tran•2y ago
okay, then I am not very familiar with it 😛
Tommy
TommyOP•2y ago
Far less off the rails than kubernetes, but thats another discussion 😄
bo0tzz
bo0tzz•2y ago
@Tommy are you using a self signed cert for https?
Tommy
TommyOP•2y ago
no, the public url is running with a real cert, I have many self hosted services using the same domain and same cert
bo0tzz
bo0tzz•2y ago
Where are you getting the error exactly? Can you paste the whole thing here (or send a screenshot)?
Tommy
TommyOP•2y ago
in the browser, but now it actually is timing out instead of complaining about the cert:
No description
Tommy
TommyOP•2y ago
so what's happening is that I'm trying to access https://immich.mydomain.com and that 500 above is the response, the port there is the api server, so the request to the api seems to be timing out
bo0tzz
bo0tzz•2y ago
Do the container logs say anything interesting?
Tommy
TommyOP•2y ago
nothing at all, the api hasn't logged anything since starting up, same with the web server the web server doesn't seem to be responding properly, if I go to the ip:port for it on the host, currently curl http://192.168.1.10:22324 the request hangs do I need to have the microservices etc running in order to get a response from the web server? apart from the api server that is
Alex Tran
Alex Tran•2y ago
Hmm good question, can you try to get it up and running as well? I've never ran each pieces individually is http://192.168.1.10:22324 the server endpoint? if so try curl http://192.168.1.10:22324/api/server-info/ping is server log report startup correctly yet?
Tommy
TommyOP•2y ago
I can get the server to respond "pong", it's not on that port though and the ports keep randomizing as I restart the job but the server seems to be working, yes
Alex Tran
Alex Tran•2y ago
ok so if you cannot pin the port how can you let other containers know the correct address to communicate?
Tommy
TommyOP•2y ago
templating
bo0tzz
bo0tzz•2y ago
What if the server restarts but web doesn't?
Tommy
TommyOP•2y ago
restart condition I thought you used kubernetes, shouldn't it be able to do the same?
bo0tzz
bo0tzz•2y ago
Kubernetes doesn't randomise ports
Tommy
TommyOP•2y ago
basically what you do is this, slightly truncated:
template {
destination = "secrets/env"
change_mode = "restart"
env = true
data = <<-EOH
IMMICH_MACHINE_LEARNING_URL=http://ml.immich.service.consul:{{ NOMAD_HOST_PORT_machine_learning }}
EOH
}
template {
destination = "secrets/env"
change_mode = "restart"
env = true
data = <<-EOH
IMMICH_MACHINE_LEARNING_URL=http://ml.immich.service.consul:{{ NOMAD_HOST_PORT_machine_learning }}
EOH
}
if the template value, i.e. the port, changes it will trigger a restart of the container I think I need to put this on hold for a bit, I'm traveling tomorrow and I have some things that need to get sorted before that. can I pin this discussion somehow so that I can find my way back here later (in a week)?
Alex Tran
Alex Tran•2y ago
sure
Tommy
TommyOP•2y ago
@Alex I'm back at this and I think I actually have everything up and running, just setting up my initial folders etc. One thing I still wanted to check though; do the microservice, machine-learning and web servers have any http health check endpoints like /health, (or like the api server which I'm checking with /server-info/ping)? Or do they just support a tcp check, i.e. pinging the port? @bo0tzz maybe you know as well?
Tommy
TommyOP•2y ago
okay, I'm seeing one other issue, the thumbnails and viewing photos on the web page don't seem to be working. does immich need some cors configuration, or what is the likely cause of this?
No description
bo0tzz
bo0tzz•2y ago
If you click one, can you view the full photo? If yes -> thumbnails haven't been generated, rerun the job from the admin panel If no -> Check server logs for errors
Tommy
TommyOP•2y ago
no, clicking them shows the same "broken" icon neither the web or the api server are logging any errors the web server doesn't log anything at all, it just starts with "listening to port 0.0.0.0:3000" and that's it, the api server logs web socket connections coming and going, but there are no errors
bo0tzz
bo0tzz•2y ago
That seems unusual 🤔 Can you set LOG_LEVEL=verbose, restart the containers, and try again?
Tommy
TommyOP•2y ago
also if I inspect network in the browser, there are no errors there either I set the log level to verbose on the api and web servers, there's still no logging from the web container, and the only thing I see as debug log from the api server is this:
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] assets-v7 collection has 0 documents
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] faces-v1 collection has 0 documents
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] albums-v1 collection has 0 documents
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] assets-v7 collection has 0 documents
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] faces-v1 collection has 0 documents
[Nest] 7 - 07/26/2023, 11:14:50 AM DEBUG [TypesenseRepository] albums-v1 collection has 0 documents
bo0tzz
bo0tzz•2y ago
Can you try clearing your browser cache?
Tommy
TommyOP•2y ago
running in an incognito window, same thing;
No description
Tommy
TommyOP•2y ago
here's my entire config if there's anything obvious I've done wrong: https://pastebin.com/yt0mE0Tn
Pastebin
locals { immich_tag = "v1.69.0"}job "immich" { datacenters = ["ma...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Alex Tran
Alex Tran•2y ago
Can you attach to the server container and make sure that the upload folder has content in it?
Tommy
TommyOP•2y ago
/usr/src/app # ls -la /upload
total 6
drwxrwxr-x 4 node users 4 Jul 26 09:12 .
drwxr-xr-x 1 root root 4096 Jul 26 11:14 ..
drwxr-xr-x 2 root root 2 Jul 4 20:34 library
drwxr-xr-x 3 root root 3 Jul 26 09:12 upload
/usr/src/app # ls -la /upload/upload/
total 1057
drwxr-xr-x 3 root root 3 Jul 26 09:12 .
drwxrwxr-x 4 node users 4 Jul 26 09:12 ..
drwxr-xr-x 2 root root 4148 Jul 26 09:33 0bda2465-60d9-4f93-bdb4-8e489a900d74
/usr/src/app # ls -la /upload
total 6
drwxrwxr-x 4 node users 4 Jul 26 09:12 .
drwxr-xr-x 1 root root 4096 Jul 26 11:14 ..
drwxr-xr-x 2 root root 2 Jul 4 20:34 library
drwxr-xr-x 3 root root 3 Jul 26 09:12 upload
/usr/src/app # ls -la /upload/upload/
total 1057
drwxr-xr-x 3 root root 3 Jul 26 09:12 .
drwxrwxr-x 4 node users 4 Jul 26 09:12 ..
drwxr-xr-x 2 root root 4148 Jul 26 09:33 0bda2465-60d9-4f93-bdb4-8e489a900d74
Alex Tran
Alex Tran•2y ago
Do you see the common dir in the upload folder such as library, encoded-video and thumbnail?
Tommy
TommyOP•2y ago
/upload # ls -la
total 6
drwxrwxr-x 4 root root 4 Jul 26 09:12 .
drwxr-xr-x 1 root root 4096 Jul 26 12:28 ..
drwxr-xr-x 2 root root 2 Jul 4 20:34 library
drwxr-xr-x 3 root root 3 Jul 26 09:12 upload
/upload # ls -la library/
total 1
drwxr-xr-x 2 root root 2 Jul 4 20:34 .
drwxrwxr-x 4 root root 4 Jul 26 09:12 ..
/upload # ls -la upload/
total 1057
drwxr-xr-x 3 root root 3 Jul 26 09:12 .
drwxrwxr-x 4 root root 4 Jul 26 09:12 ..
drwxr-xr-x 2 root root 4148 Jul 26 09:33 0bda2465-60d9-4f93-bdb4-8e489a900d74
/upload # ls -la upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/ | grep -v jpg | grep -v mp4
total 11964211
drwxr-xr-x 2 root root 4148 Jul 26 09:33 .
drwxr-xr-x 3 root root 3 Jul 26 09:12 ..
/upload # ls -la
total 6
drwxrwxr-x 4 root root 4 Jul 26 09:12 .
drwxr-xr-x 1 root root 4096 Jul 26 12:28 ..
drwxr-xr-x 2 root root 2 Jul 4 20:34 library
drwxr-xr-x 3 root root 3 Jul 26 09:12 upload
/upload # ls -la library/
total 1
drwxr-xr-x 2 root root 2 Jul 4 20:34 .
drwxrwxr-x 4 root root 4 Jul 26 09:12 ..
/upload # ls -la upload/
total 1057
drwxr-xr-x 3 root root 3 Jul 26 09:12 .
drwxrwxr-x 4 root root 4 Jul 26 09:12 ..
drwxr-xr-x 2 root root 4148 Jul 26 09:33 0bda2465-60d9-4f93-bdb4-8e489a900d74
/upload # ls -la upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/ | grep -v jpg | grep -v mp4
total 11964211
drwxr-xr-x 2 root root 4148 Jul 26 09:33 .
drwxr-xr-x 3 root root 3 Jul 26 09:12 ..
that's all there is in /upload so there is an /upload/upload folder which seems a bit odd
Alex Tran
Alex Tran•2y ago
yeah that is file the upload folder is where the file just arrived before getting moved to the library
bo0tzz
bo0tzz•2y ago
The root /upload is a bit of legacy naming :P
Alex Tran
Alex Tran•2y ago
So you should have these folder
Alex Tran
Alex Tran•2y ago
No description
Alex Tran
Alex Tran•2y ago
you don't have thumbs folder for some reason that is why the thumbnail doesn't show up
bo0tzz
bo0tzz•2y ago
Can you try going to the admin panel and running the generate thumbnails job?
Tommy
TommyOP•2y ago
tried that, it seems to run the job for like 3-5 seconds and then finishes, and no thumbnails show up
bo0tzz
bo0tzz•2y ago
Are you running missing or all, what number of jobs does it show being queued, and what do the microservices logs say at that point?
Tommy
TommyOP•2y ago
all
Tommy
TommyOP•2y ago
No description
Tommy
TommyOP•2y ago
okay, so at least here's an error microservices is logging this:
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Unable to run job handler: Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/671f6398-9290-4212-9ede-2e26a9d55238.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/671f6398-9290-4212-9ede-2e26a9d55238.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Object:
{
"id": "901904a6-40a1-413b-bfe5-c71dc0c4100b"
}

[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Unable to run job handler: Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/89aafd24-85c3-4860-9b7b-262ab4ddb249.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/89aafd24-85c3-4860-9b7b-262ab4ddb249.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Object:
{
"id": "c6a5fd4f-47ad-4efe-85ed-490c5dc677c2"
}
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Unable to run job handler: Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/671f6398-9290-4212-9ede-2e26a9d55238.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/671f6398-9290-4212-9ede-2e26a9d55238.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Object:
{
"id": "901904a6-40a1-413b-bfe5-c71dc0c4100b"
}

[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Unable to run job handler: Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/89aafd24-85c3-4860-9b7b-262ab4ddb249.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Error: Input file is missing: /upload/upload/0bda2465-60d9-4f93-bdb4-8e489a900d74/89aafd24-85c3-4860-9b7b-262ab4ddb249.jpg
[Nest] 7 - 07/26/2023, 3:47:13 PM ERROR [JobService] Object:
{
"id": "c6a5fd4f-47ad-4efe-85ed-490c5dc677c2"
}
a large amount of these errors are in the logs
bo0tzz
bo0tzz•2y ago
Alright so none of the files are there at all At this point you might want to just wipe the while instance and upload everything from scratch
Tommy
TommyOP•2y ago
so just to check, is this correct: for api I have
volumes = ["/zpool/services/immich/upload:/upload"]
volumes = ["/zpool/services/immich/upload:/upload"]
and IMMICH_MEDIA_LOCATION=/upload for microservices I have volumes = ["/zpool/services/immich/upload:/usr/src/app/upload"] and no env setting
bo0tzz
bo0tzz•2y ago
I think that should work but I'm not 100% certain Maybe try mounting both to the same place just to be sure
Tommy
TommyOP•2y ago
hm, I think I'll set IMMICH_MEDIA_LOCATION for both the api and ms to /upload, seems I missed doing that for ms um.. okay, so I purged everything in these folders, but the broken thumbnails are still showing up in the UI
[void@nas immich]$ ls -la
total 35
drwxrwxr-x 5 void users 5 Jul 2 17:33 .
drwxr-xr-x 40 void users 40 Jul 22 11:19 ..
drwxrwxr-x 5 void users 6 Jul 26 15:57 model-cache
drwxrwxr-x 2 void users 2 Jul 26 15:55 typesense
drwxrwxr-x 3 root root 3 Jul 26 15:57 upload
[void@nas immich]$ ls -la
total 35
drwxrwxr-x 5 void users 5 Jul 2 17:33 .
drwxr-xr-x 40 void users 40 Jul 22 11:19 ..
drwxrwxr-x 5 void users 6 Jul 26 15:57 model-cache
drwxrwxr-x 2 void users 2 Jul 26 15:55 typesense
drwxrwxr-x 3 root root 3 Jul 26 15:57 upload
the file metadata is stored in the postgres db? I guess I need to nuke that as well
Alex Tran
Alex Tran•2y ago
Correct
Tommy
TommyOP•2y ago
nice, the thumbnails seem to work now
Tommy
TommyOP•2y ago
here's a very strange behavior I noticed earlier as well, the file counter in the backup view is buggy:
No description
Tommy
TommyOP•2y ago
the remainder keeps going further and further into negative values
Alex Tran
Alex Tran•2y ago
Yeah this is a known issue, you can clear the app cache and it would solve this issue
Tommy
TommyOP•2y ago
yeah I figured someone has to have seen this before
Alex Tran
Alex Tran•2y ago
it is a cosmetic/state management bug that we have yet to pin point the cause
Tommy
TommyOP•2y ago
but overall it seems that the thumbnails work now, I can click the photos and they show up as well just to circle back to my earlier question above, are there any health check endpoints for the microservices, ml and web containers?
Alex Tran
Alex Tran•2y ago
No there is not
Tommy
TommyOP•2y ago
All right, tcp checks it is Thanks for all the help, I think I'm all good to go 🙂
Alex Tran
Alex Tran•2y ago
No problem Tommy, enjoy

Did you find this page helpful?