Project

General

Profile

File upload stuck/no response if file is larger than 127KB

Added by Oliver Haucke 6 months ago

Hey there,
i'm currently having issues uploading files to Redmine that are larger than 127KB.

$ freebsd-version
14.1-RELEASE-p5

$ pkg version -v | grep apache
apache24-2.4.62
rubygem-passenger-apache-6.0.23
Environment:
  Redmine version                5.1.3.stable
  Ruby version                   3.2.5-p208 (2024-07-26) [amd64-freebsd14]
  Rails version                  6.1.7.8
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                sendmail
Redmine settings:
  Redmine theme                  Default
SCM:
  Git                            2.46.2
  Filesystem
Redmine plugins:
  no plugin installed

Last time, i uploaded a larger file (6MB) was 2024-09-12 14:30:19.

After a bit of debugging, i figured out that if the file is 127KB or smaller, everything is fine but as soon as the file is 128KB or larger, i do not get any response from the server/the connection timed out.

What i can confirm via setting the LogLevel of apache to trace2 (and 5) + i ran tcpdump on the server:
The HTTP connection gets established and the data are received by the server

apache trace5

Next thing i checked was the passenger log (i increased the PassengerLogLevel to 5/debug):

[ D 2024-10-09 20:28:26.0255 33442/Th Ser/Server.h:880 ]: [ServerThr.5] 1 new client(s) accepted; there are now 1 active client(s)

Looks like passenger also gets the request

Next thing i tested was config.log_level = :debug in config/additional_environment.rb but nothing related to the request got written in the log.

Just for my sanity (since i also have php available on the server), i tested the same request to a test script and there everything worked fine.

Any idea what could cause the issue or what i can test next to figure it out and solve it?

Regards


Replies (2)

RE: File upload stuck/no response if file is larger than 127KB - Added by Oliver Haucke 6 months ago

Many hours later: it looks like a problem with passenger.
If i run `bundle exec rails server -e production` everything works fine

RE: File upload stuck/no response if file is larger than 127KB - Added by David Gessel 14 days ago

I have a very similar configuration and the same issue. A few months ago I tried this solution and I'm pretty sure it worked for a while, but it has re-emerged. I figured I'd try the solution from this ticket: https://github.com/phusion/passenger/issues/2569 and it seems to work and should be persistent. My specific mod was to amend the location directive in /usr/local/etc/apache24/extra/httpd-vhosts.conf with PassengerBufferUpload off
as in:

    <Directory "/usr/local/www/redmine/public/">
        Allow from all
        Options -MultiViews
        Require all granted
        PassengerBufferUpload off
    </Directory>

And uploads work. This should be a persistent fix. There's likely some code checking upload progress that is waiting for that data to be made available and with PassengerBufferUpload at the default value of "true," it will not be.

    (1-2/2)