Bug 22481

Summary: Koha::Uploader does not work under Plack
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, jonathan.druart, marjorie.barry-vila
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15218
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22417
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8437
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Fridolin Somers 2019-03-08 09:19:34 UTC
The use of Plack reveled that the use of CGI hook is not allowed, see Bug 15218.
Looks like this is used by Koha::Uploader::cgi() :
  my $query = CGI::->new( sub { $self->_hook(@_); }, {}, 0 );
Comment 1 Fridolin Somers 2019-03-08 09:42:23 UTC
I must say failure is random on file upload.
Large files seams to make it worth.
Comment 2 Fridolin Somers 2019-03-08 10:19:49 UTC
A quick dirty fix is in Koha/Uploader.pm
  use constant BYTES_DIGEST => 2048;
Change 2048 with a huge number, upload will not need hook.
Comment 3 Fridolin Somers 2019-12-03 12:41:40 UTC
Still valid with 19.11
Comment 4 David Cook 2020-07-27 00:50:41 UTC
This is linked to #22417, but I don't think it's actually relevant.
Comment 5 David Cook 2020-09-03 23:17:24 UTC
Is this related to any scripts that are still being proxied to Plack?

Maybe "tools/upload-file.pl"?
Comment 6 Fridolin Somers 2020-09-10 07:09:18 UTC
(In reply to David Cook from comment #5)
> Is this related to any scripts that are still being proxied to Plack?
> 
> Maybe "tools/upload-file.pl"?

Indeed, I mean it appears when all perl is through plack (we use nginx instead of apache).
Comment 7 David Cook 2020-09-11 00:04:52 UTC
Hmm certainly one that needs to be looked into O_O.
Comment 8 Fridolin Somers 2021-03-11 10:56:35 UTC
Still valid :(
Comment 9 David Cook 2021-03-11 23:07:00 UTC
Can't say that it's a priority for me as I haven't had any problems but this is unfortunate :(
Comment 10 David Cook 2021-03-11 23:08:08 UTC
One day I want to finish Bug 26791 which will provide a template for rewriting problematic Koha code to be PSGI compliant but until then...