Bug 27701 - Can't open __LOG_DIR__/opac-error.log (No such file or directory)
Summary: Can't open __LOG_DIR__/opac-error.log (No such file or directory)
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 20.05
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-14 17:41 UTC by Claudio Costales
Modified: 2021-12-13 21:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
log4perl (2.69 KB, text/plain)
2021-02-14 22:38 UTC, Claudio Costales
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Costales 2021-02-14 17:41:37 UTC
We have a Koha server installed with 5 instances. All instances are set with plack. After upgrading from 19.11 to 20.05 this message is logged:



Error while loading /etc/koha/plack.psgi: Can't open __LOG_DIR__/opac-error.log (No such file or directory) at /usr/share/perl5/Log/Log4perl/Appender/File.pm line 143.


This error (plack-error.log) impacts ONLY ONE INSTANCE that, from this moment on, can't be run anymore under plack (it keeps waiting).

Stopping and disabling plack for that instance resolves the running but setting it in a very slow mode.
Comment 1 David Cook 2021-02-14 22:24:08 UTC
Sounds like a bad log4perl.conf file. 

Can you share the /etc/koha/sites/<instance>/log4perl.conf file for your problematic instance?
Comment 2 Claudio Costales 2021-02-14 22:38:25 UTC
Created attachment 116869 [details]
log4perl
Comment 3 Claudio Costales 2021-02-14 22:39:09 UTC
Hi David! See file attached please. Thanks!
Comment 4 David Cook 2021-02-15 00:57:04 UTC
That is very weird...

If you replace __LOG_DIR__ with /var/log/koha/fbarcelo and run "koha-plack --stop fbarcelo" and "koha-plack --start fbarcelo", you should be fine.

It looks to me like you must have had a bad config file for quite some time, but the upgrade to 20.05 made it more noticeable.
Comment 5 Claudio Costales 2021-02-15 01:10:59 UTC
Thank you so much David! I've made the changes and it works fine again.
Comment 6 David Cook 2021-02-15 03:57:03 UTC
(In reply to Claudio from comment #5)
> Thank you so much David! I've made the changes and it works fine again.

That's great to hear.

I'll close this one for now, but I'll be keeping my eyes open for similar reports...
Comment 7 Magnus Enger 2021-02-15 08:50:32 UTC
(In reply to David Cook from comment #6)
> I'll close this one for now, but I'll be keeping my eyes open for similar
> reports...

I have seen this too. On a server with lots of instances, one of them had this problem. I must confess I fixed it without investigating further. 

This should reveal any instances that have this problem: 

 $ sudo grep "__LOG_DIR__" /etc/koha/sites/*/log4perl.conf
Comment 8 David Cook 2021-02-15 22:05:59 UTC
(In reply to Magnus Enger from comment #7)
> I have seen this too. On a server with lots of instances, one of them had
> this problem. I must confess I fixed it without investigating further. 

Good to know!

Based on the error, my guess is that there must've been a bug in the past that made the log4perl.conf not get generated correctly, but it went unnoticed. So in theory it shouldn't affect anyone that wasn't affected by that bug, but it's tough to know who is affected without checking everyone.

That said... maybe it is worth writing some kind of patch to look for and fix this problem...