Skip to content

fix: downgrade decrypt failure log from warn to info#13324

Merged
nic-6443 merged 2 commits intoapache:masterfrom
nic-6443:fix/decrypt-log-level
Apr 30, 2026
Merged

fix: downgrade decrypt failure log from warn to info#13324
nic-6443 merged 2 commits intoapache:masterfrom
nic-6443:fix/decrypt-log-level

Conversation

@nic-6443
Copy link
Copy Markdown
Member

During upgrades, when new fields are added to encrypt_fields, existing plaintext data in etcd will fail to decrypt. This is a normal and expected scenario — the plaintext value is preserved as-is and still works. However, the warn-level log generates noise that may alarm users.

This change:

  • Downgrades decrypt failure log from warn to info
  • Keeps encrypt failure log at warn (those are unexpected)
  • Adds a hint message explaining the likely cause (upgrade) and resolution (re-save via Admin API)

Before:

[warn] failed to decrypt the conf of plugin [basic-auth] key [password], err: decrypt ssl key failed

After:

[info] failed to decrypt the conf of plugin [basic-auth] key [password], err: decrypt ssl key failed. This is expected after upgrading if the field was recently added to encrypt_fields; re-save the configuration via the Admin API to resolve

Copilot AI review requested due to automatic review settings April 30, 2026 09:34
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts APISIX plugin configuration encryption/decryption logging to reduce expected log noise during upgrades when encrypt_fields changes, while still highlighting unexpected encryption failures.

Changes:

  • Downgrades decrypt failure logs from warn to info.
  • Appends an upgrade/resolution hint to decrypt failure logs.
  • Keeps encrypt failure logs at warn.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apisix/plugin.lua Outdated
During upgrades, when new fields are added to encrypt_fields, existing
plaintext data in etcd will fail to decrypt. This is a normal and expected
scenario, but the warn-level log generates noise that may alarm users.

Downgrade the log level from warn to info for decrypt operations and add
a hint message suggesting users re-save the configuration via Admin API
to encrypt the plaintext values.
@nic-6443 nic-6443 force-pushed the fix/decrypt-log-level branch from fddf305 to 20c200b Compare April 30, 2026 09:37
Use 'This can happen' instead of 'This is expected' and add a note
about verifying the data_encryption keyring for genuine failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member Author

@nic-6443 nic-6443 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in de7b7c8 — updated the hint wording to use "This can happen after upgrading..." instead of "This is expected..." and added a note about verifying the data_encryption keyring for genuine decryption failures.

@nic-6443 nic-6443 merged commit f1018cc into apache:master Apr 30, 2026
18 of 19 checks passed
@nic-6443 nic-6443 deleted the fix/decrypt-log-level branch April 30, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants