fix(grafana): stop requiring the internet to start - #165
Merged
Conversation
GF_INSTALL_PLUGINS made Grafana's background installer contact grafana.com on every start, and a failure there was fatal to the process: starting module plugin.backgroundinstaller: ... failed to install plugin grafana-piechart-panel@: Get "https://grafana.com/api/plugins/..." Grafana crash-looped, even though both plugins were already present in grafana-data. So a host that had lost its uplink — an entirely ordinary disaster — would restore successfully and then fail to bring Grafana up. Every other service in the stack starts offline. Found by running the whole-stack restore rehearsal in docs/runbooks/restore-the-stack.md. Both plugins are removed rather than migrated to GF_PLUGINS_PREINSTALL, because neither was doing anything: - No dashboard under grafana/dashboards/ uses either panel type. Every panel across the five dashboards is a core type, and the only mention of either plugin anywhere in the repository was the compose line itself. There are no UI-created dashboards to worry about either — the dashboard table is empty in the live database. - grafana-piechart-panel is an Angular plugin, and this Grafana refuses to initialise those. It was downloaded and then rejected on every single start: "Plugin validation failed ... angular plugins are not supported". Grafana has had a built-in piechart since v8 regardless. - GF_INSTALL_PLUGINS is itself deprecated in favour of GF_PLUGINS_PREINSTALL. Removing the declaration fixes all three at once and leaves nothing to migrate. Verified as the task asked, on a scratch project with `internal: true` on the compose network so there is no route off the host, in both cases that matter: fresh volumes grafana healthy, 0 restarts, database ok, whole stack up restored volumes grafana healthy, 0 restarts, database ok, whole stack up with the restored admin row and datasources intact The mechanism is now visible in the logs: "Plugins installed plugins=[]", while Grafana's own bundled apps (pyroscope, exploretraces, metricsdrilldown, lokiexplore, elasticsearch) still register from inside the image. On restored volumes those apps do log "Failed to get plugin info" against grafana.com, but unlike a GF_INSTALL_PLUGINS entry that failure is not fatal — Grafana keeps the version it already has and carries on. The runbook's CAUTION becomes a NOTE: the stack starting with no internet is now a tested property worth knowing during a recovery, rather than a trap. The finding is kept in the rehearsal write-up, in the past tense. One loose end, deliberately not done here: the grafana-piechart-panel directory is still inside the live grafana-data volume, so the Angular rejection is still logged once per start. It is cosmetic, no alert rule matches it, and deleting files out of a production volume is not something to fold into this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Found while running the whole-stack restore rehearsal in #164.
Note
Stacked on #164, because the runbook section this updates only exists there.
Base is
fix/backup-volumes-verified; retarget tomainonce #164 merges.The only files touched here are
compose.yamland the runbook.The bug
GF_INSTALL_PLUGINSmade Grafana's background installer contactgrafana.comon every start, and a failure there was fatal to the process:
Grafana crash-looped, even though both plugins were already in
grafana-data.A host that had lost its uplink — an ordinary disaster — would restore
successfully and then fail to bring Grafana up. Every other service starts
offline fine.
Why removal rather than
GF_PLUGINS_PREINSTALLThe task offered "drop piechart, migrate the rest". Investigating, neither
plugin was doing anything, so there is nothing to migrate:
grafana/dashboards/uses either panel type —every panel across all five is a core type, and the only mention of either
plugin anywhere in the repo was the compose line itself. No UI-created
dashboards exist to worry about either: the
dashboardtable is empty in thelive database.
grafana-piechart-panelnever worked. It is Angular, which this Grafanarefuses to initialise — downloaded and then rejected on every start with
Plugin validation failed ... angular plugins are not supported. Grafana hashad a built-in piechart since v8 anyway.
GF_PLUGINS_PREINSTALL.Removing the declaration fixes all three at once.
Verification
As the task specified — scratch project,
internal: trueon the compose networkso there is no route off the host, both cases that matter:
healthy, 0 restarts,database: ok, whole stack uphealthy, 0 restarts,database: ok, whole stack up, restored admin row (created 2026-08-17) and 3 datasources intactThe mechanism is visible in the logs:
Plugins installed plugins=[], whileGrafana's own bundled apps (pyroscope, exploretraces, metricsdrilldown,
lokiexplore, elasticsearch) still register from inside the image. On restored
volumes those apps do log
Failed to get plugin infoagainstgrafana.com—but unlike a
GF_INSTALL_PLUGINSentry, that failure is not fatal; Grafanakeeps the version it already has and carries on. That distinction is the whole
fix.
Docs
The runbook's
CAUTIONbecomes aNOTE: the stack starting with no internet isnow a tested property worth knowing during a recovery, rather than a trap. The
finding is kept in the rehearsal write-up, in the past tense.
Loose end, deliberately not done here
The
grafana-piechart-paneldirectory is still inside the livegrafana-datavolume, so the Angular rejection is still logged once per start. It is cosmetic,
no Loki rule matches it, and deleting files out of a production volume isn't
something to fold into this change. To clear it when convenient:
docker compose -f stacks/observability/compose.yaml stop grafana docker run --rm -v observability_grafana-data:/d "$(./scripts/image-for.sh archiver)" \ rm -rf /d/plugins/grafana-piechart-panel /d/plugins/grafana-clock-panel docker compose -f stacks/observability/compose.yaml start grafana🤖 Generated with Claude Code