When uploading a zipped file of patron images an Error 500 message displays on screen at cgi-bin/koha/tools/picture-upload.pl. The error displays regardless of whether the upload was successful or not and means that the user does not see the expected confirmation message.
Hi Lucy, Which exact version of Koha are you using? Do you have access to the logs on the server?
Version 17.11.03 and I do have access to server logs
Which error related to this problem do you see in the logs?
Similar error faced by me and some other users also in past, See: https://lists.katipo.co.nz/public/koha/2017-July/048523.html I think this error comes after a security update of apache web server: https://serverfault.com/questions/853103/500-internal-server-ah02429-response-header-name
Lucy, which version of Apache are you using?
Hi Jonathan, thanks for taking a look. I've re-tested but can't reproduce the error on the 17.11.03 site. However, I do still get the error for another site where this was reported: Version 16.11.03 Apache/2.4.10 (Debian) Error logged as: [Tue May 08 11:46:42.647237 2018] [http:error] [pid 21812:tid 140624423646976] [client 2.25.8.236:60806] AH02429: Response header name ' inflating' contains invalid characters, aborting request, referer: https://bcol-staff.koha-ptfs.co.uk/cgi-bin/koha/tools/picture-upload.pl
Hi all! Getting also the same error when batch uploading patron images. However, when I enabled plack in the server, the images were uploaded successfully.
Confirming that the problem persists on a package installed 17.11.05 (non-plack) with Apache 2.4.10.
Then install plack :)
(In reply to Jonathan Druart from comment #9) > Then install plack :) The script in question does not run under plack.
The issue seems to be the call to system(): tools/upload-cover-image.pl: 107 unless ( system( "unzip", $filename, '-d', $dirname ) == 0 ) { 108 $error = 'UZIPFAIL'; 109 } This prints the reults to STDOUT, that is where the ' inflating' that upsets apache comes from
Created attachment 76807 [details] [review] Bug 20564: Don't use system to unzip files To test: 1 - Setup a zip file for patron images and cover images 2 - Test each tool 3 - Get a '500 error' after upload (note images do upload and attach) 4 - Apply patch 5 - Restart all the things 6 - Test agtain, uploads should complete and results display
I've tried testing this patch on one of the sandboxes but can't access the Upload patron images tool at http://pro.user05-koha.sandbox.biblibre.eu/cgi-bin/koha/tools/picture-upload.pl Software error is: Global symbol "$filename" requires explicit package name (did you forget to declare "my $filename"?) at /home/koha/src/tools/picture-upload.pl line 118. Execution of /home/koha/src/tools/picture-upload.pl aborted due to compilation errors.
Useful documentation link for creating the zip file to test with: http://manual.koha-community.org/3.2/en/uploadpatronimages.html https://koha-community.org/manual/18.05/en/html/tools.html?highlight=batch%20patron%20upload#upload-patron-images
(In reply to Nick Clemens from comment #12) > Created attachment 76807 [details] [review] [review] > Bug 20564: Don't use system to unzip files > > To test: > 1 - Setup a zip file for patron images and cover images > 2 - Test each tool > 3 - Get a '500 error' after upload (note images do upload and attach) > 4 - Apply patch > 5 - Restart all the things > 6 - Test agtain, uploads should complete and results display This is great patch, except for a typo. It worked only after I changed this line in tools/picture-upload.pl [17.11.5]: qx/unzip $filename -d $dirname/; with this: qx/unzip $tempfile -d $dirname/; The patch can be modified accordingly before it can be signed off.
Created attachment 77725 [details] [review] Bug 20564: Don't use system to unzip files To test: 1 - Setup a zip file for patron images and cover images 2 - Test each tool 3 - Get a '500 error' after upload (note images do upload and attach) 4 - Apply patch 5 - Restart all the things 6 - Test agtain, uploads should complete and results display
(In reply to Saiful Amin from comment #15) > This is great patch, except for a typo. Oh, ha ha, whoops Silly copy paste error Patch updated, thank you
Created attachment 79068 [details] [review] Bug 20564: Don't use system to unzip files To test: 1 - Setup a zip file for patron images and cover images 2 - Test each tool 3 - Get a '500 error' after upload (note images do upload and attach) 4 - Apply patch 5 - Restart all the things 6 - Test agtain, uploads should complete and results display Signed-off-by: George Williams <george@nekls.org>
Changing to signed off, since it didn't get marked as such, even though it is clear that it was.
Created attachment 79072 [details] [review] Bug 20564: Don't use system to unzip files To test: 1 - Setup a zip file for patron images and cover images 2 - Test each tool 3 - Get a '500 error' after upload (note images do upload and attach) 4 - Apply patch 5 - Restart all the things 6 - Test agtain, uploads should complete and results display Signed-off-by: George Williams <george@nekls.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.04
Pushed to 17.11.x for 17.11.10
*** Bug 21744 has been marked as a duplicate of this bug. ***