Repository navigation
Description
Summary
The human-friendly credentials Secret produced by the system/bucket chart (<bucketName>-<user>-credentials, e.g. bucket-cozy-backups-system-credentials) is gated on a Helm lookup of the COSI-provisioned BucketInfo Secret. Because the COSI Secret is provisioned asynchronously (after the BucketClaim reconciles) and Helm only re-evaluates lookup on a real chart upgrade, the credentials Secret is never created if the COSI Secret appears after the release's last reconcile. It does not self-heal.
For the platform backup flow this is fatal: backupstrategy-controller projects credentials from bucket-cozy-backups-system-credentials, so a Postgres BackupJob stays stuck forever with CredentialsProjectionPending: source credentials Secret tenant-root/bucket-cozy-backups-system-credentials not found.
Evidence
packages/system/bucket/templates/user-credentials.yamlrenders the-credentialsSecret only inside alookupgate:{{- $existingSecret := lookup "v1" "Secret" $.Release.Namespace $secretName }} {{- if $existingSecret }} ... name: {{ $secretName }}-credentials {{- end }}$secretNameis the COSIBucketInfoSecret (e.g.bucket-cozy-backups-system), which is created asynchronously by the COSI driver after the BucketClaim is provisioned.- Helm evaluates
lookuponly during an actual install/upgrade. If the release last reconciled before the COSI Secret existed,lookupreturns empty, the-credentialsSecret is skipped, and no subsequent reconcile re-renders it (the release is otherwise unchanged). This is the samelookup-timing class as test(e2e): re-enable and modernize the VM backup e2e (backup path is uncovered) #3236.
Observed impact (live v1.5.x, SeaweedFS-backed)
- On a freshly provisioned platform backup bucket,
bucket-cozy-backups-system(COSIBucketInfo) existed, butbucket-cozy-backups-system-credentialswas absent hours later; the helm release manifest did not contain it. - Every Postgres
BackupJobagainstcozy-defaultstayed inCredentialsProjectionPendinguntil the credentials Secret was created manually. It never appeared on its own.
Proposed fix
Remove the dependency on a one-shot lookup, e.g.:
- Have the bucket application controller/driver create the
-credentialsSecret when the COSIBucketInfoSecret is created (event-driven), instead of relying on a Helm render-timelookup; or - Add a periodic/bounded requeue so the chart re-renders once the COSI Secret appears (analogous to the fix discussed in test(e2e): re-enable and modernize the VM backup e2e (backup path is uncovered) #3236); or
- Derive the
-credentialsSecret directly from the COSI provisioning result rather than a template-time lookup.
Activity
androndo commentedon Oct 13, 2026
Closing as fixed for the supported release lines.
The impact described here —
bucket-cozy-backups-system-credentialsnever being created, which leaves every default-BackupClassBackupJobstuck inCredentialsProjectionPending— is handled by #3524 (main) and its backport #3731 (release-1.6).backupstrategy-controller'sDefaultObjectsGate(internal/backupcontroller/default_objects_gate.go) detects the missing platform credentials Secret and forces a real Helm upgrade of the bucket release, so thelookupre-runs once the COSIBucketInfoSecret exists. The fix ships in v1.6.4 and v1.7.0-rc.1. The 1.5 line ended with v1.5.4, so the 1.5 backport (#3880) has been closed.Known remainder, not covered by the gate: tenant buckets keep the one-shot
lookupbehaviour ofpackages/system/bucket/templates/user-credentials.yaml. If a tenant bucket's COSI Secret appears after the release's last render, its-credentialsSecret still needs a forced upgrade (reconcile.fluxcd.io/forceAt+requestedAt). That needs a controller that owns all buckets; please open a dedicated issue if it shows up in practice.