500 error on the home page after setting it up
Hi, I have setup immich-{web,server,microservices,machine-learning,typesense} in a lxc container.
All of this is running behind caddy. Caddy sends traffic for
On the homepage, I see this(see image).
I am not sure what's going wrong here. Here is my env config,
/api
to the server(after stripping prefix) and the rest goes to web.
In the logs, I see messages like this,
Nov 14 13:46:32 immich immich-web[880]: [hooks.server.ts]:handleError Request failed with status code 404
Nov 14 13:46:32 immich immich-web[880]: [hooks.server.ts]:handleError Not found: /server-info/theme
Nov 14 13:46:32 immich immich-web[880]: {
Nov 14 13:46:32 immich immich-web[880]: status: 404,
Nov 14 13:46:32 immich immich-web[880]: url: 'GET /server-info/theme',
Nov 14 13:46:32 immich immich-web[880]: response: '<!DOCTYPE html>\n' +
Nov 14 13:46:32 immich immich-web[880]: '<html lang="en" class="dark">\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <head>\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <meta charset="utf-8" />\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <meta name="viewport" content="width=device-width, initial-scale=1" />\n' +
Nov 14 13:46:32 immich immich-web[880]: ' \n' +
Nov 14 13:46:32 immich immich-web[880]: '\t\t<link href="../_app/immutable/assets/0.b1d46fde.css" rel="stylesheet">\n' +
Nov 14 13:47:21 immich immich-web[880]: [hooks.server.ts]:handleError Not found: /api/socket.io/
Nov 14 13:46:32 immich immich-web[880]: [hooks.server.ts]:handleError Request failed with status code 404
Nov 14 13:46:32 immich immich-web[880]: [hooks.server.ts]:handleError Not found: /server-info/theme
Nov 14 13:46:32 immich immich-web[880]: {
Nov 14 13:46:32 immich immich-web[880]: status: 404,
Nov 14 13:46:32 immich immich-web[880]: url: 'GET /server-info/theme',
Nov 14 13:46:32 immich immich-web[880]: response: '<!DOCTYPE html>\n' +
Nov 14 13:46:32 immich immich-web[880]: '<html lang="en" class="dark">\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <head>\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <meta charset="utf-8" />\n' +
Nov 14 13:46:32 immich immich-web[880]: ' <meta name="viewport" content="width=device-width, initial-scale=1" />\n' +
Nov 14 13:46:32 immich immich-web[880]: ' \n' +
Nov 14 13:46:32 immich immich-web[880]: '\t\t<link href="../_app/immutable/assets/0.b1d46fde.css" rel="stylesheet">\n' +
Nov 14 13:47:21 immich immich-web[880]: [hooks.server.ts]:handleError Not found: /api/socket.io/
# extra general
PIP_NO_CACHE_DIR=true
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
PATH="/var/lib/immich/venv/bin:$PATH"
# General
TZ=Asia/Kolkata
NODE_ENV=production
LOG_LEVEL=debug
IMMICH_MEDIA_LOCATION=/mnt/data
IMMICH_CONFIG_FILE=/var/lib/immich/immich/config
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2
# Just for reference
IMMICH_TAG=v1.86.0
# Geocoding
REVERSE_GEOCODING_DUMP_DIRECTORY=/mnt/data/.reverse-geocoding-dump
# Ports
PORT=3000
SERVER_PORT=3001
MICROSERVICES_PORT=3002
MACHINE_LEARNING_HOST=127.0.0.1
MACHINE_LEARNING_PORT=3003
# URLs
IMMICH_WEB_URL=http://127.0.0.1:3000
IMMICH_SERVER_URL=http://127.0.0.1:3001
PUBLIC_IMMICH_SERVER_URL=https://photos.ishanjain.me
PUBLIC_IMMICH_API_URL_EXTERNAL=/api1
IMMICH_API_URL_EXTERNAL=/api1
# Database
DB_HOSTNAME=10.0.50.7
DB_PORT=5432
DB_USERNAME=immich
DB_PASSWORD=
DB_DATABASE_NAME=immich
# Redis
REDIS_HOSTNAME=127.0.0.1
REDIS_PORT=6379
REDIS_DBINDEX=0
# Typesense
TYPESENSE_ENABLED=false
TYPESENSE_HOST=127.0.0.1
TYPESENSE_PORT=8108
TYPSENSE_PROTOCOL=http
TYPESENSE_API_KEY=
TYPESENSE_DATA_DIR=/mnt/data/typesense
# Machine learning
MACHINE_LEARNING_MODEL_TTL=120
MACHINE_LEARNING_CACHE_FOLDER=/mnt/data/.mlcache
MACHINE_LEARNING_REQUEST_THREADS=6
MACHINE_LEARNING_WORKERS=1
MACHINE_LEARNING_WORKER_TIMEOUT=120
# extra general
PIP_NO_CACHE_DIR=true
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
PATH="/var/lib/immich/venv/bin:$PATH"
# General
TZ=Asia/Kolkata
NODE_ENV=production
LOG_LEVEL=debug
IMMICH_MEDIA_LOCATION=/mnt/data
IMMICH_CONFIG_FILE=/var/lib/immich/immich/config
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2
# Just for reference
IMMICH_TAG=v1.86.0
# Geocoding
REVERSE_GEOCODING_DUMP_DIRECTORY=/mnt/data/.reverse-geocoding-dump
# Ports
PORT=3000
SERVER_PORT=3001
MICROSERVICES_PORT=3002
MACHINE_LEARNING_HOST=127.0.0.1
MACHINE_LEARNING_PORT=3003
# URLs
IMMICH_WEB_URL=http://127.0.0.1:3000
IMMICH_SERVER_URL=http://127.0.0.1:3001
PUBLIC_IMMICH_SERVER_URL=https://photos.ishanjain.me
PUBLIC_IMMICH_API_URL_EXTERNAL=/api1
IMMICH_API_URL_EXTERNAL=/api1
# Database
DB_HOSTNAME=10.0.50.7
DB_PORT=5432
DB_USERNAME=immich
DB_PASSWORD=
DB_DATABASE_NAME=immich
# Redis
REDIS_HOSTNAME=127.0.0.1
REDIS_PORT=6379
REDIS_DBINDEX=0
# Typesense
TYPESENSE_ENABLED=false
TYPESENSE_HOST=127.0.0.1
TYPESENSE_PORT=8108
TYPSENSE_PROTOCOL=http
TYPESENSE_API_KEY=
TYPESENSE_DATA_DIR=/mnt/data/typesense
# Machine learning
MACHINE_LEARNING_MODEL_TTL=120
MACHINE_LEARNING_CACHE_FOLDER=/mnt/data/.mlcache
MACHINE_LEARNING_REQUEST_THREADS=6
MACHINE_LEARNING_WORKERS=1
MACHINE_LEARNING_WORKER_TIMEOUT=120

3 Replies
Those error logs look like requests meant for the api (server) are going to the web container
Have you looked at these docs?
I have
I believe caddy is setup properly.
I'll double check again
And it works! Thank you @bo0tzz
this
needs to point to the server. the base domain here will send traffic to immich-web and changing it to,
{
"group": "immich",
"match": [
{
"host": ["photos.ishanjain.me"]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "headers",
"response": {
"deferred": true,
"delete": ["Server"]
}
},
{
"handler": "rewrite",
"strip_path_prefix": "/api"
},
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.50.36:3001"
}
]
}
],
"match": [
{
"path": ["/api*"]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "headers",
"response": {
"deferred": true,
"delete": ["Server"]
}
},
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.50.36:3000"
}
]
}
]
}
]
}
]
},
{
"group": "immich",
"match": [
{
"host": ["photos.ishanjain.me"]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "headers",
"response": {
"deferred": true,
"delete": ["Server"]
}
},
{
"handler": "rewrite",
"strip_path_prefix": "/api"
},
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.50.36:3001"
}
]
}
],
"match": [
{
"path": ["/api*"]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "headers",
"response": {
"deferred": true,
"delete": ["Server"]
}
},
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.50.36:3000"
}
]
}
]
}
]
}
]
},
PUBLIC_IMMICH_SERVER_URL=https://photos.ishanjain.me
PUBLIC_IMMICH_SERVER_URL=https://photos.ishanjain.me
https://photos.ishanjain.me/api
fixes it.