The discussion revolves around Shields.io failing to retrieve statistics from a Discourse instance (discuss.grakn.ai), returning an “invalid” status instead of “inaccessible.” Users investigate potential causes, including protocol settings, user agent blocking, and API endpoint changes. max_grakn identifies that Shields.io’s user agent was blocked by the Discourse instance’s crawler whitelist. barto_95 notes that enabling anonymous statistics sharing resolved the issue for another site. Arkshine points to a recent Discourse API change where certain fields were renamed to plural forms (e.g., topic_count → topics_count), suggesting that Shields.io’s code needs updating to support both versions. BryanV confirms that a pull request has been opened to address this, but maintaining backward compatibility is a challenge. The issue highlights the need for updates on both the Discourse and Shields.io sides to ensure continued functionality.
We’ve had a Discourse shield on our repository for a while now, and it recently stopped working.
If you go to 404: badge not found and select any Discourse shield, you can enter your discourse domain address and it will show you the shield with the correct statistics. You can try this with meta.discourse.org.
However, when we enter our discourse host address (https://discuss.grakn.ai), for any statistics and for both http/https, it always returns “invalid”.
When a host is not found, Shields.io would return “inaccessible”. Thus we assume “invalid” means it’s accessible but there are access rights issues or invalid responses.
Is it possible that a recent update/upgrade broke something on Discourse statistics API that Shields.io uses?
It’s working for me in my site, maybe you’re not setting correctly the protocol? Or the Grakn Discourse has any kind on modification that breaks that endpoint.
@marianord that’s exactly my question: where are the “protocols” you’re mentioning? How can they be configured? I’ve not changed any settings.
@gerhard given that shields.io is working for other Discourse sites, it does not seem likely to be an issue on their side. Unless they’re re not reading the output from our site statistics properly - but how can we find out about this? What is the endpoint from Discourse that is used to query the statistics? Perhaps we should start there?
Interesting! Thank you @max_grakn! We did add Googlebot to the whitelist recently, I think that may be the cause.
@codinghorror are we meant to use Blacklist and Whitelist at the same time? As in, if you add things to whitelist, does that mean everything else is blacklisted (which therefore make the blacklist redundant)?
But naturally this change places a burden on shields.io to support both versions (in perpetuity, I guess) since there is no guarantee that any given Discourse instance has updated or not, so it is not so simple as changing to plurals.