Shields.io unable to retrieve Discourse statistics API

Hi everyone,

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”.

Discussion Forum

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?

Thank you so much!

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.

imagen

You might want to ask Shields.io about that problem. It works with all other sites I tested, so this isn’t our bug.

@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?

I’m mentioning http vs https.

This happened because our Discourse installation blocked Shields.io’s user agent (Shields.io). This setting is named whitelisted crawler user agents and can be edited at
<discourse_server>/admin/site_settings/category/all_results?filter=crawler

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)?

No, the crawler whitelist is very dangerous, and should only be used carefully per the help text.

User agents of web crawlers that should be allowed to access the site. WARNING! SETTING THIS WILL DISALLOW ALL CRAWLERS NOT LISTED HERE!

안녕하세요, 제가 받은 테스트에서 잘못된 데이터를 수신할 때 동일한 문제가 발생합니다… 혹시 아이디어가 있으신가요?

이제 해결되었습니다. 다음 경로에서 익명 통계 공유를 활성화해야 합니다:

관리자 → 설정 → 기타 → 익명 통계 공유 = 활성화

이제 shields.io에서도 정상적으로 작동합니다.

저도 같은 문제가 있는데, 익명 통계 공유는 이미 활성화되어 있습니다
:cry:

[![Racket Discourse](upload://6fa5jbSn04vRLXdubAYmFJt5emf.svg)]

[Racket Discourse]

관련 링크:

일부 필드가 복수형으로 이름이 변경되었기 때문입니다.

topic_count → topics_count
post_count → posts_count
user_count → users_count
like_count → likes_count

여기서 코드를 수정하여 복수형으로 폴백하도록 해야 합니다:

여전히 깨져 있습니다 - 다른 분들에게는 정상 작동하나요?

Racket Discourse

![Racket Discourse](upload://7asTK98zfWLXRebm11uEN3KPM5N.svg)

몇日前에 PR이 열렸습니다:

하지만 자연스럽게 이 변경 사항은 shields.io가 두 버전 모두를 (영구적으로, 아마도) 지원해야 하는 부담을 안겨줍니다. 특정 Discourse 인스턴스가 업데이트되었는지 여부에 대한 보장이 없기 때문에, 단순히 복수로 변경하는 것만큼 단순하지 않습니다.