Skip to content

fix(backups): move pgBackRest log-level-stderr to its config file - #1898

Merged
marceloneppel merged 1 commit into
canonical:16/edgefrom
xhon-pelushi:fix/1767-pgbackrest-log-level-stderr-config
Aug 31, 2026
Merged

fix(backups): move pgBackRest log-level-stderr to its config file#1898
marceloneppel merged 1 commit into
canonical:16/edgefrom
xhon-pelushi:fix/1767-pgbackrest-log-level-stderr-config

Conversation

@xhon-pelushi

Copy link
Copy Markdown

Fixes #1767

--log-level-stderr=warn was passed as a CLI flag on almost every
pgBackRest invocation individually. Set it once in pgbackrest.conf.j2
instead, so it applies consistently to any command that loads this
config, without repeating it at every call site.

_is_primary_pgbackrest_service_running's server-ping health check
doesn't pass --config, so it never reads pgbackrest.conf — it keeps
the explicit --log-level-stderr=warn flag so its logging behavior
isn't silently dropped.

Mirrors the equivalent change already open on main/14-edge
(#1750, for #1353, discussion_r2622432819) — this ports it to 16/edge,
which hadn't picked it up yet.

Test plan

  • tox run -e unit — 222 passed, 0 failed (full suite, not just the
    touched tests).
  • tox run -e lint (poetry check --lock, codespell, ruff check, ruff format --check) — clean on the changed files.
  • poetry run ty check — all checks passed.

@xhon-pelushi
xhon-pelushi requested a review from a team as a code owner August 15, 2026 22:32
@marceloneppel marceloneppel added the bug Something isn't working as expected label Aug 18, 2026
@marceloneppel

Copy link
Copy Markdown
Member

Thanks for the contribution, @xhon-pelushi! Could you address the following requirement?

Commits must have verified signatures.

@xhon-pelushi

Copy link
Copy Markdown
Author

Thanks @marceloneppel — understood on the signature requirement. The single commit on this branch (1cb4f40) is currently verified=false, reason=unsigned, so I'll set up commit signing and re-push the branch signed. Since that's a history rewrite rather than a new commit, shout if you'd rather I opened a fresh PR instead of force-pushing this one.

While I was here: the one red check is stale rather than a real failure, and I think it just needs a re-run. Check pull request failed with

ValueError: Pull request must have 'bug', 'enhancement', or 'not bug or enhancement' label
in order to generate release notes

but that job completed at 2026-08-18T19:45:37Z and you applied the bug label at 2026-08-18T19:45:50Z — thirteen seconds later. The label is on the PR now, so nothing needs changing on my side for that one.

@marceloneppel

Copy link
Copy Markdown
Member

Thanks @marceloneppel — understood on the signature requirement. The single commit on this branch (1cb4f40) is currently verified=false, reason=unsigned, so I'll set up commit signing and re-push the branch signed. Since that's a history rewrite rather than a new commit, shout if you'd rather I opened a fresh PR instead of force-pushing this one.

@xhon-pelushi, you can force-push this PR.

--log-level-stderr=warn was being passed as a CLI flag on almost every
pgBackRest invocation individually (info, repo-ls, stanza-create,
check, backup). Set it once in pgbackrest.conf.j2 instead, so it
applies consistently to any command that loads this config without
needing to be repeated at every call site.

The server-ping health check in _is_primary_pgbackrest_service_running
doesn't pass --config, so it doesn't read pgbackrest.conf - it keeps
the explicit --log-level-stderr=warn flag to preserve its current
logging behavior.

Mirrors the equivalent change already applied on main/14-edge
(canonical#1320, discussion_r2622432819) for the
16/edge branch, per canonical#1353.

Fixes canonical#1767

Signed-off-by: xhon-pelushi <xhon@pelushi.com>
@xhon-pelushi
xhon-pelushi force-pushed the fix/1767-pgbackrest-log-level-stderr-config branch from 1cb4f40 to 3ec256d Compare August 28, 2026 12:46
@xhon-pelushi

Copy link
Copy Markdown
Author

Force-pushed as requested — the branch is now 3ec256dd2095eb7b58278a04b7fa69b3fffde71e and GitHub reports the commit as verified: true / reason: valid.

The tree is unchanged from 1cb4f40f87: git diff 1cb4f40f87 HEAD is empty and both point at tree 7745b394023866ce48d8d1c5533d90a653979bc9, so this is purely the signature being added — no content moved.

Also still true from my last comment: the one red Check pull request run is stale. It failed asking for a bug/enhancement label thirteen seconds before you applied the bug label, so it should go green on a re-run.

@xhon-pelushi

Copy link
Copy Markdown
Author

Heads-up on the red Tests run against the re-signed head — I don't think it's this PR.

The force-push only attached a signature. Both commits point at the same tree, 7745b394023866ce48d8d1c5533d90a653979bc9, and git diff 1cb4f40f87 3ec256dd20 is empty, so the content CI ran on is byte-identical to the content that went green on 2026-08-15.

The suite looks broken repo-wide rather than branch-specific:

Branch Latest Tests
main failure (2026-08-28T02:22)
16/edge failure (2026-08-28T03:37, and every scheduled run back to 08-20)
dpe-10203-dead-dc-recovery-test failure
dpe-10203-async-replication-recovery failure
renovate/main-major-github-actions failure
this PR failure

The failures are also upstream of anything this change touches — test_config.py dies with

[postgresql/0] status changed: maintenance (installing PostgreSQL) -> error (hook failed: "install")
jubilant._juju.WaitError: error function any_error returned true

i.e. the install hook, before pgbackrest.conf is rendered or read. This PR only moves --log-level-stderr=warn off the pgBackRest command lines and into that config file, so it cannot affect charm installation.

Happy to rebase onto a green 16/edge once the suite recovers if that would help confirm.

@marceloneppel

Copy link
Copy Markdown
Member

@xhon-pelushi, I'll debug the failures and update here.

@marceloneppel
marceloneppel merged commit 3ed862c into canonical:16/edge Aug 31, 2026
499 of 521 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move --log-level-stderr=warn to pgBackRest's configuration file for 16/edge

3 participants