Bug 41359 - There is no warning when Bcrypt settings are invalid
Summary: There is no warning when Bcrypt settings are invalid
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-02 16:45 UTC by Nick Clemens (kidclamp)
Modified: 2025-12-03 21:51 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This adds a warning to the system information section in the about Koha pages when the Bcrypt settings are invalid (More > About Koha > System information, Bcrypt is a setting used in the Koha instance's koha-conf.xml file when the Pseudonymization system preference is enabled).
Version(s) released in:
Circulation function:


Attachments
Bug 41359: Add a test/warning for Bcrypt settings to the about page (4.96 KB, patch)
2025-12-02 16:50 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 41359: Add a test/warning for Bcrypt settings to the about page (5.01 KB, patch)
2025-12-03 21:45 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-12-02 16:45:43 UTC
To recreate:
1 - Add a line to koha-conf, or replace existing entry:
    <bcrypt_settings>FALSE</bcrypt_settings>
2 - Enable system preferences for Pseudonymization:
    Pseudonimization: Enable
    PseudonymizationPatronFields: All selected
    PseudonymizationTransactionFields: All selected
3 - Checkout an item to a patron
4 - Check Administration->Jobs->Manage Jobs
5 - Note failed job for Pseudonymization
6 - Check the worker log:
    /var/log/koha/kohadev/worker-output.log
    [2025/12/02 16:25:23] [WARN] Uncaught exception processing job id=12: bad base64 encoding at /kohadevbox/koha/Koha/PseudonymizedTransaction.pm line 175.
Comment 1 Nick Clemens (kidclamp) 2025-12-02 16:50:24 UTC
Created attachment 190086 [details] [review]
Bug 41359: Add a test/warning for Bcrypt settings to the about page

This patch adds a simple test of the bcrypt settings to ensure that
pseudonymization will work

To recreate:
1 - Add a line to koha-conf, or replace existing entry:
    <bcrypt_settings>FALSE</bcrypt_settings>
2 - Enable system preferences for Pseudonymization:
    Pseudonimization: Enable
    PseudonymizationPatronFields: All selected
    PseudonymizationTransactionFields: All selected
3 - Checkout an item to a patron
4 - Check Administration->Jobs->Manage Jobs
5 - Note failed job for Pseudonymization
6 - Check the worker log:
    /var/log/koha/kohadev/worker-output.log
    [2025/12/02 16:25:23] [WARN] Uncaught exception processing job id=12: bad base64 encoding at /kohadevbox/koha/Koha/PseudonymizedTransaction.pm line 175.
7 - Check about page - no warning
8 - Apply patch, restart all
9 - Check about page, now there is a warn!
10 - Add a valid entry, you can generate using the code on bug 28911:
    htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
11 - Restart all
12 - Confirm the warning is gone!
Comment 2 David Nind 2025-12-03 21:45:16 UTC
Created attachment 190134 [details] [review]
Bug 41359: Add a test/warning for Bcrypt settings to the about page

This patch adds a simple test of the bcrypt settings to ensure that
pseudonymization will work

To recreate:
1 - Add a line to koha-conf, or replace existing entry:
    <bcrypt_settings>FALSE</bcrypt_settings>
2 - Enable system preferences for Pseudonymization:
    Pseudonimization: Enable
    PseudonymizationPatronFields: All selected
    PseudonymizationTransactionFields: All selected
3 - Checkout an item to a patron
4 - Check Administration->Jobs->Manage Jobs
5 - Note failed job for Pseudonymization
6 - Check the worker log:
    /var/log/koha/kohadev/worker-output.log
    [2025/12/02 16:25:23] [WARN] Uncaught exception processing job id=12: bad base64 encoding at /kohadevbox/koha/Koha/PseudonymizedTransaction.pm line 175.
7 - Check about page - no warning
8 - Apply patch, restart all
9 - Check about page, now there is a warn!
10 - Add a valid entry, you can generate using the code on bug 28911:
    htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
11 - Restart all
12 - Confirm the warning is gone!

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-12-03 21:51:47 UTC
After the patch, I did notice on the jobs page that even though the job is finished, the progress is shown as 0/1.