[Bug 19760] New: Die instead of warn if koha-conf is not accessible
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Bug ID: 19760 Summary: Die instead of warn if koha-conf is not accessible Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org We got a lot of support questions because scripts are executed without the correct environment/user. We could die and provide more useful information -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 69568 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69568&action=edit Bug 19760: Die if koha-conf is not accessible We got a lot of support questions because scripts are executed without the correct environment/user. We could die and provide more useful information -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Jon Knight <J.P.Knight@lboro.ac.uk> 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=19760 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69568|0 |1 is obsolete| | --- Comment #2 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 69571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=69571&action=edit Bug 19760: Die if koha-conf is not accessible We got a lot of support questions because scripts are executed without the correct environment/user. We could die and provide more useful information Tested on my kohadevbox VM by: 1) sudo chmod a-rx /etc/koha/sites/kohadev/koha-conf.xml 2) run help.pl from the command line to produce the desired die message 3) sudo chmod a+rx /etc/koha/sites/kohadev/koha-conf.xml 4) rerun help.pl successfully Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- I'm not sure about the message, should we recommend a tool that is only available on Debian package installs ? Also, there is a strange behaviour (not caused by this patch), when KOHA_CONF is empty or does not contain a valid/existing filename, it is just defaulted to /etc/koha/koha-conf.xml (if it exists). So, on my dev install, I can run `KOHA_CONF=/not/existing perl help.pl` and it uses /etc/koha/koha-conf.xml without warning -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Changing status to In Discussion to get answers to comment 3 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Julian Maurice from comment #3)
I'm not sure about the message, should we recommend a tool that is only available on Debian package installs ?
It is the common mistake people does when they use kohadevbox, so they will have access to koha-shell. What do you suggest?
Also, there is a strange behaviour (not caused by this patch), when KOHA_CONF is empty or does not contain a valid/existing filename, it is just defaulted to /etc/koha/koha-conf.xml (if it exists). So, on my dev install, I can run `KOHA_CONF=/not/existing perl help.pl` and it uses /etc/koha/koha-conf.xml without warning
Yes we should add a warning instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #5)
It is the common mistake people does when they use kohadevbox, so they will have access to koha-shell. What do you suggest? I'm not sure, I just don't like how Koha is being more and more coupled with Debian. I won't have time to think about another solution for the next two weeks and I don't want to block this bug, so I'm resetting the status to Signed Off. @QAers, feel free to take this one.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We could just add something like: If you are using a debian-based system you can use the koha-shell command otherwise you should check your permissions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #7)
We could just add something like: If you are using a debian-based system you can use the koha-shell command otherwise you should check your permissions.
Maybe "Try running this again as the koha instance user (or use the koha-shell command in debian)" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 70014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70014&action=edit Bug 19760: Change wording -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jon Knight from comment #2)
3) sudo chmod a+rx /etc/koha/sites/kohadev/koha-conf.xml
chmod 640 might be better ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA 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=19760 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #69571|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 70116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70116&action=edit Bug 19760: Die if koha-conf is not accessible We got a lot of support questions because scripts are executed without the correct environment/user. We could die and provide more useful information Tested on my kohadevbox VM by: 1) sudo chmod a-rx /etc/koha/sites/kohadev/koha-conf.xml 2) run help.pl from the command line to produce the desired die message 3) sudo chmod a+rx /etc/koha/sites/kohadev/koha-conf.xml 4) rerun help.pl successfully Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70014|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 70117 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70117&action=edit Bug 19760: Change wording Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.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=19760 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 70135 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70135&action=edit Bug 19760: Fix Config.t test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Last patch 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=19760 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all, pushed to stable for 17.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19760 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #17 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x for v17.05.08 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org