Forum

maxrequestsize bug or config problem

hanscees
12 February 2019, 21:12
Hi,
I keep getting these errors when uploading to a nextcloud server:
192.168.0.152|Tue 12 Feb 2019 21:10:58 +0100|Maximum request size reached

my config states
RequestLimitMask = allow 192.168.0.152
in the server part.

I am running version 10...
hanscees
12 February 2019, 21:18
same problem if I use
RequestLimitMask = deny 192.168.0.152

the config seems to have no impact at all
192.168.0.152|Tue 12 Feb 2019 21:17:52 +0100|Maximum request size reached
hanscees
12 February 2019, 22:15
by the way, I have been fiddling with this because the nextcloud client does not upload files bigger than about 50mb.
This is odd since uploading is normally done via put commands, and according to the man file put should not result in the logging above.

see:
192.168.0.2|Tue 12 Feb 2019 22:05:19 +0100|201|1268817||PUT /remote.php/dav/files/hanscees/GCF_Subramanian-working-paper-3_-6.17.13.pdf HTTP/1.1|Content-Type: application/octet-stream|OC-Async: 1|OC-Chunk-Size: 10000000|OC-Total-Length: 1267156|X-OC-Mtime:

If a file gets bigger it uses mkcol, put, put move
192.168.0.2|Tue 12 Feb 2019 22:07:19 +0100|207|14404||PROPFIND /remote.php/dav/files/hanscees/ HTTP/1.1|Depth: 1|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|Content-Type: text/xml; charset=utf-8|X-Request-ID: 068a5204-6bc8-404b-9680-ffc6723c3a35|Content-Length: 363|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Tue 12 Feb 2019 22:07:20 +0100|201|1382||MKCOL /remote.php/dav/uploads/hanscees/2859238063 HTTP/1.1|Content-Length: 0|OC-Total-Length: 37404089|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: e40bc62d-d14d-4305-a7a3-836cac4e03af|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Tue 12 Feb 2019 22:07:20 +0100|201|10001422||PUT /remote.php/dav/uploads/hanscees/2859238063/00000000 HTTP/1.1|OC-Chunk-Offset: 0|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: 345fa86c-5d6b-47ae-b20e-476c3b54d8aa|Content-Length: 10000000|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Tue 12 Feb 2019 22:07:20 +0100|207|2067||PROPFIND /remote.php/dav/files/hanscees/ HTTP/1.1|Depth: 0|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|Content-Type: text/xml; charset=utf-8|X-Request-ID: 7fa9dd8f-aaf5-41f4-a497-b871f120f326|Content-Length: 114|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Tue 12 Feb 2019 22:07:21 +0100|201|27405518||PUT /remote.php/dav/uploads/hanscees/2859238063/00000001 HTTP/1.1|OC-Chunk-Offset: 10000000|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: 4013b282-19dc-41b4-a577-e5df4112d27b|Content-Length: 27404089|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Tue 12 Feb 2019 22:07:21 +0100|201|1648||MOVE /remote.php/dav/uploads/hanscees/2859238063/.file HTTP/1.1|Destination: /remote.php/dav/files/hanscees/ct-2018-012.pdf|Content-Type: application/octet-stream|OC-Async: 1|OC-Total-Length: 37404089|X-OC-Mtime: 1540731977|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: 3a2e3a50-f627-4d5a-a3ee-78694584a294|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com


weird.
Hugo Leisink
16 February 2019, 07:27
Could it be that NextCloud uses PUT for uploading files? In that case, try the MaxUploadSize setting.
hanscees
16 February 2019, 22:11
Ik heb nu ten eerste een tcpdump zodat ik zeker weet dat hiawatha dit zegt.

eerst de PUT (idd)
HTTP, length: 637
PUT /remote.php/webdav/Bijen_v_Nederland.pdf HTTP/1.1
Host: nc.hanscees.com
Accept: */*
Content-Type: application/octet-stream
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: cookie_test=test; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; oc_sessionPassphrase=iwmblA0wsnKDD
G4RqkRtAFvE2J4nTQuuQ7bnzGrcGyLeWAgXWD%2FtBQ2iGtunQXnqbUZqOanRYEziw5FpGCSrAo2QkSROusRpJGmC5u0R9NYpbPzNPVzCd%2FR%2FJjEsp%2BO%2F
; ocpm3gq71w2w=29f734c9b5216f67bc44d65ea8cae5bf
User-Agent: Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.8
Authorization: Basic aGFuc2NlZXM6TGluemlzbGllZjQwJCQ=
Content-Length: 60641793
Accept-Language: nl-nl

dan de blok van Hiawatha

HTTP, length: 1070
HTTP/1.1 413 Request Entity Too Large
Date: Sat, 16 Feb 2019 20:59:06 GMT
Server: Hiawatha
Accept-Ranges: bytes
Connection: close
Content-Length: 887
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>413 - Request Entity Too Large</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body { background-color:#d0d0d0; font-family:sans-serif; padding:0 30px }
div { background-color:#f8f8f8; letter-spacing:4px; max-width:400px; margin:100px auto 0 auto; padding:50px; border-r
adius:10px; border:1px solid #808080; box-shadow:8px 15px 20px #404040 }
h1 { margin:0; font-size:22px; font-weight:normal }
p { margin:10px 0 0 0; padding-top:2px; font-size:14px; color:#606060; border-top:1px solid #a0a0ff; text-align:right
; font-weight:bold }
@media (max-width:767px) { h1 { font-size:90%; letter-spacing:2px } p { font-size:70% } }
</style>
</head>
<body>
<div>
<h1>Request Entity Too Large</h1>
<p>413</p>
</div>
</body>
</html>[!http]
hanscees
16 February 2019, 22:18
Maar in de config file heb ik staan:

ten eerste in de general sectie (boven de bindings etc)
RequestLimitMask = deny 192.168.0.152,deny 192.168.0.2

Daarna in de binding:
Binding {
Port = 80
# MaxRequestSize = 4048 # don't use this, use BanlistMask
TimeForRequest = 2,45 #default 5,30
MaxUploadSize = 85
MaxRequestSize = 256
}

De file is 60 mb. Waarom de blok?
hanscees
16 February 2019, 22:46
behind the reverse proxy hiawatha a tcpdump shows no errors. It does show this:

GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1
HTTP/1.1 304 Not Modified
PROPFIND /remote.php/dav/files/hanscees/ HTTP/1.1
HTTP/1.1 207 Multi-Status
MKCOL /remote.php/dav/uploads/hanscees/3791641492 HTTP/1.1
HTTP/1.1 201 Created
PUT /remote.php/dav/uploads/hanscees/3791641492/00000000 HTTP/1.1
HTTP/1.1 201 Created
GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json HTTP/1.1
HTTP/1.1 304 Not Modified
PROPFIND /remote.php/dav/files/hanscees/ HTTP/1.1
HTTP/1.1 207 Multi-Status
PROPFIND /remote.php/dav/uploads/hanscees/3791641492 HTTP/1.1
HTTP/1.1 207 Multi-Status
PUT /remote.php/dav/uploads/hanscees/3791641492/00000001 HTTP/1.1
HTTP/1.1 201 Created
PROPFIND /remote.php/dav/files/hanscees/ HTTP/1.1
HTTP/1.1 207 Multi-Status


This suggests hiawatha does upload a part of the file to the nextcloud backend.
But normally you would see:
mkcol
put put
move


hanscees
16 February 2019, 23:52
here are chunks of the debugfile from the nextcloud client. It suggests either hiwatha r the nextcloud backend ends the connection

[OCC::PUTFileJob::finished PUT of "https://nc.hanscees.com/remote.php/dav/uploads/hanscees/511477614/00000004" FINISHED WITH STATUS "OK" QVariant(int, 201) QVariant(QString, "Created")
[OCC::PropagateUploadFileNG::slotPutFinished Chunked upload of 10000000 bytes took 458 ms, desired is 60000 ms, expected good chunk size is 1310043668 bytes and nudged next chunk size to 100000000 bytes
[OCC::AccessManager::createRequest 3 "" "https://nc.hanscees.com/remote.php/dav/uploads/hanscees/511477614/00000005" has X-Request-ID "7a06a5e4-95f0-41b6-999c-48773e439176"
[OCC::AbstractNetworkJob::start OCC::PUTFileJob created for "https://nc.hanscees.com" + "" "OCC::PropagateUploadFileNG"
[OCC::SocketApi::slotReadSocket Received SocketAPI message <-- "GET_MENU_ITEMS:" from QLocalSocket(0x55dd679ab1b0)
[OCC::SocketListener::sendMessage Sending SocketAPI message --> "GET_MENU_ITEMS:BEGIN" to QLocalSocket(0x55dd679ab1b0)
[OCC::SocketListener::sendMessage Sending SocketAPI message --> "GET_MENU_ITEMS:END" to QLocalSocket(0x55dd679ab1b0)
[OCC::WebFlowCredentials::slotFinished request finished
[OCC::AbstractNetworkJob::slotFinished QNetworkReply::NetworkError(RemoteHostClosedError) "Connection closed" QVariant(Invalid)
[OCC::WebFlowCredentials::stillValid Still valid?
[OCC::WebFlowCredentials::stillValid QNetworkReply::NetworkError(RemoteHostClosedError)
[OCC::WebFlowCredentials::stillValid "Connection closed"
[OCC::PUTFileJob::finished PUT of "https://nc.hanscees.com/remote.php/dav/uploads/hanscees/511477614/00000005" FINISHED WITH STATUS "RemoteHostClosedError Connection closed" QVariant(Invalid) QVariant(Invalid)
[OCC::PropagateItemJob::done Could not complete propagation of "Debian-Stretch-1.0_RC2-20180403-XU3-XU4.img.xz" by OCC::PropagateUploadFileNG(0x55dd67859750) with status 2 and error: "Connection closed"
[OCC::SocketListener::sendMessage Sending SocketAPI message --> "STATUS:SYNC:/mnt/01D0EA52D22A9BD0/Nextcloud" to QLocalSocket(0x55dd679ab1b0)
[OCC::SocketListener::sendMessage Sending SocketAPI message --> "STATUS:ERROR:/mnt/01D0EA52D22A9BD0/Nextcloud/Debian-Stretch-1.0_RC2-20180403-XU3-XU4.img.xz" to QLocalSocket(0x55dd679ab1b0)
[OCC::SocketListener::sendMessage Sending SocketAPI message --> "STATUS:IGNORE:/mnt/01D0EA52D22A9BD0/Nextcloud" to QLocalSocket(0x55dd679ab1b0)
[OCC::ActivityWidget::slotItemCompleted Item "Debian-Stretch-1.0_RC2-20180403-XU3-XU4.img.xz" retrieved resulted in "Connection closed"
[OCC::ActivityWidget::slotItemCompleted Item "Debian-Stretch-1.0_RC2-20180403-XU3-XU4.img.xz" retrieved resulted in error "Connection closed"
[OCC::ActivityListModel::addErrorToActivityList Error successfully added to the notification list: "Connection closed"

hanscees
16 February 2019, 23:59
Is there some way I can let hiawatha spit out detailed logs?

The only thing I have to go on now is:
- system log show a block of some sort
- acces.log shows a half put toward the backend.

Is there a way to feed hiawatha a PUT command from IP -> to IP and then it says what it will do?



192.168.0.2|Sat 16 Feb 2019 23:56:30 +0100|Maximum request size reached
192.168.0.2|Sat 16 Feb 2019 23:56:30 +0100|Maximum request size reached

and this
192.168.0.2|Sat 16 Feb 2019 23:56:29 +0100|201|1381||MKCOL /remote.php/dav/uploads/hanscees/1365520217 HTTP/1.1|Content-Length: 0|OC-Total-Length: 113708692|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: 5da68d1b-85da-4dcf-b505-e6139dfda2ce|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Sat 16 Feb 2019 23:56:29 +0100|201|10001420||PUT /remote.php/dav/uploads/hanscees/1365520217/00000000 HTTP/1.1|OC-Chunk-Offset: 0|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: d25dad13-b008-45a9-b006-9cb9cfe4f50b|Content-Length: 10000000|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
192.168.0.2|Sat 16 Feb 2019 23:56:44 +0100|201|10001427||PUT /remote.php/dav/uploads/hanscees/1365520217/00000001 HTTP/1.1|OC-Chunk-Offset: 10000000|User-Agent: Mozilla/5.0 (Linux) mirall/2.5.1git (Nextcloud)|Accept: */*|X-Request-ID: 2a84b160-cd4b-4ba7-ae13-c8d71be485e4|Content-Length: 10000000|Connection: keep-alive|Accept-Encoding: gzip, deflate|Accept-Language: en-US,*|Host: nc.hanscees.com
Hugo Leisink
18 February 2019, 09:02
Heb je PHP ook zodanig ingesteld dat deze 60MB (wat eigenlijk wel een bizar groot bestand is om te uploaden via HTTP) accepteert?
This topic has been closed.