Badgen.net: Bad Gateway errors

Created on 29 May 2020  路  9Comments  路  Source: badgen/badgen.net

Hello & thanks for this fantastic service!

I've recently been getting more and more 502 Bad Gateway errors from badgen.net. I use badgen for the badges of cljdoc.org where I provide a static URL that people can put into their READMEs, e.g. https://cljdoc.org/badge/nrepl/nrepl.

The error page links to this https://vercel.com/docs/error/application/NO_RESPONSE_FROM_FUNCTION

To do this I'm requesting the badge from a server and then respond to the request with the body that badgen provided and some extra caching directives, the code can be found here (Clojure)

My question is:

  • Do you have any idea why I might be seeing those 502 errors?
  • Should I be calling the badgen API in any different way?

Most helpful comment

Was going to open an issue to gracefully handle 5xx responses from API providers (in this case David DM).

When these APIs return 5xx, the badge endpoint returns a HTML error page instead of a SVG which results in the following with this (https://flat.badgen.net/david/dev/wopian/kitsu) badge endpoint.

image

Ideally it would show something akin to

All 9 comments

Usually it could be error response for live badge, but not for static badge. I've seen some 502 error with newly created badge, but after a refresh it works fine (looks like a cache issue).

Could you provide some error url?

I got some 502 logs, but mostly during the david-dm outage recently.

image

I made some changes to get better reporting and will report back. All the URLs include the string "cljdoc" if that's helpful.

Was going to open an issue to gracefully handle 5xx responses from API providers (in this case David DM).

When these APIs return 5xx, the badge endpoint returns a HTML error page instead of a SVG which results in the following with this (https://flat.badgen.net/david/dev/wopian/kitsu) badge endpoint.

image

Ideally it would show something akin to

Yep, we should handle 500 gracefully

The GitHub Checks badge for only one specific repo of mine is also returning a badgen: error badge with an intermittent HTML 502 response while the latest commit has unfinished checks

https://flat.badgen.net/github/checks/wopian/kitsu

image

"unfinished checks" 馃

Looks like this is the root case we are looking for 馃憤

I'm getting a lot of these looking through the examples on the site, as well. Maybe 20-30% of the examples I opened had this problem, but only on the first request time I opened each one (I'm assuming there's some kind of caching going on?)
Screen Shot 2020-09-25 at 11 28 15 PM

I'm getting a lot of these looking through the examples on the site, as well. Maybe 20-30% of the examples I opened had this problem, but only on the first request time I opened each one (I'm assuming there's some kind of caching going on?)

I also noticed this issue, but I cannot reproduce it 馃
Guessing it's caused by a cold start without cache (after new deployment)?

Did a test after new deployment, still no issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amio picture amio  路  3Comments

tunnckoCore picture tunnckoCore  路  6Comments

diomed picture diomed  路  3Comments

sindresorhus picture sindresorhus  路  6Comments

szmarczak picture szmarczak  路  5Comments