🐛 Bug Report: SvelteKitError: Not found #481

Closed
opened 2025-10-09 16:49:37 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @oscarorange on GitHub.

Reproduction steps

compose.yaml

services:
  pocket-id:
    container_name: pocket-id
    environment:
      - PUBLIC_APP_URL=https://pocket-id.👀
      - TRUST_PROXY=true
      - PORT=3000
    image: stonith404/pocket-id
    labels:
      - traefik.enable=true

      - traefik.http.routers.pocket-id.entryPoints=websecure
      - traefik.http.routers.pocket-id.rule=Host(`pocket-id.👀`)
      - traefik.http.services.pocket-id.loadBalancer.server.port=3000
      - traefik.http.routers.pocket-id.service=pocket-id
    networks:
      - pocket-id
    restart: unless-stopped
    user: 1003:1003
    volumes:
      - ./pocket-id/data:/app/backend/data

Expected behavior

Setup page loads, but when clicking authenticate this error happens. I know my compose.yaml specifies to run as a non-root user, but the issue still happens when that is removed.

Actual Behavior

Details

Starting frontend...
Starting backend...
Starting Caddy...
{"level":"info","ts":1729129276.3627672,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile.trust-proxy","config_adapter":""}
{"level":"info","ts":1729129276.3651688,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"warn","ts":1729129276.3654394,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
{"level":"info","ts":1729129276.36576,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"error","ts":1729129276.3660734,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"}
{"level":"info","ts":1729129276.3661127,"msg":"serving initial configuration"}
{"level":"warn","ts":1729129276.3663363,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"open /.local/share/caddy/instance.uuid: no such file or directory"}
Successfully started Caddy (pid=30) - Caddy is running in the background
{"level":"error","ts":1729129276.366445,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"}
{"level":"info","ts":1729129276.3664784,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1729129276.366555,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000390c00"}
Listening on 0.0.0.0:3000
[GIN] 2024/10/17 - 01:41:42 | 401 |      49.112µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:42 | 401 |     146.138µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:42 | 200 |      285.37µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:42 | 200 |     327.781µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:42 | 401 |      31.476µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:42 | 401 |      62.918µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:42 | 200 |     209.362µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:42 | 200 |     237.018µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 401 |      26.231µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 401 |      56.912µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 200 |     207.363µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 200 |     234.447µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 401 |      61.518µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 401 |      85.781µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 200 |      208.22µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 200 |     234.266µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/logo
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) {
  status: 404,
  text: 'Not Found'
}
SvelteKitError: Not found: /api/application-configuration/background-image
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2024/10/17 - 01:41:43 | 401 |      27.078µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 401 |     411.071µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 200 |      255.32µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 200 |     285.253µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/logo
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processImmediate (node:internal/timers:454:9) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2024/10/17 - 01:41:43 | 401 |      24.973µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 401 |      49.058µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 200 |     212.152µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 200 |     235.683µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/favicon
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2024/10/17 - 01:41:43 | 401 |      23.546µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 401 |      47.871µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:43 | 200 |     188.235µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:43 | 200 |     211.417µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/application-configuration/background-image
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) {
  status: 404,
  text: 'Not Found'
}
[GIN] 2024/10/17 - 01:41:44 | 401 |      56.195µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:44 | 401 |     118.157µs |       127.0.0.1 | GET      "/api/users/me"
[GIN] 2024/10/17 - 01:41:44 | 200 |     501.631µs |       127.0.0.1 | GET      "/api/application-configuration"
[GIN] 2024/10/17 - 01:41:44 | 200 |     566.029µs |       127.0.0.1 | GET      "/api/application-configuration"
SvelteKitError: Not found: /api/webauthn/login/start
    at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18)
    at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34)
    at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26)
    at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) {
  status: 404,
  text: 'Not Found'
}

Originally created by @oscarorange on GitHub. ### Reproduction steps <details><summary>compose.yaml</summary> <p> ```yaml services: pocket-id: container_name: pocket-id environment: - PUBLIC_APP_URL=https://pocket-id.👀 - TRUST_PROXY=true - PORT=3000 image: stonith404/pocket-id labels: - traefik.enable=true - traefik.http.routers.pocket-id.entryPoints=websecure - traefik.http.routers.pocket-id.rule=Host(`pocket-id.👀`) - traefik.http.services.pocket-id.loadBalancer.server.port=3000 - traefik.http.routers.pocket-id.service=pocket-id networks: - pocket-id restart: unless-stopped user: 1003:1003 volumes: - ./pocket-id/data:/app/backend/data ``` </p> </details> ### Expected behavior Setup page loads, but when clicking authenticate this error happens. I know my `compose.yaml` specifies to run as a non-root user, but the issue still happens when that is removed. ### Actual Behavior <details><summary>Details</summary> <p> ``` Starting frontend... Starting backend... Starting Caddy... {"level":"info","ts":1729129276.3627672,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile.trust-proxy","config_adapter":""} {"level":"info","ts":1729129276.3651688,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]} {"level":"warn","ts":1729129276.3654394,"logger":"http.auto_https","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80} {"level":"info","ts":1729129276.36576,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"level":"error","ts":1729129276.3660734,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"} {"level":"info","ts":1729129276.3661127,"msg":"serving initial configuration"} {"level":"warn","ts":1729129276.3663363,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"open /.local/share/caddy/instance.uuid: no such file or directory"} Successfully started Caddy (pid=30) - Caddy is running in the background {"level":"error","ts":1729129276.366445,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"} {"level":"info","ts":1729129276.3664784,"logger":"tls","msg":"finished cleaning storage units"} {"level":"info","ts":1729129276.366555,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000390c00"} Listening on 0.0.0.0:3000 [GIN] 2024/10/17 - 01:41:42 | 401 | 49.112µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:42 | 401 | 146.138µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:42 | 200 | 285.37µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:42 | 200 | 327.781µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:42 | 401 | 31.476µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:42 | 401 | 62.918µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:42 | 200 | 209.362µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:42 | 200 | 237.018µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 401 | 26.231µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 401 | 56.912µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 200 | 207.363µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 200 | 234.447µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 401 | 61.518µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 401 | 85.781µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 200 | 208.22µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 200 | 234.266µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/logo at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) { status: 404, text: 'Not Found' } SvelteKitError: Not found: /api/application-configuration/background-image at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) { status: 404, text: 'Not Found' } [GIN] 2024/10/17 - 01:41:43 | 401 | 27.078µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 401 | 411.071µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 200 | 255.32µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 200 | 285.253µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/logo at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) at runNextTicks (node:internal/process/task_queues:60:5) at process.processImmediate (node:internal/timers:454:9) { status: 404, text: 'Not Found' } [GIN] 2024/10/17 - 01:41:43 | 401 | 24.973µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 401 | 49.058µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 200 | 212.152µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 200 | 235.683µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/favicon at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) { status: 404, text: 'Not Found' } [GIN] 2024/10/17 - 01:41:43 | 401 | 23.546µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 401 | 47.871µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:43 | 200 | 188.235µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:43 | 200 | 211.417µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/application-configuration/background-image at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) { status: 404, text: 'Not Found' } [GIN] 2024/10/17 - 01:41:44 | 401 | 56.195µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:44 | 401 | 118.157µs | 127.0.0.1 | GET "/api/users/me" [GIN] 2024/10/17 - 01:41:44 | 200 | 501.631µs | 127.0.0.1 | GET "/api/application-configuration" [GIN] 2024/10/17 - 01:41:44 | 200 | 566.029µs | 127.0.0.1 | GET "/api/application-configuration" SvelteKitError: Not found: /api/webauthn/login/start at resolve2 (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5280:18) at resolve (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5113:34) at Object.handle (file:///app/frontend/build/server/chunks/hooks.server-DoTFqLGe.js:41:26) at respond (file:///app/frontend/build/server/chunks/index-D3dgayUa.js:5111:43) { status: 404, text: 'Not Found' } ``` </p> </details>
OVERLORD added the bug label 2025-10-09 16:49:37 +03:00
Author
Owner

@oscarorange commented on GitHub:

Would you mind to test this image and let me know if it works?

Yup, this works, thanks!

I couldn't use port 3000, I assume it's used internally for something else, but setting CADDY_PORT to 3080 worked fine with my reverse proxy and allows me to not use port 80.

Thanks for the project by the way, great stuff!

@oscarorange commented on GitHub: > Would you mind to test this image and let me know if it works? Yup, this works, thanks! I couldn't use port `3000`, I assume it's used internally for something else, but setting `CADDY_PORT` to `3080` worked fine with my reverse proxy and allows me to not use port `80`. Thanks for the project by the way, great stuff!
Author
Owner

@oscarorange commented on GitHub:

I just tested it and it works fine without the PORT environment variable once I tell Traefik to forward to port 80, but using port 80 even within a container isn't compatible with my network setup, which is why I figured the PORT variable would work fine on something other than 80.

@oscarorange commented on GitHub: I just tested it and it works fine without the `PORT` environment variable once I tell Traefik to forward to port 80, but using port 80 even within a container isn't compatible with my network setup, which is why I figured the `PORT` variable would work fine on something other than 80.
Author
Owner

@stonith404 commented on GitHub:

Ok yeah, that isn't documented properly. I've add the environment variable CADDY_PORT to the stonith404/pingvin-share:development image. This variable can be used to change the exposed port of Pocket ID. Would you mind to test this image and let me know if it works?

@stonith404 commented on GitHub: Ok yeah, that isn't documented properly. I've add the environment variable `CADDY_PORT` to the `stonith404/pingvin-share:development` image. This variable can be used to change the exposed port of Pocket ID. Would you mind to test this image and let me know if it works?
Author
Owner

@oscarorange commented on GitHub:

Do you use a reverse proxy? You probably access Pocket ID on port 3000 instead of 80.

Pocket is accessible to Traefik on port 3000 and I access it via port 443 after Traefik has encrypted it. The login page will load but attempting to authenticate results in all these errors. Is it possible the PORT environment variable isn't respected by certain aspects of the app?

@oscarorange commented on GitHub: > Do you use a reverse proxy? You probably access Pocket ID on port 3000 instead of 80. Pocket is accessible to Traefik on port 3000 and I access it via port 443 after Traefik has encrypted it. The login page will load but attempting to authenticate results in all these errors. Is it possible the `PORT` environment variable isn't respected by certain aspects of the app?
Author
Owner

@stonith404 commented on GitHub:

Do you use a reverse proxy? You probably access Pocket ID on port 3000 instead of 80.

@stonith404 commented on GitHub: Do you use a reverse proxy? You probably access Pocket ID on port 3000 instead of 80.
Author
Owner

@stonith404 commented on GitHub:

Thanks for the feedback. I added this in v0.9.0.

@stonith404 commented on GitHub: Thanks for the feedback. I added this in `v0.9.0`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-2#481