[Bug 24272] New: Add a command line script to compare the syspref cache to the database
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Bug ID: 24272 Summary: Add a command line script to compare the syspref cache to the database Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: nick@bywatersolutions.com Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 96467 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96467&action=edit Bug 24272: add check_sysprefs_cache.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Roberts <david.roberts@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.roberts@ptfs-europe.c | |om --- Comment #2 from David Roberts <david.roberts@ptfs-europe.com> --- If you can tell me what you needs to be tested, I'll be happy to try to sign this one off for you. :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- I tried to test in koha-testing-docker this by: 1. Applying the patch. 2. Changed the ownership to kohadev-koha (chown kohadev-koha:kohadev-koha check_syspref_cache.pl) and permissions (chmod 755 check_syspref_cache.pl). 3. Running the script: perl misc/maintenance/check_syspref_cache.pl I received this message: Global symbol "$syspref_cache" requires explicit package name (did you forget to declare "my $syspref_cache"?) at misc/maintenance/check_syspref_cache.pl line 40. Execution of misc/maintenance/check_syspref_cache.pl aborted due to compilation errors. I don't know how system preferences are cached and to check for differences between those and what is in the database. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96467|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 113135 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113135&action=edit Bug 24272: add check_sysprefs_cache.pl This script ensure that no sysprefs have been changed directly in the database and/or that the cache has not become corrupted. We have occasionally seen this happen on production sites To test: 1 - In the staff interface go to Administration 2 - Search for system preference 'IntranetUserJS' 3 - Add content to the syspref: console.log('Hi!'); 4 - On the command line launch mysql sudo koha-mysql kohadev 5 - Alter the syspref directly UPDATE systempreferences SET value = "console.log('Bye!');" WHERE variable = 'IntranetUserJS'; 6 - run the script perl misc/maintenance/check_syspref_cache.pl 7 - You are warned about the altered system preference -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113135|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 113193 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113193&action=edit Bug 24272: add check_sysprefs_cache.pl This script ensure that no sysprefs have been changed directly in the database and/or that the cache has not become corrupted. We have occasionally seen this happen on production sites To test: 1 - In the staff interface go to Administration 2 - Search for system preference 'IntranetUserJS' 3 - Add content to the syspref: console.log('Hi!'); 4 - On the command line launch mysql sudo koha-mysql kohadev 5 - Alter the syspref directly UPDATE systempreferences SET value = "console.log('Bye!');" WHERE variable = 'IntranetUserJS'; 6 - run the script perl misc/maintenance/check_syspref_cache.pl 7 - You are warned about the altered system preference Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #6 from David Nind <david@davidnind.com> --- Thanks Nick! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #113193|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 115029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115029&action=edit Bug 24272: add check_sysprefs_cache.pl This script ensure that no sysprefs have been changed directly in the database and/or that the cache has not become corrupted. We have occasionally seen this happen on production sites To test: 1 - In the staff interface go to Administration 2 - Search for system preference 'IntranetUserJS' 3 - Add content to the syspref: console.log('Hi!'); 4 - On the command line launch mysql sudo koha-mysql kohadev 5 - Alter the syspref directly UPDATE systempreferences SET value = "console.log('Bye!');" WHERE variable = 'IntranetUserJS'; 6 - run the script perl misc/maintenance/check_syspref_cache.pl 7 - You are warned about the altered system preference Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I can see this one being pretty helpful.. not sure where we should document it to make it clear it exists. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Cannot push, release notes needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- + next unless $cached_var; Are you sure? We need to tell if 0 or '' are different values from the DB. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 115192 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115192&action=edit Bug 24272: (follow-up) Test defined not true -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This script checks the release notes| |value of the systemp | |preferences in the database | |against those in the cache. | |Generally differences will | |only exist if changes have | |been made directly to the | |DB or the cache has become | |corrupted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115412&action=edit Bug 24272: Use Pod2Usage and surround values with '' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115413&action=edit Bug 24272: Correctly encode output to prevent 'Wide character in say' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This script checks the |This script checks the release notes|value of the systemp |value of the system |preferences in the database |preferences in the database |against those in the cache. |against those in the cache. |Generally differences will |Generally differences will |only exist if changes have |only exist if changes have |been made directly to the |been made directly to the |DB or the cache has become |DB or the cache has become |corrupted. |corrupted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|21.05.00 |21.05.00,20.11.03 released in| | --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Since it is a standalone script there is no risk in backporting. Pushed to 20.11.x for 20.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00,20.11.03 |21.05.00,20.11.03,20.05.09 released in| | CC| |andrew@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Backporting standalone script to 20.05.x for 20.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable CC| |victor@tuxayo.net Version(s)|21.05.00,20.11.03,20.05.09 |21.05.00,20.11.03,20.05.09, released in| |19.11.15 --- Comment #17 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 19.11.x branch for 19.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24272 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org