3 followers Follow

Podio.NET receives HTML and cannot parse, 502 Bad Gateway

Hello all, I've been trying to diagnose some issues with our application that accesses the Podio API and I was getting some interesting errors that I couldn't catch. I forked the Podio.NET library and inserted my own logger statements into the lowest request calls and dug into the uncaught JSON parsing exception was bringing this application to it's knees. The only hint was that it was having trouble parsing the first character "<", so I figured it was getting some weird HTML response. Sure enough it was, this happens about every other week on a completely random API request. At first I was concerned this was a rate limit of some sort but I debugged everything extremely carefully, watching the number of requests as tracked by the library itself and this happens whether we are close to our limit or not.

<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>

I passed this on to support but was told to post here, so I'm hoping someone may be able to clarify what is going on. We do not have any Nginx boxes between us and the API endpoint so this is a message received from the endpoint itself. Is anyone else experiencing this behavior?

Tanner Danzey

Please sign in to leave a comment.




I will check the issue. Could you provide me some more details, how to replicate this error. Also, which version of Podio library are you using?

Ajmal v Hassainar 0 votes
Comment actions Permalink

Hi Ajmal, sorry for the delayed response.

The version I'm testing is based on commit 587e1757 with slight modifications to allow me to log the output of the responses to the requests. If you would like me to give you a patch to see what I'm seeing I can definitey do so. I'm sure there's an easier way to do that but this way was the quickest. Currently I do not know of any way to replicate this error, it happens very infrequently (enough to annoy the person running the report) and there do not appear to be anything in common between the items that it fails on. Unfortunately I'm not sure there is a problem in the API, 502 bad gateway seems like something that would be an issue on behalf of the host of the API. In the next week I will update to a more recent commit and see if the issue no longer happens, which will take a while to confirm.

Tanner Danzey 0 votes
Comment actions Permalink