Bug 22481 - Koha::Uploader does not work under Plack
Summary: Koha::Uploader does not work under Plack
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-08 09:19 UTC by Fridolin Somers
Modified: 2021-03-11 23:08 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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...