fix(forte-drop-pg-backup): upload with rclone, the mc image can no longer be pulled #64
Open
jorgen.stensrud
wants to merge 2 commits from
fix/forte-drop-pg-backup-rclone into main
pull from: fix/forte-drop-pg-backup-rclone
merge into: :main
:main
:fix/forte-drop-pg-backup-rclone
:hotfix/gitea-backup
:renovate/all-minor-patch
:feature/ai-bot
:renovate/traefik-41.x
:renovate/aws-6.x
:renovate/google-8.x
:fm/launchpad-forte-cli
:renovate/kubernetes-monorepo
:feature/forte-prod
:fix/drop-duplicate-keycloak-secret
:feature/dns01
:feat/forte-drop-infra
:feature/ppusher
:feature/chibisafe
:hotfix/backup
:feature/vault-migration
:feature/hashicorp-vault
:feature/homepage
:feature/argocd-rbac
:feature/argocd-tls
:feature/multi-cloud
:feature/karpor
:feature/backstage
:feature/ai-review
:gitea-pages
:feature/gitea-docs
:feature/multicluster
:feature/secret-syncing
:feature/smtp
Dismiss Review
Are you sure you want to dismiss this review?
No labels
Milestone
No items
No Milestone
Assignees
ai_bot (Forte AI Bot)
aslak.ege (Aslak Ege)
danijel.simeunovic (Danijel Simeunovic)
edvard.unsvag (Edvard Unsvåg)
eilif.akerjordet (Eilif Akerjordet)
ellina.ivleva (Ellina Ivleva)
fredrik.heistad (Fredrik Heistad)
frode.haugarne (Frode Selnes Haugarne)
gitea_admin
grysiri (Gry Siri Eggen)
henrik.farstad (Henrik Farstad)
jorgen.stensrud (Jørgen Stensrud)
kristoffer.kopperud (Kristoffer Markus Kopperud)
nina.marie.wahl (Nina Marie Wahl)
ola.skarphol
oystein.roti (Øystein Roti)
peter.froystad (Peter Frøystad)
petter.schultz (Petter Schultz)
ragnhild.hande (Ragnhild Aaraas Hånde)
Thomas-Mannsverk-Eliassen (Thomas Mannsverk Eliassen)
thomas.solbjor (Thomas Solbjor)
trond.tomtebakken (Trond Andre Tømtebakken)
vibearchitect (Rolf Alexander Valstad)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Forte/launchpad#64
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
The nightly Postgres backup of forte-drop uploads with
quay.io/minio/mc:RELEASE.2024-11-21T17-21-54Z. MinIO made themcrepository private: that tag answers 401 on quay.io (checked 2026-11-24, also with an anonymous pull token). It is the cause90b8e6ffixed for the Gitea backup; this job did not get the same change.The last dump known to be in the bucket is
_pgbackups/forte-drop-20260924T020008Z.sql.gz. Whether the job has failed every night since is not confirmed: I cannot see the pods or list the bucket. A node that still has the image cached would keep working.What
apps/overlays/upc-dev/forte-drop-postgresql/resources/pg-backup-cronjob.yaml: the upload container usesrclone/rclone:1.75.2(the version the Gitea job pins).rclone copy /work s3:drops/_pgbackups/ --include "*.sql.gz"replacesmc cp.rclone delete --min-age 30d --use-server-modtime s3:drops/_pgbackups/replacesmc rm --older-than 30d. The prefix is fixed in the script: the bucket also holds every drop.HOME=/work(writable for uid 65532 through fsGroup) replacesMC_CONFIG_DIR.RCLONE_S3_NO_CHECK_BUCKET=trueas in the Gitea job.Not tested
Not run anywhere: no cluster access and no Docker here. Please check after merge:
and that a new
forte-drop-<timestamp>.sql.gzis in_pgbackups/.Not changed
RESTORE.mdin the same folder still runs its listing and download pods with themcimage, so the restore runbook cannot run as written either. Left alone because I cannot test a rewrite; it needs the same swap.Review
Codex review: no findings.
🤖 Generated with Claude Code
🤖 AI Review · O1
⚠️ Findings present — 🔴 0 blocker · 🟠 1 medium · 🟡 0 low
📝 Assessment · O1-A
This PR replaces the upload container of the nightly forte-drop
pg_dumpCronJob. It drops thequay.io/minio/mcimage, which can no longer be pulled, and usesrclone/rclone:1.75.2, the same fix already applied tocluster-resources/gitea-backup-cronjob.yaml.Correctness of the swap. The new script matches the old behaviour, and in places it is stricter than the old one:
RCLONE_CONFIG_S3_*env vars, so no config file has to exist.rclone copy /work "$DEST" --include "*.sql.gz"uploads only the dump. Anything rclone itself writes underHOME=/workis filtered out.rclone delete --min-age 30d --use-server-modtime "$DEST"is scoped tos3:drops/_pgbackups/, just like the oldmc rm --recursive --older-than 30d. The drop objects elsewhere in the bucket are not at risk.--use-server-modtimemakes the age check use S3 LastModified without extra HEAD requests, which is right here.RCLONE_S3_NO_CHECK_BUCKET=trueavoids a CreateBucket call, the same as the Gitea job.HOME=/workworks for uid 65532 because offsGroup.set -euo pipefailinshstill works.Pre-existing, not introduced here. The
|| trueon the prune step still hides retention failures. There is also noactiveDeadlineSeconds, which the Gitea job has. Both are optional hardening.Main remaining risk. The change has not been run anywhere, and the author is open about that. Run the manual-job check from the description after merge. Separately, the restore runbook in the same folder still uses the unpullable mc image, which leaves the recovery path broken (see finding). This is not a blocker for merging the backup fix, but it should be done soon.
🔎 Findings · 1
🟠 MEDIUM ·
O1-F1· Restore runbook still depends on the mc image that can no longer be pulledExplanation
This PR fixes the backup writer. The documented read path in the same folder still uses
quay.io/minio/mc:RELEASE.2024-11-21T17-21-54Z, which the PR says now answers 401:mc-get(RESTORE.md:87-90)mc mirrorexample (RESTORE.md:130)The PR description says this was left alone on purpose. Still, a backup you cannot restore by following the runbook is only half fixed, and you will need the restore path during an incident, when nobody has time to rewrite it. The swap is mechanical. It uses the same image and the same env-var remote configuration this PR adds to the CronJob, so it can go in this PR or a quick follow-up.
Where
apps/overlays/upc-dev/forte-drop-postgresql/RESTORE.md:32–36· HEADapps/overlays/upc-dev/forte-drop-postgresql/RESTORE.md:86–90· HEADapps/overlays/upc-dev/forte-drop-postgresql/resources/pg-backup-cronjob.yaml:79–99· HEADImpact
In a disaster-recovery situation, an operator following RESTORE.md hits ImagePullBackOff on both the listing step and the download step. They then have to work out an alternative under pressure.
Recommendation
Replace the mc pods with rclone and reuse the CronJob's env-based remote. For example, for listing:
For the download step, use
rclone cat s3:drops/_pgbackups/$DUMPin place ofmc cat .... Userclone syncin place of themc mirrorexample. Test the listing command when you run the manual backup job after merge. If you defer this, at least open a tracking issue.🧭 Coverage and limitations
Reviewed
apps/overlays/upc-dev/forte-drop-postgresql/resources/pg-backup-cronjob.yaml(full file and diff)cluster-resources/gitea-backup-cronjob.yaml(the reference rclone setup)apps/overlays/upc-dev/forte-drop-postgresql/RESTORE.mdapps/Not verified
I could not run the job or check cluster or bucket state. Whether rclone authenticates against UpCloud Object Storage with
provider=Otherand these credentials is inferred from the working Gitea job, not observed.Agentic review by AI Git Bot
Confirmed in the cluster (read-only, 2026-11-24):
forte-drop-pg-backup-29836920, 2026-09-24T02:00:26Z. Nothing has completed since, 61 days.forte-drop-pg-backup-29923320has been stuck for 23 h: thedumpinit container finished with exit 0, theuploadcontainer is inImagePullBackOffonquay.io/minio/mc:RELEASE.2024-11-21T17-21-54Z("failed to resolve reference … unexpected status from HEAD request to https://quay.io/v2/minio/mc/manifests/…").concurrencyPolicy: Forbid, so a stuck job blocks the following nights; the three older jobs each hung for days before failing.DiskPressureon the node. All four nodes reportDiskPressure=Falsenow. Not part of this PR.So what the description calls "not confirmed" is now confirmed. The new job itself has still not been run anywhere.
Two updates, head on this branch now includes
RESTORE.md.Tested locally (Docker), with the script, image and env taken verbatim from the YAML in this PR:
dumpinit container (only the hostname swapped), uid 65532, read-only rootforte-drop-<ts>.sql.gzin/workuploadcontainer,rclone/rclone:1.75.2, uid 65532, read-only root,HOME=/works3:drops/_pgbackups/--min-age 30d--min-age 1s_pgbackups/deleted,drops/abc-123/index.htmluntouchedThe S3 server was
adobe/s3mock, not UpCloud, so what is still unproven is rclone against UpCloud Object Storage with the app's credentials. The Gitea job does that with the same settings.ai-review finding O1-F1 (restore runbook still used the mc image): fixed.
RESTORE.mdnow lists and downloads withrclone/rclone:1.75.2and the same env-var remote as the job, the placeholder single-pod variant is gone, and themc mirrorexample isrclone sync. Therclone lsl/rclone catcommands are the ones from the local test; thekubectl run … --overrideswrappers around them have not been run in the cluster.Not changed (pre-existing, from the review):
|| trueon the prune, noactiveDeadlineSeconds. The second one matters more than it looks: the current job has been stuck inImagePullBackOfffor a day and blocks the following nights (concurrencyPolicy: Forbid). Say if you want it in this PR.After merge the stuck job
forte-drop-pg-backup-29923320has to be deleted, or the new spec will not run until it gives up.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.