[Bug 25284] New: Can't open /var/log/koha/kohadev/opac-error.log (Permission denied)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Bug ID: 25284 Summary: Can't open /var/log/koha/kohadev/opac-error.log (Permission denied) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Transaction logs Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org I have completely rebuilt my kohadevbox, but can't get rid of this error: Can't open /var/log/koha/kohadev/opac-error.log (Permission denied) at /usr/share/perl5/Log/Log4perl/Appender/File.pm line 143 First it appeared when I was trying to save system preferences. Now I ran into it, when trying to check out an item. I have no idea what's causing this and if this is a general or a kohadevbox issue. Help appreciated! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |25172 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25172 [Bug 25172] Koha::Logger init is failing silently -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |blocker -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Bug 25172 made a permissions problem raise an error instead of just not working. With this we can now test this situations and fix them properly. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- So far it has broken 2 main features for me: checkout and saving system preferences. I am continuing my QA work without those patches right now, because I can't otherwise. I am not sure if we should not push these fixes after the release? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Transaction logs |Installation and upgrade | |(command-line installer) CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kyle@bywatersolutions.com, | |m.de.rooy@rijksmuseum.nl, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- We fixed it manually in koha-testing-docker by setting the right permissions. You should do the same in kohadevbox so it is back to functional and you can test things. No worries about this, we will solve it before the release, and I will set a pipeline for testing this on normal packages install (i.e. build a package, install it, and check the generated permissions. Probably on monday. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #3)
We fixed it manually in koha-testing-docker by setting the right permissions. You should do the same in kohadevbox so it is back to functional and you can test things. No worries about this, we will solve it before the release, and I will set a pipeline for testing this on normal packages install (i.e. build a package, install it, and check the generated permissions. Probably on monday.
So how do I fix the permissions on the kohadevbox? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- $ koha-plack --stop kohadev $ chown -R kohadev-koha:kohadev-koha /var/log/Koha/kohadev/* -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #5)
$ koha-plack --stop kohadev $ chown -R kohadev-koha:kohadev-koha /var/log/Koha/kohadev/*
$ sudo koha-plack --stop kohadev $ sudo chown -R kohadev-koha:kohadev-koha /var/log/koha/kohadev/* Just a tiny fix in the path and it did the trick, thx! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Should we close this? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #3)
We fixed it manually in koha-testing-docker by setting the right permissions. You should do the same in kohadevbox so it is back to functional and you can test things. No worries about this, we will solve it before the release, and I will set a pipeline for testing this on normal packages install (i.e. build a package, install it, and check the generated permissions. Probably on monday.
From Tomas comment it sounds like there is still ab it more work needed.
-- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #8)
(In reply to Tomás Cohen Arazi from comment #3)
We fixed it manually in koha-testing-docker by setting the right permissions. You should do the same in kohadevbox so it is back to functional and you can test things. No worries about this, we will solve it before the release, and I will set a pipeline for testing this on normal packages install (i.e. build a package, install it, and check the generated permissions. Probably on monday.
From Tomas comment it sounds like there is still ab it more work needed.
I'm building a master package at the moment, to try see if this is specific to our dev tools, or if it poses a real issue on production. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Any news from this, Tomasito? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25529 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25529 [Bug 25529] [OMNIBUS] 20.05 debian packages -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 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=25284 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105086 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105086&action=edit Bug 25284: chown /var/log/koha log files on koha-create To prevent Apache to create intranet-error.log and opac-error.log with root permission we chown them after it has been restarted (and so created them) when a new Koha instance is created -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- What happens at log rotation ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #12)
What happens at log rotation ?
Good question. It is set to copytruncate so permissions should be always kept. I tried by manually forcing rotation and the expected results show up. Had to run $ logrotate -f /etc/logrotate.d/koha-common But removing weekly to force it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Is this plan correct? - spin up a KohaDevBox on master - try to do a checkout and save a system preference - error: Can't open /var/log/koha/kohadev/opac-error.log (Permission denied) - throw the KohaDevBox away - apply patch - spin up a KohaDevBox - try to do a checkout and save a system preference - no error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Victor Grousset/tuxayo from comment #14)
Is this plan correct?
- spin up a KohaDevBox on master - try to do a checkout and save a system preference - error: Can't open /var/log/koha/kohadev/opac-error.log (Permission denied) - throw the KohaDevBox away - apply patch - spin up a KohaDevBox - try to do a checkout and save a system preference - no error
1. Create a new instance: $ koha-create --create-db test => FAIL: opac and intranet logs are owned by root 2. Apply this patch 3. Reset all, so it runs cp_debian_files.pl 4. Repeat 1, with another name => SUCCESS: logs are owned by the right user -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #16 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Without any patch. Went into my DevBox. Tried to create an instance. No issues :o
vagrant@kohadevbox:~$ sudo su - root@kohadevbox:~# koha-create --create-db test Koha instance is empty, no staff user created. [ ok ] Starting Koha indexing daemon for test:.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- My steps to reproduce: $ mkdir stretch ; cd stretch $ vagrant init debian/stretch64 $ vagrant up $ vagrant ssh root@stretch:~# apt update ; apt install wget gnupg root@stretch:~# echo 'deb http://debian.koha-community.org/koha 19.11 main' > /etc/apt/sources.list.d/koha.list root@stretch:~# wget -q -O- https://debian.koha-community.org/koha/gpg.asc | apt-key add - root@stretch:~# apt update root@stretch:~# ls /var/log alternatives.log apache2 apt auth.log btmp daemon.log debug dpkg.log exim4 faillog fontconfig.log installer kern.log lastlog messages mysql syslog user.log wtmp root@stretch:~# apt install koha-common Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: letsencrypt The following NEW packages will be installed: koha-common 0 upgraded, 1 newly installed, 0 to remove and 72 not upgraded. Need to get 0 B/32.1 MB of archives. After this operation, 468 MB of additional disk space will be used. Preconfiguring packages ... Selecting previously unselected package koha-common. (Reading database ... 58880 files and directories currently installed.) Preparing to unpack .../koha-common_19.11.05-1_all.deb ... Unpacking koha-common (19.11.05-1) ... Processing triggers for systemd (232-25+deb9u8) ... Setting up koha-common (19.11.05-1) ... Processing triggers for man-db (2.7.6.1-2) ... Processing triggers for systemd (232-25+deb9u8) ... root@stretch:~# koha-create --create-db t_e_s_t Koha instance is empty, no staff user created. [ ok ] Starting Koha indexing daemon for t_e_s_t:. root@stretch:~# ls -l /var/log/koha/t_e_s_t/ total 4 -rw-r--r-- 1 t_e_s_t-koha t_e_s_t-koha 0 May 19 21:54 indexer-error.log -rw-r--r-- 1 t_e_s_t-koha t_e_s_t-koha 2380 May 19 21:54 indexer-output.log -rw-r--r-- 1 root root 0 May 19 21:54 intranet-error.log -rw-r--r-- 1 root root 0 May 19 21:54 opac-error.log -rw-r--r-- 1 t_e_s_t-koha t_e_s_t-koha 0 May 19 21:54 zebra-error.log -rw-r--r-- 1 t_e_s_t-koha t_e_s_t-koha 0 May 19 21:54 zebra-output.log root@stretch:~# To test: 1. Built a package with the patch 2. Installed it (I really had it previously created and on the 'stretch' directory so the deb files were in /vagrant inside the box 3. Created a new instance => SUCCESS: The permissiosn are correct -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I stripped from those steps the install of mysql-server and some issue I had with mpm_itk between retries. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Tomás Cohen Arazi <tomascohen@gmail.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=25284 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105086|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 105124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105124&action=edit Bug 25284: chown /var/log/koha log files on koha-create To prevent Apache to create intranet-error.log and opac-error.log with root permission we chown them after it has been restarted (and so created them) when a new Koha instance is created Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 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=25284 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105124|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 105137 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105137&action=edit Bug 25284: chown /var/log/koha log files on koha-create To prevent Apache to create intranet-error.log and opac-error.log with root permission we chown them after it has been restarted (and so created them) when a new Koha instance is created Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=25284 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks guys.. A little playing later and I'm PQAing this too.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.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=25284 --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #23 from Joy Nelson <joy@bywatersolutions.com> --- missing dependency no backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There are users on the ML reporting such problems on upgrade. Should we deal with that somewhere else. Like in koha-common.postinst? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There is _check_and_fix_perms in koha-plack to fix plack.log and plack-error.log. But that does not seem the right place. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #26 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #25)
There is _check_and_fix_perms in koha-plack to fix plack.log and plack-error.log. But that does not seem the right place.
koha-common.postinst -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25693 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- See bug 25693. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25693 [Bug 25693] Correct permissions must be set on logdir after an upgrade -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #28 from David Cook <dcook@prosentient.com.au> --- We've been having this issue again lately in 20.11... I'm going to keep my eye on it. Ahh I talked about this a bit on Bug 16357, but I never followed through. The real fix is to do the following change. FROM: log4perl.appender.INTRANET=Log::Log4perl::Appender::File log4perl.appender.INTRANET.filename=__LOG_DIR__/intranet-error.log log4perl.appender.OPAC=Log::Log4perl::Appender::File log4perl.appender.OPAC.filename=__LOG_DIR__/opac-error.log TO: log4perl.appender.INTRANET=Log::Log4perl::Appender::Screen log4perl.appender.INTRANET.stderr = 1 log4perl.appender.OPAC=Log::Log4perl::Appender::Screen log4perl.appender.OPAC.stderr = 1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 --- Comment #29 from David Cook <dcook@prosentient.com.au> --- Actually I don't think that's right after all. I think it would cause some issues for Plack as I note in Bug 28477... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28477 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41337 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org