Skip to content

[bugfix] Frontend: give GQ_BACKEND_HOST a working default to fix 503s#483

Open
els0r wants to merge 1 commit into
mainfrom
claude/github-issue-480-backend-default
Open

[bugfix] Frontend: give GQ_BACKEND_HOST a working default to fix 503s#483
els0r wants to merge 1 commit into
mainfrom
claude/github-issue-480-backend-default

Conversation

@els0r

@els0r els0r commented Jun 21, 2026

Copy link
Copy Markdown
Owner

A remote single-host deployment that left GQ_BACKEND_HOST unset hit
api request failed: status=503 with Caddy logging "no upstreams available":
the image's default for GQ_BACKEND_HOST was the empty string, so
reverse_proxy /_query* {$GQ_BACKEND_HOST} expanded to a proxy with no upstream
to dial.

Give the proxy a sane fallback so it works out of the box:

  • Caddyfile: default the env placeholder to http://127.0.0.1:8146, so an
    unset or empty GQ_BACKEND_HOST still yields a valid upstream.
  • Dockerfile: set the same value as the image-level ENV default instead of
    an empty string.
  • docker-compose.yaml: the frontend default pointed at :8145 (the goProbe
    sensor API port) while global-query listens on :8146 (SERVER_ADDR) — fix
    the mismatch so the documented stack proxies to the right service.
  • README: document GQ_BACKEND_HOST vs GQ_API_BASE_URL and the
    "no upstreams available" failure mode.

Closes #480

🤖 Generated with Claude Code

A remote single-host deployment that left GQ_BACKEND_HOST unset hit
"api request failed: status=503" with Caddy logging "no upstreams
available": the image's default for GQ_BACKEND_HOST was the empty string,
so `reverse_proxy /_query* {$GQ_BACKEND_HOST}` expanded to a proxy with no
upstream to dial.

Give the proxy a sane fallback so it works out of the box:

- Caddyfile: default the env placeholder to http://127.0.0.1:8146, so an
  unset OR empty GQ_BACKEND_HOST still yields a valid upstream.
- Dockerfile: set the same value as the image-level ENV default instead of
  an empty string.
- docker-compose.yaml: the frontend default pointed at :8145 (the goProbe
  sensor API port) while global-query listens on :8146 (SERVER_ADDR) — fix
  the mismatch so the documented stack proxies to the right service.
- README: document GQ_BACKEND_HOST vs GQ_API_BASE_URL and the "no upstreams
  available" failure mode.

Fixes #480

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsqHDFCs6ebQPjXQNpvNsW
@els0r els0r requested a review from fako1024 June 22, 2026 05:19

@fako1024 fako1024 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comment / documentation improvements would be appreciated, aside from that requires testing, unclear if this solves the issue.

### Runtime configuration

The image is configured entirely through environment variables, read at
container startup. The two networking knobs are easy to confuse:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small chart displaying the interaction between the components, in particular frontend + caddy, global query and goprobe nodes (+ e.g. production environment with an nginx / TLS reverse proxy in front) would help.

Comment thread docker-compose.yaml
# Environment variables:
# GQ_BACKEND_HOST - backend API address for Caddy's reverse proxy
# (default: http://127.0.0.1:8145)
# GQ_BACKEND_HOST - global-query API address for Caddy's reverse proxy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment here is still weak in terms of clarity (it should be clear that this the global query endpoint, the phrase is still too weak, even more so if an actual reverse proxy like nginx is involved in a production environment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queries not working in remote setup, documentation not 100% clear

3 participants