When using upload speed limit, large file uploads do not work

Seafile Server 6.3.2 Linux
Seafile Client 6.1.8 Windows 7

When limiting my upload speed to about 100KB/sec, and attempting to upload a 150MB file using the desktop client, my upload percentage in the client is constantly restarting at 0%, and my apache error logs are showing the following errors:

[Wed Oct 17 09:07:47.253978 2018] [proxy_http:error] [pid 23569] (70007)The timeout specified has expired: [client X.X.X.X:54424] AH01095: prefetch request body failed to 127.0.0.1:8082 (127.0.0.1) from X.X.X.X ()
[Wed Oct 17 09:08:22.254710 2018] [proxy_http:error] [pid 23695] [client X.X.X.X:27478] AH01097: pass request body failed to 127.0.0.1:8082 (127.0.0.1) from X.X.X.X ()
[Wed Oct 17 09:08:22.287023 2018] [proxy_http:error] [pid 25035] (70008)Partial results are valid but processing is incomplete: [client X.X.X.X:38977] AH01095: prefetch request body failed to 127.0.0.1:8082 (127.0.0.1) from X.X.X.X ()

I have set the following timeout directives in an attempt to resolve the situation, but it has not helped, these timeouts come anywhere between 5 to 30 minutes even with the below timeout values being set at 2 hours:

Timeout 7200
ProxyTimeout 7200

#Seafile Server
ProxyPass /seafhttp http://127.0.0.1:8082 connectiontimeout=7200 timeout=7200
ProxyPassReverse /seafhttp http://127.0.0.1:8082
RewriteRule ^/seafhttp - [QSA,L]

#Seafdav
ProxyPass /seafdav http://127.0.0.1:8080/seafdav connectiontimeout=7200 timeout=7200
ProxyPassReverse /seafdav http://127.0.0.1:8080/seafdav

seahub
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
ProxyPass / http://127.0.0.1:8000/ connectiontimeout=7200 timeout=7200
ProxyPassReverse / http://127.0.0.1:8000

In the client logs, the following is recorded when this happens:

[10/17/18 09:48:45] http-tx-mgr.c(933): libcurl failed to PUT https://XXX/seafhttp/repo/dbfa878e-5fd8-492f-b87e-78b584d52258/block/88a822af594410a420bd49aa184810698d0d9b48: Failed sending data to the peer.
[10/17/18 09:48:45] http-tx-mgr.c(933): libcurl failed to PUT https://XXX/seafhttp/repo/dbfa878e-5fd8-492f-b87e-78b584d52258/block/0461770f111ad0455a83441342e9f336addb95ac: Operation was aborted by an application callback.
[10/17/18 09:48:46] http-tx-mgr.c(933): libcurl failed to PUT https://XXX/seafhttp/repo/dbfa878e-5fd8-492f-b87e-78b584d52258/block/ce8d4976779310ce58214f4c70d2322f5e0597f0: Operation was aborted by an application callback.
[10/17/18 09:48:46] http-tx-mgr.c(933): libcurl failed to PUT https://XXX/seafhttp/repo/dbfa878e-5fd8-492f-b87e-78b584d52258/block/8fdfaecec44c59935c947c9462e3e64b6ac3dddf: Operation was aborted by an application callback.

Any ideas? The only way I can make the upload finish is by no longer limiting my upload speed.

So you upload the file using cloud file explorer?

From what I see there are most likely more timeouts that could be triggered.

Hello,

No, I am uploading using the normal seafile client with the library fully synced.

It do not use Apache but it most likely is an issue with a timeout of it.

Sorry, but I am not understanding. Can you clarify further on your statement about it not using Apache?

I have everything setup under a reverse proxy with Apache following the Seafile guide for doing so.

I can recognize that the timeout errors are being generated by Apache, and I have searched far and wide for anything I could increase as a timeout value to try to fix it, but cannot find anything I have missed.

You could try to disable keepalive and see if it helps.

So it looks like Apache fails when trying to read from the client. Looks like that can only be changed with mod_reqtimeout.

I have tried with keepalives on and off, no difference there.

I have not tried anything with mod_reqtimeout. Looking into it now, thanks for the idea!

I believe you have solved my problem sir! I have set the following, and for over 45 minutes no further errors have been recorded, and my test files have been uploading fine so far:

RequestReadTimeout header=7200 body=7200

Thank you! I am going to continue testing, but the errors had been getting recorded steadily every couple of minutes prior to setting the above. After doing so, it has been completely quiet.

2 Likes

Just coming back one more time to say that several hours later, not a single error anymore, and uploads are much quicker and more stable.

The above setting that I changed should make it into the official Wiki. This solved a lot of my issue, and I see multiple posts here over the years with the same errors I was having :slight_smile:

I’m not sure if I’d leave it at 7200, though. I don’t know the default values but too high timeouts can allow DOS attacks by sending slow requests. Depending on the number of workers an attacker could just do as many requests as apache can handle and block other requests that way.

Agreed, it should be tweaked for public consumption. I just matched the other timeout values I was using. I was more stating that the setting itself should end up in the Wiki.

For my use, this is a private server that would be a bit difficult to find so I’m not too concerned about being targeted :slight_smile:

1 Like

Thanks a lot for this shoeper and arjones85! This has solved my problem, too! I had received the following errors:

[proxy_http:error] [pid 13952] (70007)The timeout specified has expired: [client ::] AH02609: read request body failed to [::1]:8082 (localhost) from :: ()
[proxy_http:error] [pid 13952] [client ::] AH01097: pass request body failed to [::1]:8082 (localhost) from :: ()
proxy_http:error] [pid 14201] (70008)Partial results are valid but processing is incomplete: [client ::] AH01095: prefetch request body failed to [::1]:8082 (localhost) from ::

Setting RequestReadTimeout solved the problem. I had tried TimeOut, ProxyTimeout and others before, to no avail!

1 Like