ByteBite Docs
Infrastructure

Troubleshooting

Symptom-oriented infrastructure troubleshooting guide.

Troubleshooting

Symptom → likely cause → diagnosis → resolution. For recovery procedures, see Disaster recovery.

DNS resolves, TLS fails

Symptomdig returns correct IP; browser/curl shows TLS error
Likely causeACME failure, expired cert, or wrong resolver for host type
Diagnosisopenssl s_client -connect HOST:443 -servername HOST; check docker logs dokploy-traefik for ACME errors
ResolutionExplicit hosts: check HTTP-01 (acme.json). Wildcard: check DNS-01 token and acme-cloudflare.json. See TLS, Disaster recovery

Wildcard TLS works, request returns Traefik 404

SymptomValid TLS on *.staging.getbytebite.co but Traefik 404 page
Likely causeContainer not on dokploy-network or Traefik labels missing
Diagnosisdocker inspect <storefront-container> --format '{{json .NetworkSettings.Networks}}' — check for dokploy-network
ResolutionRe-attach dokploy-network via Dokploy domain config or manual network connect. Verify labels in running container match compose.deploy.yml

Wildcard request reaches wrong service

SymptomWildcard host serves dashboard or docs instead of storefront
Likely causeRouter priority conflict or missing wildcard labels
DiagnosisCheck Traefik router priorities; explicit Dokploy routers should have higher priority than wildcard (10/20)
ResolutionVerify Dokploy explicit domains still configured. Redeploy compose.deploy.yml to restore wildcard labels

/api reaches storefront instead of API

Symptomcurl https://HOST/api/health returns HTML or storefront response
Likely causeMissing API wildcard router (priority 20) or StripPrefix middleware
DiagnosisCheck api container labels for bytebite-staging-wildcard-api router
ResolutionRedeploy from compose.deploy.yml. For explicit hosts, verify Dokploy /api path rule with StripPrefix

API receives /api prefix unexpectedly

SymptomAPI logs show requests to /api/health instead of /health
Likely causeStripPrefix middleware not applied
DiagnosisCheck Traefik middleware bytebite-staging-wildcard-strip-api on API router
ResolutionVerify compose.deploy.yml labels; redeploy

Tenant displays wrong restaurant

SymptomStorefront shows wrong branding for hostname
Likely causeDatabase restaurant_domains mismatch or stale SSR cache
Diagnosiscurl -H "Host: EXPECTED_HOST" https://api.staging.getbytebite.co/storefront/restaurant
ResolutionCheck restaurant_domains table. Re-run seed-staging.js if needed. This is an application/data issue, not routing

Unknown tenant behavior

SymptomRandom *.staging.getbytebite.co shows "Restaurant not found"
ExpectedStorefront: HTTP 200 with not-found page. API tenant routes: HTTP 404. /api/health: HTTP 200
NoteStorefront HTTP 200 for unknown tenants is a known application gap — not an infrastructure failure

DB health fails

Symptom/health/db returns degraded
Likely causePostgreSQL container down, wrong DATABASE_URL, network issue
DiagnosisCheck Dokploy PostgreSQL service status; verify DATABASE_URL in api container env (name only, not value)
ResolutionRestart PostgreSQL via Dokploy. See Disaster recovery

Explicit routes work but wildcard does not

Symptomapi.staging… works; random *.staging… fails
Likely causeWildcard labels missing, dokploy-network not attached, or DNS-01 cert issue
DiagnosisInspect storefront/api container labels and networks; test wildcard TLS separately
ResolutionRedeploy compose; verify Traefik DNS-01 wiring. See Traefik post-upgrade checklist

Wildcard works but api/docs/dashboard are shadowed

SymptomReserved hosts serve storefront content
Likely causeWildcard priority higher than explicit Dokploy routers
DiagnosisCompare router priorities in Traefik dashboard or logs
ResolutionEnsure Dokploy explicit Host() routers exist and have higher priority than wildcard (10/20). This was verified working post-rollout — regression indicates Dokploy config loss

Certificate resolver missing

SymptomTraefik logs: unknown cert resolver letsencrypt-cloudflare
Likely causeTraefik recreated without custom traefik.yml
DiagnosisCheck /etc/dokploy/traefik/traefik.yml for letsencrypt-cloudflare block
ResolutionRestore from backup. See Disaster recovery

Cloudflare token failure

SymptomACME DNS challenge fails; Cloudflare API errors in Traefik logs
Likely causeInvalid/expired token, wrong permissions, or missing mount
DiagnosisVerify token file exists at /etc/dokploy/traefik/secrets/cloudflare-dns-api-token (mode 600); check container mount
ResolutionRotate token. See Operations

acme-cloudflare.json problems

SymptomWildcard cert not renewing or corrupt ACME state
Likely causeFile permissions, concurrent writes, or manual edit
DiagnosisCheck file exists and is valid JSON; compare with backup checksums
ResolutionRestore from /root/bytebite-traefik-post-wildcard-20260908-175333/

Dokploy recreated Traefik without secret wiring

SymptomAll explicit TLS may work (HTTP-01) but wildcard TLS fails after Dokploy upgrade
Likely causeContainer env/mount customization lost on recreate
Diagnosisdocker inspect dokploy-traefik — check for CF_DNS_API_TOKEN_FILE and secrets mount
ResolutionRe-apply customization from backup inspect. See Disaster recovery

Docker inspect permission denied

Symptomdocker inspect fails with permission denied
Likely causeUser not in docker group or not root
Diagnosisgroups; try sudo docker inspect
ResolutionUse sudo or add user to docker group (requires re-login)

Local .test request takes ~5 seconds (macOS)

SymptomLocal dev requests hang ~5s then succeed
Likely causeMissing ::1 entries in /etc/hosts — macOS tries IPv6 AAAA first
DiagnosisCheck /etc/hosts for both 127.0.0.1 and ::1 lines per host
ResolutionAdd IPv6 entries. See Local deployment

Dokploy Preview Compose has unexpected labels

SymptomPreview Compose in Dokploy UI shows labels not in Git
ExpectedDokploy injects domain labels and dokploy-network — this is normal
ResolutionNo action needed. Repository compose.deploy.yml + Dokploy injection combine at runtime. See Dokploy

Dashboard /.env returns SPA HTML

Symptomcurl https://dashboard.staging.getbytebite.co/.env returns HTTP 200 with HTML
Expectednginx SPA fallback (try_files … /index.html) — not real file exposure
ResolutionKnown gap. Fix requires nginx config change to reject dot-paths. See Security

On this page