caddy-app-router fails to upsert catchall route — admin socket exists but upsert returns error #8

Closed
opened 2026-08-11 20:07:05 +00:00 by jsutter · 2 comments
Owner

Problem

The caddy-app-router daemon repeatedly fails to upsert the catchall route in the *.apps.<domain> server:

ERROR caddy_app_router::reconcile failed to upsert catchall route in server *.apps.sonomajetcenter.com: upsert route in server *.apps.sonomajetcenter.com failed

This repeats every 5 seconds (the reconcile interval). The Caddy admin API IS available (on a Unix socket at /run/caddy/admin.sock), and the router IS configured to use it (--admin-socket /run/caddy/admin.sock). But the upsert fails.

Impact

  • No app routes can be configured by the router
  • Apps deployed to /data/apps/<slug>/htdocs/ return 404 (the catchall route exists but no app-specific routes are injected)
  • Manual route insertion via the admin API (POST) returns 200 but the route doesn't persist (possibly overwritten by the failing reconcile)

Environment

  • SJC tenant (tenants/sjc.nix), container running NixOS 25.11
  • Caddy 2.11.3, caddy-app-router 0.1.0
  • Admin socket: /run/caddy/admin.sock (exists, curl --unix-socket works)
  • Caddyfile has admin unix//run/caddy/admin.sock and *.apps.sonomajetcenter.com server block with the catchall comment
  • The converge's DNS phase was deferred (GATE-CF-TOKEN acked) — the NixOS config may not include the full app-hosting configuration because the DNS phase didn't complete
  • The Caddyfile shows the *.apps.sonomajetcenter.com block with a comment about catchall injection, but the catchall route already exists in the admin API config

Suggested investigation

  1. Check why the upsert fails — is the route format wrong? Is the admin API rejecting the PATCH/POST?
  2. Check if the DNS phase completion is required for the app-router to work (maybe the NixOS config generates a different Caddyfile when DNS completes)
  3. Consider making the router log the actual admin API error response, not just "upsert failed"
## Problem The `caddy-app-router` daemon repeatedly fails to upsert the catchall route in the `*.apps.<domain>` server: ``` ERROR caddy_app_router::reconcile failed to upsert catchall route in server *.apps.sonomajetcenter.com: upsert route in server *.apps.sonomajetcenter.com failed ``` This repeats every 5 seconds (the reconcile interval). The Caddy admin API IS available (on a Unix socket at `/run/caddy/admin.sock`), and the router IS configured to use it (`--admin-socket /run/caddy/admin.sock`). But the upsert fails. ## Impact - No app routes can be configured by the router - Apps deployed to `/data/apps/<slug>/htdocs/` return 404 (the catchall route exists but no app-specific routes are injected) - Manual route insertion via the admin API (POST) returns 200 but the route doesn't persist (possibly overwritten by the failing reconcile) ## Environment - SJC tenant (tenants/sjc.nix), container running NixOS 25.11 - Caddy 2.11.3, caddy-app-router 0.1.0 - Admin socket: `/run/caddy/admin.sock` (exists, curl --unix-socket works) - Caddyfile has `admin unix//run/caddy/admin.sock` and `*.apps.sonomajetcenter.com` server block with the catchall comment - The converge's DNS phase was deferred (GATE-CF-TOKEN acked) — the NixOS config may not include the full app-hosting configuration because the DNS phase didn't complete - The Caddyfile shows the `*.apps.sonomajetcenter.com` block with a comment about catchall injection, but the catchall route already exists in the admin API config ## Suggested investigation 1. Check why the upsert fails — is the route format wrong? Is the admin API rejecting the PATCH/POST? 2. Check if the DNS phase completion is required for the app-router to work (maybe the NixOS config generates a different Caddyfile when DNS completes) 3. Consider making the router log the actual admin API error response, not just "upsert failed"
Author
Owner

Closing as duplicate — the underlying fix was infra-template #10 (caddy-app-router ingress.yaml field name). The dashboard is now serving after correcting the ingress.yaml to use type: static + upstream: instead of type: static-contained + root:.

Closing as duplicate — the underlying fix was infra-template #10 (caddy-app-router ingress.yaml field name). The dashboard is now serving after correcting the ingress.yaml to use type: static + upstream: instead of type: static-contained + root:.
Author
Owner

Duplicate of infra-template #10 (ingress.yaml field name). Dashboard is serving after fixing ingress.yaml to type: static + upstream:. Closing.

Duplicate of infra-template #10 (ingress.yaml field name). Dashboard is serving after fixing ingress.yaml to type: static + upstream:. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
deepnet/dit-releases#8
No description provided.