Plugin restore doesn`t work due to "no restore jobs hook capability" (plugin version v0.6.0, sidecar image version v.0.5.0), cnpg 1.27
I am testing restore from an S3 bucket with the plugin, using the documented restore procedure, from a a working backup archive, cluster and objectstore spec available in this issue if needed.
manifest:
# Source: obfuscated-db/templates/restoreTest.yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: obfuscated-db-stage-restore-test
spec:
instances: 1
imagePullPolicy: IfNotPresent
bootstrap:
recovery:
source: source
externalClusters:
- name: source
plugin:
name: barman-cloud.cloudnative-pg.io
parameters:
serverName: obfuscated-db-stage
ObjectName: obfuscated-db-stage-backup
storage:
size: 5Gi
k logs obfuscated-db-stage-restore-test-1-full-recovery-8vg2f
Defaulted container "full-recovery" out of: full-recovery, bootstrap-controller (init)
{"level":"info","ts":"2025-09-01T10:20:37.974081413Z","msg":"Starting webserver","logging_pod":"obfuscated-db-stage-restore-test-1-full-recovery","address":"localhost:8010","hasTLS":false}
{"level":"info","ts":"2025-09-01T10:20:38.075642701Z","msg":"Restore through plugin detected, proceeding...","logging_pod":"obfuscated-db-stage-restore-test-1-full-recovery"}
{"level":"error","ts":"2025-09-01T10:20:38.075788667Z","msg":"Error while restoring a backup","logging_pod":"obfuscated-db-stage-restore-test-1-full-recovery","error":"no plugin supports the restore job hooks capability","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/[email protected]/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.restoreSubCommand\n\tinternal/cmd/manager/instance/restore/restore.go:79\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.(*restoreRunnable).Start\n\tinternal/cmd/manager/instance/restore/restore.go:62\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\tpkg/mod/sigs.k8s.io/[email protected]/pkg/manager/runnable_group.go:226"}
{"level":"info","ts":"2025-09-01T10:20:38.075936142Z","msg":"Stopping and waiting for non leader election runnables"}
{"level":"info","ts":"2025-09-01T10:20:38.075954237Z","msg":"Stopping and waiting for leader election runnables"}
{"level":"info","ts":"2025-09-01T10:20:38.076017473Z","msg":"Webserver exited","logging_pod":"obfuscated-db-stage-restore-test-1-full-recovery","address":"localhost:8010"}
{"level":"info","ts":"2025-09-01T10:20:38.076036788Z","msg":"Stopping and waiting for caches"}
{"level":"info","ts":"2025-09-01T10:20:38.076095902Z","msg":"Stopping and waiting for webhooks"}
{"level":"info","ts":"2025-09-01T10:20:38.076149305Z","msg":"Stopping and waiting for HTTP servers"}
{"level":"info","ts":"2025-09-01T10:20:38.076158969Z","msg":"Wait completed, proceeding to shutdown the manager"}
{"level":"error","ts":"2025-09-01T10:20:38.076182609Z","msg":"restore error","logging_pod":"obfuscated-db-stage-restore-test-1-full-recovery","error":"while restoring cluster: no plugin supports the restore job hooks capability","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/[email protected]/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.NewCmd.func1\n\tinternal/cmd/manager/instance/restore/cmd.go:101\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1015\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\tcmd/manager/main.go:71\nruntime.main\n\t/opt/hostedtoolcache/go/1.24.6/x64/src/runtime/proc.go:283"}
The error "no plugin supports the restore job hooks capability" happens because the barman-cloud plugin v0.6.0 does not implement or advertise the restore job hooks capability required by CloudNativePG 1.27 for plugin-based restores. This capability is not mentioned in the plugin's documentation or code, and recent pull requests do not add support for it. There is also no documented version matrix for plugin, sidecar, and CNPG compatibility for restore operations. The plugin documentation only lists CNPG 1.26 as a requirement, not 1.27, and there are known compatibility issues when upgrading to CNPG 1.27 with plugin v0.6.0 and sidecar v0.5.0 [docs].
At this time, the restore flow with plugins in CNPG 1.27+ requires explicit support for restore job hooks, which the current plugin version does not provide [source]. There is no workaround documented, and no evidence that any released version of the plugin supports this capability. You may need to wait for a plugin release that adds this support or consider using a supported version matrix (such as plugin and CNPG 1.26) for restores.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
I want to follow up on this issue, as I have located the problem, it was a syntactic error on my part, but it was really difficult to catch.
I had somehow put in the wrong parameter in Cluster.spec.externalClusters[0].plugin.parameters.barmanObjectName and named it Cluster.spec.externalClusters[0].plugin.parameters.ObjectName
It would be really helpful if the plugin could export a schema to see if the parameters it got are sane.