vtta-dndbeyond icon indicating copy to clipboard operation
vtta-dndbeyond copied to clipboard

"TypeError: Failed to fetch" when trying to submit scene (Backend error: Payload too large)

Open gryphius opened this issue 4 years ago • 7 comments

When I try to submit SKT Deadstone Cleft and after the dialog asking for my name / changelog I'm getting the error message

image

Submitting other scenes has worked without issue so far.

The chrome inspector shows that the response from the server was empty (headers only, no payload).

Chrome Inspector details:

request link

https://www.vttassets.com/api/v2/dndbeyond/scene/submission?pid=22335549&sceneId=5ee69bbafae4f274f32000e2

request headers

POST /api/v2/dndbeyond/scene/submission?pid=22335549&sceneId=5ee69bbafae4f274f32000e2 HTTP/1.1
Host: www.vttassets.com
Connection: keep-alive
Content-Length: 114221
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Content-Type: application/json
Accept: */*
Origin: https://vtt.nat20.ch
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://vtt.nat20.ch/game
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7


response headers:

HTTP/1.1 413 Payload Too Large
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 14 Jul 2020 12:49:26 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 175
Connection: keep-alive
X-Powered-By: Express
ETag: W/"af-KQtNKC1voow4BfBY7k9U+qWU7MM"

response: (empty)

payload (copied as curl command): vttbugreportpayload.txt

gryphius avatar Jul 14 '20 13:07 gryphius

My suggestion for the fix would be two things:

  • Handle "413 Payload Too Large" gracefully, i.e. show error message ("Too large for submission")
  • Maybe increase the limit a bit? 115 KB didn't seem excessive to me, but maybe I'm wrong

gryphius avatar Jul 14 '20 13:07 gryphius

Holy maccaroni. That's gotta be a ton of walls :) I will look at it and report back here

VTTAssets avatar Jul 14 '20 14:07 VTTAssets

yeah, there are quite a few :) - I've already started to the reduce the node count as there are admittedly several places where he walls don't have to follow the map outline perfectly. Maybe we can find some middle ground ;-)

gryphius avatar Jul 14 '20 14:07 gryphius

I remember that I fought with the necessary nginx param and it not being used for this POST route, I guess I will need to do more digging there, darn. AFAIR it's just a config issue, and not really a constraint on my side

VTTAssets avatar Jul 14 '20 15:07 VTTAssets

no worries, the nginx limit actually forced me to optimize, so it ain't that bad ;-) - after removing tons of unnecessary nodes the submission was successful. I guess handling the 413 response more gracefully and displaying something to the user would still be nice, but definitely not a high-prio bug. Thanks for providing this great module!

gryphius avatar Jul 14 '20 18:07 gryphius

I am also having the same error when trying to submit a map of Mage Mage level 3. It has alot of walls and is a very large map as you can see from the image which contains about 1/3 of the map.

Map

Any suggestions on how I can get this to upload so I can contribute and help others out?

JKFWEB avatar Nov 04 '20 18:11 JKFWEB

On another map I'm having the failed to fetch error. I'm showing this in the inspector from chrome:

Access to fetch at 'https://www.vttassets.com/api/v2/dndbeyond/scene/submission?pid=44646253&sceneId=5ee69bc1fae4f274f3200186' from origin 'http://localhost:30000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

POST extendSceneNavigationContext.js:195 POST https://www.vttassets.com/api/v2/dndbeyond/scene/submission?pid=44646253&sceneId=5ee69bc1fae4f274f3200186 net::ERR_FAILED

JKFWEB avatar Nov 10 '20 03:11 JKFWEB