Skip to content

[Bug]: CheckEmptyWalArchive doesn't run with volumesnapshots and CNPG-I plugin restores #9305

Description

@mnencia

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

trunk (main)

What version of Kubernetes are you using?

1.34

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

YAML manifest

What happened?

The CheckEmptyWalArchive feature does not work on volume snapshot restores if using a CNPG-I plugin (e.g., plugin-barman-cloud) for WALS. During restore, the code does not create the CheckEmptyWalArchiveFile file and instead calls the "barman-cloud-check-wal-archive" command directly, but only when using in-tree backup. This direct call is made before the restore begins as an early error detection, but it cannot function when an external plugin is handling the backup. As a result, restore doesn't run the check for setups using external plugins for WAL.

Cluster resource

Relevant log output

Code of Conduct

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

Activity

  1. added theissue type on Nov 24, 2025
  2. added
    bug 🐛
    on Nov 24, 2025
  3. dosubot commented on Nov 24, 2025

    @dosubot

    This is a known limitation with plugin-based restores in CloudNativePG: the CheckEmptyWalArchive feature does not run when using CNPG-I plugins like plugin-barman-cloud. The restore workflow bypasses the creation of the sentinel file and the early WAL archive check, delegating restore logic directly to the plugin, which does not trigger the same safety check as the built-in backup/restore path. This means the empty WAL archive check is not executed, and the annotation cnpg.io/skipEmptyWalArchiveCheck is not reliably supported in plugin-based restore flows due to operator webhook and bootstrap logic. As a result, restores can fail with "Expected empty archive" errors if the archive path is not empty, and skipping the check is not recommended due to the risk of data loss [source].

    Safe workarounds are to ensure the storage bucket/path for restore is empty or to use a unique serverName in your plugin parameters to isolate the restore path [source]. Recent plugin releases have fixed other restore bugs, but do not address this limitation. There is no official documentation or release note directly about this, but maintainers have acknowledged it as confusing for users.

    Let me know if you need help with a specific restore scenario or error log.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about cloudnative-pg Share Dosu with your team

  4. changed the title [-][Bug]: CheckEmptyWalArchive doesn't run with CNPG-I plugin restores[/-] [+][Bug]: CheckEmptyWalArchive doesn't run with volumesnapshots and CNPG-I plugin restores[/+] on Nov 24, 2025
  5. gbartolini commented on Nov 24, 2025

    @gbartolini
    Contributor

    How come it stopped working all of a sudden?

  6. mnencia commented on Nov 24, 2025

    @mnencia
    MemberAuthor

    How come it stopped working all of a sudden?

    The check had never functioned for this specific combination of volume-snapshot and backup plugin. Since it was a safety check, no one realized it wasn't being executed until it became the only operation in the barman-cloud commands that could create the destination when it was missing. This issue is similar to what we resolved in #8895, but it is more challenging to identify because it only affects the CNPG-I plugins, not the in-tree barman-cloud backup.

  7. gbartolini commented on Nov 25, 2025

    @gbartolini
    Contributor

    How come it stopped working all of a sudden?

    The check had never functioned for this specific combination of volume-snapshot and backup plugin. Since it was a safety check, no one realized it wasn't being executed until it became the only operation in the barman-cloud commands that could create the destination when it was missing. This issue is similar to what we resolved in #8895, but it is more challenging to identify because it only affects the CNPG-I plugins, not the in-tree barman-cloud backup.

    So, is this due to the sudden behaviour change introduced by the last version of Barman?

  8. added a commit that references this issue on Nov 27, 2025
    fd2b3cb
  9. added a commit that references this issue on Nov 27, 2025
    01e673d
  10. added 3 commits that reference this issue on Nov 27, 2025
    ac9eaba
    9bb7e23
    832185c
  11. added a commit that references this issue on Jan 20, 2026
    b85b034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐛

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions