Skip to content

[Bug]: The annotation skipEmptyWalArchiveCheck is not working when recovering a Cluster via Barman Cloud Plugin #8215

Closed

Description

@gabriele-wolfox

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Contact Details

No response

Version

1.26 (latest patch)

What version of Kubernetes are you using?

1.33

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

YAML manifest

What happened?

Looks like the annotation skipEmptyWalArchiveCheck is not working when applying a manifest for restoring a cluster via Barman Cloud Plugin.
So that, the recovery job fails, showing an error it was expecting an empty archive, and the recovery cluster is not created.

The same manifest is working if we chenge back to the old Barman in-tree configuration.

Cluster resource

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. dosubot commented on Aug 1, 2025

    @dosubot

    This is a known limitation: the skipEmptyWalArchiveCheck annotation is not reliably supported when recovering a cluster via the Barman Cloud Plugin. The root cause is how CloudNativePG and Kubernetes handle bootstrap methods and annotation propagation—if your cluster was created without an explicit bootstrap section, the operator defaults to initdb, which can block switching to recovery and prevent the annotation from taking effect due to validation conflicts. This is not a bug in the plugin itself, but a side effect of Kubernetes defaulting and webhook logic, and maintainers have acknowledged it is confusing for users [cloudnative-pg#8136].

    There is no official documentation or release note that directly addresses this annotation’s behavior with the plugin. As a workaround, you can ensure the storage bucket is empty before recovery, or set a different server name in the barmanObjectStore section to use a new storage path (making the bucket effectively empty for the recovery process). Skipping the empty WAL archive check is not recommended, as it can lead to severe data loss [cloudnative-pg#7344].

    If you need to switch bootstrap methods, you must explicitly remove the defaulted initdb section using kubectl edit or kubectl patch, or start with an explicit initdb in your original manifest before switching to recovery [cloudnative-pg#8136].

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about cloudnative-pg with Dosu Add Dosu to your team

  2. omsuneri commented on Aug 1, 2025

    @omsuneri
    Contributor

    @gabriele-wolfox please review the changes in #8216

  3. self-assigned this
    on Aug 1, 2025
  4. gbartolini commented on Aug 7, 2025

    @gbartolini
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions