Keep randomly getting 502 bad gateway when uploading files
Does anyone know why this is happening and how to fix it
20 Replies
the logs for both nginx and the application handling the uploads are empty
so it seems the request doesnt even reach the origin server (how do i verify this?)
since there is a 100mb limit the frontend (javascript) puts the files into chunks and uploads every chunk to the backend
after a few request i randomly get these 502 bad gateways
usually when uploading large files but it doesnt always happen
Hi - these are documented here https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#502504-from-cloudflare
They typically indicate Cloudflare issues, so you need to collect the
* Time and timezone
* URL that resulted in the error
* Output from browsing to
<YOUR_DOMAIN>/cdn-cgi/trace
and then, if you can, open a Support Ticket with those detailsyes ive checked that url but the problem is the error isnt bound to a certain url it sometimes happens with uploading so its very hard to debug
but its only with uploading so I really dont understand how this can be a cloudflare issue but i havent got any errors on my side
Uploads are buffered at Cloudflare before being sent to the origin, and that specific error almost always means an internal error ocurred within Cloudflare before the request ever reached your server
but the problem is the error isnt bound to a certain url it sometimes happens with uploading so its very hard to debugUnderstood - so the URLin this case is used by us to search logs on our end so helps to have at least one that it happened on along with the corresponding timestamp. For an upload this would be the URLthat the upload request is being sent to
alright ill open a support ticket
thanks for the help
The documentation says to contact support because this isn't an error that you can debug yourself, it's all on us
No problem and sorry you're having issues
wait so im at the support ticket in the cloudflare dashboard but theres nowhere where i can enter the full uri for the error
just the domain
You can add it in the body of the ticket later when you click to add more details
wait i think im on the wrong page for this
because it just redirects me to cloudflare community
oh
It means, really annoyingly, that you're on a plan that doesn't have access to technical support, so we have to do this the hard way
Admittedly I am not in the office currently, so @Peps can you help escalate this?
If you are able to post on the community that would help speed things up since it's linked to your account - you don't have to provide all the details there if you don't want them public, just the core issue (like you did here)
alright so I make a community post describing my issue?
Correct
alright
Send the link to the community post in this thread once you have it, and we'll escalate it
thank you
will do
Cloudflare Community
Randomly occuring 502 Bad Gateway errors
I keep getting Bad Gateway errors when uploading large files on cloudflare, the error received is the black and white page that just says “502 Bad Gateway” and “cloudflare” which according to https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors indicates this is an issue on cloudflares...
👍
The thread will be checked and responded to soon by Cloudflare's support
thank you so much