I had a semi-related situation occur today with one of my students. It's not the same situation, but it was a case where she was getting a failure trying to upload a file, so I throw it out there.
She was unable to to upload a 13 KB file when the rest of the class could. When we got looking, it was because she was over her 50 MB quota. We deleted a file and Canvas said she was now at 91% of her 50 MB quota. When she tried to upload it again, it still failed. I reloaded the page and am pretty sure it still didn't work. I went into a folder and uploaded it and it worked. Then I tried to upload it directly into the MyFiles folder and now it worked when it hadn't before.
Files that are uploaded as submissions are not supposed to count against the quota, but files that are uploaded and used as part of discussions or conversation attachments are. This was a discussion upload she was trying to make.
Again, not sure what, if anything that has to do with your case. She wasn't getting the 502 error because she wasn't using the API, but the quota might be coming into play.