You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CatalogMaintenanceRunnable fails repeatedly on clusters without backup configuration #774
The CatalogMaintenanceRunnable is registered unconditionally on every instance, including replica clusters that have no backup configuration (no barmanObjectName parameter).
Create a replica cluster with the barman-cloud plugin enabled but no barmanObjectName in the plugin parameters (i.e., no backup configuration — only WAL restore from a source cluster).
Observe the sidecar logs:
{"level":"error","msg":"Retention policy enforcement failed","error":"resource name may not be empty"}
Repeating every ~5 minutes.
Suggested fix
Add an early return in cycle() when BarmanObjectName is empty:
func (c*CatalogMaintenanceRunnable) cycle(ctx context.Context) (time.Duration, error) {
varcluster cnpgv1.Clusteriferr:=c.Client.Get(ctx, c.ClusterKey, &cluster); err!=nil {
return0, err
}
configuration:=config.NewFromCluster(&cluster)
ifconfiguration.BarmanObjectName=="" {
return0, nil
}
// ... rest of the function
}
Alternatively, don't register CatalogMaintenanceRunnable at all when there's no backup configuration. Note that the barman sidecar itself is still needed on replica clusters for WAL restore. Only the retention runnable is unnecessary.
However, not registering CatalogMaintenanceRunnable conditionally requires reading the cluster spec at sidecar startup to determine whether backup is configured, which adds complexity. The early return in cycle() is simpler and handles the case at runtime.
@daanvinken thanks for reporting this bug. While your proposals could technically work I believe there are few other things we should consider.
Replica Clusters have the ability to either restore WAL files from a source archive and to perform backups and WAL archiving to a target ObjectStore. Both operations are delegated to the same plugin-barman-cloud sidecar container, which is configured via Lifecycle hook for Clusters having the plugin enabled for either ExternalClusters (for restores) or via the standard Plugin stanza (for backups).
However, the maintenance task is meant to be performed only against the target ObjectStore for Backups and WAL archiving.
Beside ensuring the presence of the configuration.BarmanObjectName info, I think we should check if the plugin is enabled to perform Backups and WAL archiving first and proceeding only if this condition is verified and returning an error in case of missing BarmanObjectName.
I would avoid omitting the registration of CatalogMaintenanceRunnable if no backup configuration is present as, if added later, it would require a restart to be registered.
Activity
GabriFedi97 commentedon Apr 3, 2026
@daanvinken thanks for reporting this bug. While your proposals could technically work I believe there are few other things we should consider.
Replica Clusters have the ability to either restore WAL files from a source archive and to perform backups and WAL archiving to a target ObjectStore. Both operations are delegated to the same
plugin-barman-cloudsidecar container, which is configured via Lifecycle hook for Clusters having the plugin enabled for either ExternalClusters (for restores) or via the standard Plugin stanza (for backups).However, the maintenance task is meant to be performed only against the target ObjectStore for Backups and WAL archiving.
Beside ensuring the presence of the
configuration.BarmanObjectNameinfo, I think we should check if the plugin is enabled to perform Backups and WAL archiving first and proceeding only if this condition is verified and returning an error in case of missingBarmanObjectName.I would avoid omitting the registration of
CatalogMaintenanceRunnableif no backup configuration is present as, if added later, it would require a restart to be registered.fix: skip maintenance cycle when plugin is not enabled for backups (#826
chore(main): release 0.12.0 (#756)
chore(deps): update dependency cloudnative-pg/plugin-barman-cloud to …
chore(deps): update dependency cloudnative-pg/plugin-barman-cloud to …
chore(deps): update dependency https://github.com/cloudnative-pg/plug…