Created attachment 171845 [details] intranet-error.log Error "Internal Server Error" is raised/shown on screen when one tries to upload local cover image in a new (migrated to a new server) koha installation. Relevant log contents attached.
Created attachment 171846 [details] plack-intranet-error.log
Created attachment 171868 [details] intranet-error.log
Created attachment 171869 [details] plack-intranet-error.log
Created attachment 172243 [details] intranet-access.log
Created attachment 172244 [details] intranet-error.log
Created attachment 172245 [details] plack.log
Created attachment 172246 [details] plack-intranet-error.log
I noticed multiple error lines mentioning Middleware/CSRF.pm in error logs. Having disabled Plack, error no longer appears.
I'm not going to review these logs, but this issue does sound familiar. I may have fixed this locally. I've got a big backlog after being away from work for a while, but keeping this one on my radar.
> Middleware/CSRF.pm in error logs. The timestamps of the errors don't seem relevant. It might just a bot/crawler scanning webserver and having found your koha instance and making these weird CONNECT request. That are blocked early and verbosely since Bug 36863 Anyway, the suspicious things might rather be these > [Tue Oct 01 09:00:17.923588 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $name in index at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 42., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.924077 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $name in index at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 42., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.924283 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $name in pattern match (m//) at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 45., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.924477 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $name in hash element at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 45., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.924693 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $pkg in concatenation (.) or string at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 53., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.924937 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: Use of uninitialized value $name in concatenation (.) or string at /usr/lib/x86_64-linux-gnu/perl-base/Symbol.pm line 53., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:17.925119 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: not found: No such file or directory at /usr/lib/x86_64-linux-gnu/perl5/5.36/GD/Image.pm line 100., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image > [Tue Oct 01 09:00:18.057414 2024] [cgi:error] [pid 3494:tid 3494] [client 192.168.1.254:58900] End of script output before headers: upload-cover-image.pl, referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image Some missing config about the directory path for uploads? In my koha-conf.xml i have <upload_path>/var/lib/koha/kohadev/uploads</upload_path> And switching from an old install without plack (if that's what happened) might lead to a different koha-conf.xml used and a wrong value for <upload_path> In a Debian or Ubuntu Koha install via packages, I thing it's supposed to be in /etc/koha/sites/MY_KOHA_INSTANCE_NAME/koha-conf.xml
Thank you Victor, I had already added the entry in koha-conf.xml, and it points to a directory fully accessible by all, so this may not be the cause of the error. MP
Come to think of it though, it is an example of sloppy programming to introduce new stanzas in koha-conf.xml and not update existing installations with sane values of the newly introduced entries upon update.
(In reply to Manos PETRIDIS from comment #12) > Come to think of it though, it is an example of sloppy programming to > introduce new stanzas in koha-conf.xml and not update existing installations > with sane values of the newly introduced entries upon update. Do you want to provide a patch?
Funny thing, cover uploads worked just fine in my "old" koha installation before this new stanza was introduced. Do you want to provide an improved QA procedure?
(In reply to Manos PETRIDIS from comment #12) > Come to think of it though, it is an example of sloppy programming to > introduce new stanzas in koha-conf.xml and not update existing installations > with sane values of the newly introduced entries upon update. (In reply to Manos PETRIDIS from comment #14) > Funny thing, cover uploads worked just fine in my "old" koha installation > before this new stanza was introduced. Do you want to provide an improved QA > procedure? I'm not sure that being rude to people who volunteer their valuable time to develop and support Koha is the best way to get people to help you. We already know that out-dated koha-conf.xml on upgraded installations is a problem. Consider bug 31059. If you can provide an idea for how to upgrade koha-conf.xml (or a related alternative) in a sensible and safe way during upgrade, feel free to add a comment on that bug report.
I've just tried uploading a local cover image in koha-testing-docker, and it's working fine. Given that and the lack of a test plan to reliably reproduce the error, I'm going to close this one. This sounds like a support problem. Consider one of the support options listed on https://koha-community.org/support/
What you're saying is: if it works in new installations, everything is fine. As if there are no previously existing koha installations. I know that being rude to people who volunteer their valuable time to develop and support Koha is not the best way to get people to help me; to help me and the myriad of people that have a running koha installation breaking on them on some odd, undocumented upgrade. I hadn't realised though that asking for better QA is rude. To be frank, my thoughts on been asked to provide a patch were "I may not know how to fix it, I do know however how not to break it in the first place". Can you really blame me? Please also note https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31180
(In reply to Manos PETRIDIS from comment #17) > What you're saying is: if it works in new installations, everything is fine. > As if there are no previously existing koha installations. I know that being > rude to people who volunteer their valuable time to develop and support Koha > is not the best way to get people to help me; to help me and the myriad of > people that have a running koha installation breaking on them on some odd, > undocumented upgrade. > I hadn't realised though that asking for better QA is rude. To be frank, my > thoughts on been asked to provide a patch were "I may not know how to fix > it, I do know however how not to break it in the first place". Can you > really blame me? Please also note > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31180 Nope, that's not what I'm saying. I'm saying that Bugzilla is for reporting bugs and requesting enhancements, but this is more of a support query, so I've provided the options for support. Yes, I can take issue with what you're saying. I'm not going to respond on this report again, as it sounds like we're not communicating well here, but I will take another look at the other one you've linked.
(In reply to Manos PETRIDIS from comment #12) > Come to think of it though, it is an example of sloppy programming to > introduce new stanzas in koha-conf.xml and not update existing installations > with sane values of the newly introduced entries upon update. Missing entries in koha-conf are highlighted on the about page. After an upgrade a good practice is to check the "System information" tab of the about page (as well as running the search_for_inconsistencies.pl maintenance script).
Thanks for the pointers. Might I add though that a) I had visited the "System information" tab of the about page, and already had added the missing entry in koha-conf.xml, as I mentioned in my comment of 2024-10-28 12:32:04 UTC. b) Have just searched for "search_for_inconsistencies.pl" and google comes up with only two finds, both pointing to an IRC log of Jan 30th, 2020. Shouldn't it be mentioned in koha wiki somewhere? c) the problem mentioned in the current bug report persists regardless of this specific koha-conf.xml entry. Furthemore, as already noted in my comment of 2024-10-08 17:43:12 UTC, I noticed multiple error lines mentioning Middleware/CSRF.pm in error logs posted. Having disabled Plack, error no longer appears.
You have a lot of those warnings: Wide character (U+3B5) in substitution (s///) at /usr/lib/x86_64-linux-gnu/perl5/5.36/Template/Filters.pm Does your filename only contain Greek characters? Can you try to rename the file with ASCII chars only? This is the faral error: AH01215: stderr from /usr/share/koha/intranet/cgi-bin/tools/upload-cover-image.pl: not found: No such file or directory at /usr/lib/x86_64-linux-gnu/perl5/5.36/GD/Image.pm line 100., referer: http://intra.atpf.gr:8080/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=3269&filetype=image If still working, do you see the "Wide character" warnings? If so to debug I would add a warn there: Koha/UploadedFile.pm 115 sub file_handle { 116 my ( $self ) = @_; 117 warn $self->full_path;
Also note that here we are using the 'tmp_path' config entry, not 'upload_path'. If not present it will use File::Spec->tmpdir https://metacpan.org/pod/File::Spec#tmpdir