plugin-barman-cloud icon indicating copy to clipboard operation
plugin-barman-cloud copied to clipboard

When using external clusters, but external ObjectStore is missing, logs complain about missing ObjectStore for backups

Open d-uzlov opened this issue 1 year ago • 1 comments

I tried to restore from an external cluster.

For this I created 2 ObjectStore objects: s3-postgres-backup and old-s3. I added s3-postgres-backup into .spec.plugins.parameters.barmanObjectName section, and old-s3 into .spec.externalClusters.plugin.parameters.barmanObjectName.

Here is my Cluster object for reference:

---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: pg-test
  namespace: test
spec:
  instances: 2
  storage:
    size: 2Gi
    storageClass: tulip-nvmeof
  primaryUpdateStrategy: unsupervised
  postgresql: {}
  bootstrap:
    recovery:
      source: old
  externalClusters:
  - name: old
    plugin:
      name: barman-cloud.cloudnative-pg.io
      parameters:
        barmanObjectName: s3-old
        serverName: test-cnpg
  managed:
    services:
      disabledDefaultServices: ["ro", "r"]
  affinity:
    enablePodAntiAffinity: true
    podAntiAffinityType: required
    topologyKey: kubernetes.io/hostname
  plugins:
  - name: barman-cloud.cloudnative-pg.io
    isWALArchiver: true
    parameters:
      barmanObjectName: s3-postgres-backup

Except, as you may notice, I made a mistake in .spec.externalClusters.plugin.parameters.barmanObjectName: I wrote "s3-old" instead of "old-s3". Cluster failed to start becaue Barman couldn't find the ObjectStore.

Unfortunately, it was very hard to find the mistake because Barman repeatedly emitted logs about "s3-postgres-backup" missing. I couldn't understand what was happening, until I accidentally discovered that the issue is in a completely different ObjectStore.

{"level":"info","ts":"2025-08-31T10:18:03.018676926Z","msg":"Pre hook reconciliation start"}
{"level":"debug","ts":"2025-08-31T10:18:03.018848066Z","msg":"parsing cluster definition","caller":"/workspace/internal/cnpgi/operator/reconciler.go:61"}
{"level":"debug","ts":"2025-08-31T10:18:03.019179367Z","msg":"parsing barman object configuration","name":"pg-test","namespace":"test","caller":"/workspace/internal/cnpgi/operator/reconciler.go:75"}
{"level":"info","ts":"2025-08-31T10:18:03.019225014Z","msg":"barman object configuration not found, requeuing","name":"pg-test","namespace":"test","name":"s3-postgres-backup","namespace":"test"}

Barman plugin version: v0.6.0

d-uzlov avatar Aug 31 '25 10:08 d-uzlov

Hi @d-uzlov! I'm Dosu and I’m helping the plugin-barman-cloud team.

The logs referenced the wrong ObjectStore ("s3-postgres-backup") because the reconciler in the plugin-barman-cloud operator iterates through all ObjectStore references (from both .spec.plugins and .spec.externalClusters) and logs missing configurations using the main plugin's barmanObjectName, not necessarily the one that is actually missing. This can be confusing when multiple ObjectStores are configured and the error is in the external cluster section, as in your case. The log message does not clearly distinguish which ObjectStore reference is missing, making troubleshooting harder when there is a typo or misconfiguration in .spec.externalClusters.plugin.parameters.barmanObjectName source.

To avoid this issue, always double-check that every ObjectStore referenced in both .spec.plugins.parameters.barmanObjectName and .spec.externalClusters.plugin.parameters.barmanObjectName matches an existing ObjectStore resource name in the same namespace. If the cluster fails to start and logs complain about a missing ObjectStore, verify all references, not just the one mentioned in the logs. This behavior and troubleshooting advice are confirmed by user reports and documentation source source.

There is ongoing user feedback requesting more granular log messages to help pinpoint which ObjectStore reference is actually missing, especially when multiple are configured source. For now, careful review of all ObjectStore references is the best way to troubleshoot similar issues.

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about plugin-barman-cloud with Dosu Add Dosu to your team

dosubot[bot] avatar Aug 31 '25 10:08 dosubot[bot]