[bugfix] Frontend: give GQ_BACKEND_HOST a working default to fix 503s#483
Open
els0r wants to merge 1 commit into
Open
[bugfix] Frontend: give GQ_BACKEND_HOST a working default to fix 503s#483els0r wants to merge 1 commit into
els0r wants to merge 1 commit into
Conversation
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
fako1024
reviewed
Jun 22, 2026
fako1024
left a comment
Collaborator
There was a problem hiding this comment.
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: |
Collaborator
There was a problem hiding this comment.
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.
| # 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. |
Collaborator
There was a problem hiding this comment.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A remote single-host deployment that left
GQ_BACKEND_HOSTunset hitapi request failed: status=503with Caddy logging"no upstreams available":the image's default for
GQ_BACKEND_HOSTwas the empty string, soreverse_proxy /_query* {$GQ_BACKEND_HOST}expanded to a proxy with no upstreamto dial.
Give the proxy a sane fallback so it works out of the box:
http://127.0.0.1:8146, so anunset or empty
GQ_BACKEND_HOSTstill yields a valid upstream.ENVdefault instead ofan empty string.
:8145(the goProbesensor API port) while global-query listens on
:8146(SERVER_ADDR) — fixthe mismatch so the documented stack proxies to the right service.
GQ_BACKEND_HOSTvsGQ_API_BASE_URLand the"no upstreams available" failure mode.
Closes #480
🤖 Generated with Claude Code