shields icon indicating copy to clipboard operation
shields copied to clipboard

Problems with using StackOverflow reputation badge

Open Yoskutik opened this issue 3 years ago • 10 comments

you experiencing an issue with...

:beetle: Description

When I use StackOverflow reputation badge without any parameters everything works okay:

But when I add parameters in order to change badge color or shape, it says there's invalid parameters

Also, if I want to change title from stackoverflow reputation to StackOverflow reputation:

:link: Link to the badge

:bulb: Possible Solution

¯_(ツ)_/¯

Yoskutik avatar Aug 12 '20 16:08 Yoskutik

Hm, actually. Even https://img.shields.io/stackexchange/stackoverflow/r/11589183 now says that parameters are invalid

image

Yoskutik avatar Aug 12 '20 16:08 Yoskutik

Thanks for the report. Weird! This issue is very strange, and must be related either to the Shields onboard caching logic (or possibly the CDN, though I doubt it). I expect it will resolve itself whenever the bad data is evicted from the cache.

It works fine locally and on staging.

If the underlying issue is the onboard cache, probably the best solution is to remove that cache, something I've wanted to do anyway. (#3368)

paulmelnikow avatar Aug 12 '20 18:08 paulmelnikow

Thank you. It did resolve itself for the next day.

Yoskutik avatar Aug 13 '20 09:08 Yoskutik

I'm seeing this issue intermittently. Right now, every badge on this page shows "invalid parameters". I've also tested on multiple browsers and even computers. It seems random, it will work for several hours and then revert back to "invalid parameters".

image

Edit: And now they're working again.

MacroPower avatar Aug 18 '20 13:08 MacroPower

Wild speculation, but I wonder if this is a manifestation of https://github.com/badges/shields/issues/3591 ?

from https://api.stackexchange.com/docs/throttle :

Note that exactly what response an application gets (in terms of HTTP code, text, and so on) is undefined when subject to this ban; we consider > 30 request/sec per IP to be very abusive and thus cut the requests off very harshly.

I guess we could be getting rejected with a 400 for making too many requests (which might explain this error and the intermittent behaviour)

chris48s avatar Aug 18 '20 18:08 chris48s

I have the same issue, they work and stop working randomly

gepser avatar Aug 25 '20 15:08 gepser

@chris48s I guess I’m confused that we’re getting “invalid parameter” on this, which sounds like, in addition to needing more rate limit, there’s also a bug in that we return what sounds like a permanent error instead of “unreachable.”

paulmelnikow avatar Aug 27 '20 18:08 paulmelnikow

The message "invalid parameters" implies we're getting a 400 response from the upstream API based on the code: https://github.com/badges/shields/blob/1047fd9c7eddef8517eec7d403a602a428e64695/services/stackexchange/stackexchange-reputation.service.js#L66-L68 We don't know why that is happening. It would indeed be conventional for a 400 response to indicate that we are issuing an invalid or erroneous request. It would also be conventional to reject a request with something like a 429 if a rate limit has been exceeded. The reason I suggested the 400 might be rate-limit related in this case is because of that quote from the documentation I posted:

exactly what response an application gets (in terms of HTTP code, text, and so on) is undefined

but I don't really know.

chris48s avatar Aug 27 '20 20:08 chris48s

Ah, I gotcha. It’s too bad they seem to send a 400 for both things!

paulmelnikow avatar Aug 30 '20 00:08 paulmelnikow

Any update on this?

roman-1983 avatar Jul 29 '22 06:07 roman-1983

Let me know if you want some help with the rate limiting.

cdhunt avatar Oct 13 '22 18:10 cdhunt

Yes. We'd love to find out if the issue we're seeing is rate limit related or not. We make all our requests with a user agent starting Shields.io/ if that helps.

chris48s avatar Oct 14 '22 20:10 chris48s

Have you registered with https://stackapps.com/? That would get you higher throttling limits. I do see your requests and I'll poke around some more on Monday.

cdhunt avatar Oct 14 '22 22:10 cdhunt

Have you registered with https://stackapps.com/?

No. I was not aware it existed. We're making all our requests with no auth. I'll have a look into this :+1:

chris48s avatar Oct 15 '22 20:10 chris48s

PR up at #8539

chris48s avatar Oct 17 '22 11:10 chris48s

Has this been resolved because I'm still seeing "invalid parameters" instead of the reputation count?

dillanjwilding avatar Nov 24 '22 16:11 dillanjwilding

https://github.com/badges/shields/pull/8539 is still open waiting on review

chris48s avatar Nov 24 '22 18:11 chris48s