I
Immich•2y ago
jolly-jump

EAI_AGAIN when first using typesense

Hi. I have the problem that I disabled typesense around the time the API_KEY was needed in the .env-file, since then the following happens: - typesense starts - immich-server (and all others) start but the logs say "immich-server | Request #1687720564012: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense" immich-server | Request #1687720564012: Sleeping for 4s and then retrying request... " and, of course, no webservice is possible, saying
500 connect ECONNREFUSED 172.18.0.15:3001
My setup is a bit off the standard, since I am using a nginx reverse proxy in front of the immich-proxy. docker-compose.yml, relevant part is appended. The .env-File, except comments:
NODE_ENV=production
LOG_LEVEL=verbose
DB_HOSTNAME=immich-db
DB_USERNAME=postgres
DB_PASSWORD=xxxxxxxxxxx
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
UPLOAD_LOCATION=/srv/docker/immich/data
TYPESENSE_ENABLED=false
TYPESENSE_API_KEY=chuthii6Jei1ooraiFoyeezuph4ohc
DISABLE_REVERSE_GEOCODING=true
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-ml:3003
NODE_ENV=production
LOG_LEVEL=verbose
DB_HOSTNAME=immich-db
DB_USERNAME=postgres
DB_PASSWORD=xxxxxxxxxxx
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
UPLOAD_LOCATION=/srv/docker/immich/data
TYPESENSE_ENABLED=false
TYPESENSE_API_KEY=chuthii6Jei1ooraiFoyeezuph4ohc
DISABLE_REVERSE_GEOCODING=true
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-ml:3003
I tried 0.24.0@sha and 0.24.1 but I remember that it did not work way back...
10 Replies
bo0tzz
bo0tzz•2y ago
Your typesense container has a different name than in the default docker-compose.yml, so you would need to set TYPESENSE_HOST accordingly
jolly-jump
jolly-jumpOP•2y ago
ah... oh, ok. I'll try the default then @bo0tzz That worked, yeah! Thanks Follow up: The example.env mentions
# Example JSON that was used:
# [
# { "host": "typesense-1.example.net", "port": "443", "protocol": "https" },
# { "host": "typesense-2.example.net", "port": "443", "protocol": "https" },
# { "host": "typesense-3.example.net", "port": "443", "protocol": "https" },
# ]
# TYPESENSE_URL=ha://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0=
# Example JSON that was used:
# [
# { "host": "typesense-1.example.net", "port": "443", "protocol": "https" },
# { "host": "typesense-2.example.net", "port": "443", "protocol": "https" },
# { "host": "typesense-3.example.net", "port": "443", "protocol": "https" },
# ]
# TYPESENSE_URL=ha://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0=
which I can't reproduce, I think the last "," in the json is wrong anyway. Would it not be better to write the following into the example.env
# Example JSON that was used:
# [
# { "host": "typesense", "port": "8108", "protocol": "http" }
# ]
# TYPESENSE_URL=ha://WwogICAgIHsgImhvc3QiOiAidHlwZXNlbnNlIiwgInBvcnQiOiAiODEwOCIsICJwcm90b2NvbCI6ICJodHRwIiB9Cl0K
# Example JSON that was used:
# [
# { "host": "typesense", "port": "8108", "protocol": "http" }
# ]
# TYPESENSE_URL=ha://WwogICAgIHsgImhvc3QiOiAidHlwZXNlbnNlIiwgInBvcnQiOiAiODEwOCIsICJwcm90b2NvbCI6ICJodHRwIiB9Cl0K
?
bo0tzz
bo0tzz•2y ago
For a basic setup you're probably better off using _HOST etc https://immich.app/docs/install/environment-variables#typesense
jolly-jump
jolly-jumpOP•2y ago
right! makes totally sense for my setup. does it make sense, that the webclient says "Server: offline" and I can see no photos etc... but as soon as I disable typesense again, the server is online again, and the photos are there. The logs don't show any problem, when typesense is enabled.
bo0tzz
bo0tzz•2y ago
Did you check the logs of all the containers?
jolly-jump
jolly-jumpOP•2y ago
yes. when I try to login from another browser, it shows the login screen but "error: unable to connect"
bo0tzz
bo0tzz•2y ago
can you post the immich_server log from when this is happening?
jolly-jump
jolly-jumpOP•2y ago
sorry, this is the output of: docker-compose logs -f --tail=1000 immich-server
bo0tzz
bo0tzz•2y ago
It's connecting to typesense and starting up with no problems 🤔
jolly-jump
jolly-jumpOP•2y ago
oh, maybe the log was not way back as it should. here is a beginning:
immich-server | Request #1687726654047: Request to Node 0 failed due to "undefined Request failed with HTTP code 503 | Server said: Not Ready or Lagging"
immich-server | Request #1687726654047: Sleeping for 4s and then retrying request...
[...]
Configuration of this group is 172.18.0.15:8107:8108
typesense | I20230625 20:57:37.559172 144 raft_server.h:273] Configuration of this group is 172.18.0.5:8107:8108
typesense | I20230625 20:57:37.559638 144 node.cpp:3142] node default_group:172.18.0.5:8107:8108 reset ConfigurationCtx, new_peers: 172.18.0.5:8107:8108, old_peers: 172.18.0.5:8107:8108
typesense | I20230625 20:57:37.560143 144 raft_server.h:256] Node becomes leader, term: 8
immich-server | Request #1687726654047: Request to Node 0 failed due to "undefined Request failed with HTTP code 503 | Server said: Not Ready or Lagging"
immich-server | Request #1687726654047: Sleeping for 4s and then retrying request...
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] faces-v1 collection has 0 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] albums-v1 collection has 7 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] assets-v7 collection has 886 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: assets/assets-v7
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: albums/albums-v1
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: faces/faces-v1
immich-server | Request #1687726654047: Request to Node 0 failed due to "undefined Request failed with HTTP code 503 | Server said: Not Ready or Lagging"
immich-server | Request #1687726654047: Sleeping for 4s and then retrying request...
[...]
Configuration of this group is 172.18.0.15:8107:8108
typesense | I20230625 20:57:37.559172 144 raft_server.h:273] Configuration of this group is 172.18.0.5:8107:8108
typesense | I20230625 20:57:37.559638 144 node.cpp:3142] node default_group:172.18.0.5:8107:8108 reset ConfigurationCtx, new_peers: 172.18.0.5:8107:8108, old_peers: 172.18.0.5:8107:8108
typesense | I20230625 20:57:37.560143 144 raft_server.h:256] Node becomes leader, term: 8
immich-server | Request #1687726654047: Request to Node 0 failed due to "undefined Request failed with HTTP code 503 | Server said: Not Ready or Lagging"
immich-server | Request #1687726654047: Sleeping for 4s and then retrying request...
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] faces-v1 collection has 0 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] albums-v1 collection has 7 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM DEBUG [TypesenseRepository] assets-v7 collection has 886 documents
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: assets/assets-v7
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: albums/albums-v1
immich-server | [Nest] 1 - 06/25/2023, 8:57:42 PM LOG [TypesenseRepository] Schema up to date: faces/faces-v1
and then the server does not complain anymore. The original post was solved, can I close this post? Let's try.

Did you find this page helpful?