Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bintray badge is flaky #658

Closed
agemooij opened this issue Feb 25, 2016 · 27 comments
Closed

Bintray badge is flaky #658

agemooij opened this issue Feb 25, 2016 · 27 comments
Labels
bug Bugs in badges and the frontend needs-upstream-help Not actionable without help from a service provider operations Hosting, monitoring, and reliability for the production badge servers service-badge New or updated service badge

Comments

@agemooij
Copy link

The Bintray badge seems to be broken; all versions are rendered as a grey "invalid".

Perhaps the API has changed? I've tested with multiple repositories but the example on shields.io itself is also broken:

Current Version

@migmruiz
Copy link

Having the same issue here

@xvik
Copy link

xvik commented Mar 16, 2016

It works sometimes, but mostly not. Could it be caused by bintray api limits?

@nwalters512
Copy link

Can confirm that this is still an issue. It was working yesterday, but all Bintray badges (at least the one for my project and the example from shields.io) are currently showing "invalid".

@raniejade
Copy link

Badge is broken for my project as well. Rate limiting is very likely the culprit.

@espadrine
Copy link
Member

The request performed is curl -v 'https://bintray.com/api/v1/packages/asciidoctor/maven/asciidoctorj/versions/_latest'. I cannot find a X-RateLimit-Limit header in the response. Is this issue still ongoing? Did they switch their rate limiting system?

@cdeszaq
Copy link

cdeszaq commented Sep 28, 2016

As of today, the issue is still present. Does anyone have contacts at Bintray to see if we can resolve this?

@xvik
Copy link

xvik commented Sep 28, 2016

Here is what bintray support answered about this issue:

Thank you for contacting us.
We were not able to reproduce this behaviour using a custom shield.
We also verified that the 'getLatestVersion' API is not rate limited so this does not appear to be the issue.

So there are no limits on bintray side and probably the problem is on the shields side.

Dear shield maintainers, please look actual error messages in your logs and try to investigate this.

P.S. I also asked bintray support to allow bintray badge customization (different message), but don't know if this ever happen:

We have forwarded your request to our Product Team and will consider adding the option to customise the badge.

@Fi5t
Copy link

Fi5t commented Oct 31, 2016

The badge has broken again...

xenomachina added a commit to xenomachina/kotlin-argparser that referenced this issue Feb 1, 2017
Shields.io seems to be flakey for bintray badge. See
badges/shields#658

Travis CI has an identical looking badge, so might as well go direct for it as
well.
joffrey-bion added a commit to joffrey-bion/fx-gson that referenced this issue Mar 16, 2017
Since Bintray's and Travis's badges look the same as shields.io's, use them because of this issue on shields.io:
badges/shields#658
joffrey-bion added a commit to joffrey-bion/fx-log that referenced this issue Mar 17, 2017
Since Bintray's and Travis's badges look the same as shields.io's, use them because of this issue on shields.io:
badges/shields#658
tsjensen added a commit to checkstyle-addons/checkstyle-addons that referenced this issue Mar 24, 2017
@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend needs-upstream-help Not actionable without help from a service provider labels Apr 7, 2017
@paulmelnikow
Copy link
Member

It looks like the badge has been flaky for a long time.

Unfortunately the server doesn't log all the API calls. So I think the way to resolve this long-standing issue is to set up a recurring test over a week or more, and send documentation of the failures to their support.

If anyone is game, would be great to have your help!

@paulmelnikow paulmelnikow changed the title The Bintray badge seems to be broken Bintray badge is flaky Apr 7, 2017
@paulmelnikow paulmelnikow added the service-badge New or updated service badge label Apr 17, 2017
@laughedelic
Copy link

Still a problem. From the example on shields.io:

screen shot 2017-09-25 at 14 39 07

@paulmelnikow paulmelnikow added the operations Hosting, monitoring, and reliability for the production badge servers label Nov 8, 2017
@remmeier
Copy link

any update?

echebbi added a commit to echebbi/eclipse-discord-integration that referenced this issue May 28, 2018
For some reason, the Shields badge displays _invalid_. See [related issue](badges/shields#658).
@paulmelnikow
Copy link
Member

Copying from above: I think the way to resolve this long-standing issue is to set up a recurring test over a week or more, and send documentation of the failures to their support. If anyone is game, would be great to have your help!

@tovbinm
Copy link

tovbinm commented Aug 16, 2018

Just FYI, Bintray seem to have their own badge now. But it would still be nice to have the Shields one.

@enveeed
Copy link

enveeed commented Mar 13, 2019

It is possible to use the Shields badge via the dynamic endpoint using the URL for the Bintray API and query=name, which seems to work for me when the normal bintray badge displays 'invalid', e.g. using

https://bintray.com/api/v1/packages/asciidoctor/maven/asciidoctorj/versions/_latest
https://img.shields.io/badge/dynamic/json.svg?label=latest&query=name&style=flat-square&url=https%3A%2F%2Fapi.bintray.com%2Fpackages%2Fasciidoctor%2Fmaven%2Fasciidoctorj%2Fversions%2F_latest

dynamic
https://img.shields.io/badge/dynamic/

bintray
https://img.shields.io/bintray/

pouar added a commit to pouar/yadfa that referenced this issue May 4, 2019
@Andre601
Copy link

I can confirm that this issue still exists.

@calebcartwright
Copy link
Member

Interestingly enough, it seems that the API call we use does not require any authentication for public packages:

https://bintray.com/docs/api/#_get_version
https://bintray.com/api/v1/packages/asciidoctor/maven/asciidoctorj/versions/_latest

And when I remove auth in our call, the badges work just fine

async fetch({ subject, repo, packageName }) {
// https://bintray.com/docs/api/#_get_version
return this._requestJson({
schema,
url: `https://bintray.com/api/v1/packages/${subject}/${repo}/${packageName}/versions/_latest`,
options: { auth: this.authHelper.basicAuth },
})
}

@calebcartwright
Copy link
Member

calebcartwright commented Oct 18, 2019

False alarm (some fluke in my local env). However, it does seem that the bintray badges are working fine in other environments, like staging:

https://shields-staging.herokuapp.com/bintray/v/asciidoctor/maven/asciidoctorj

So my guess is that in production we're either:

  1. Configured with bintray auth which is then being unnecssarily included in the requests to the bintray APIs (and AFAICT when tokens are used they are rate limited, even if the token is not needed, https://bintray.com/docs/api/#_authentication)
  2. Requests from the badge servers to the bintray API are being throttled/blocked

@calebcartwright
Copy link
Member

calebcartwright commented Oct 18, 2019

@paulmelnikow - do you know if we have bintray_user and/or bintray_apikey set on the prod badge servers?

@paulmelnikow
Copy link
Member

Yes, they are both set. I think the auth was added not for private projects, but because it provided a higher rate limit.

We could try creating a second token and an auth pool for Bintray… though maybe they could give us a megatoken instead? Has anyone managed to reach them?

@calebcartwright
Copy link
Member

calebcartwright commented Oct 19, 2019

I'm thinking we may be able to solve this by unsetting bintray_user and bintray_apikey on the badge servers.

Support for bintray goes way back in Shields' history, so apologies if I've missed any relevant threads or discussion.

From what I can tell, when bintray support was first added, the bintray API we use to get the latest version required authentication (like the Wheelmap and SymfonyInsight services do)
#58
#517

As such, our calls were subject to the rate limits imposed by JFrog

The current limit per non-Premium user is 300 queries a day, and 1440 per month. Limits are returned in the X-RateLimit headers.

However, at some point over the years, JFrog made the bintry API available anonymously and non-rate limited for public packages (private packages still require auth), which would explain the response from the JFrog Support team that was shared above

https://bintray.com/docs/api/#_get_version

Security: Authenticated user with 'read' permission for private repositories, or version read entitlement.

For example:
https://bintray.com/api/v1/packages/asciidoctor/maven/asciidoctorj/versions/_latest

{ 
  "name":"2.1.0",
  "desc":null,
  "package":"asciidoctorj",
  "repo":"maven",
  "owner":"asciidoctor",
  "labels":[ 
    "asciidoctor",
    "java",
    "asciidoctorj",
    "asciidoc",
    "jruby"
  ],
  "published":true,
  "attribute_names":[ 

  ],
  "created":"2019-06-22T16:33:07.367Z",
  "updated":"2019-06-22T16:48:02.333Z",
  "released":"",
  "ordinal":36.0,
  "rating_count":0
}

Since we've got bintray auth configured on the badge servers, we're (IMO) unnecessarily authenticating and subjecting our calls to rate limiting which is resulting in the flaky badge behavior we are seeing.

There is another issue (#1193) requesting bintray download count badges, and the bintray APIs needed for download stats will require auth, but I think we can tackle the auth/rate limiting over there.

@paulmelnikow
Copy link
Member

Okay, I'm game to remove the credentials on the next deploy and see how it goes!

@calebcartwright
Copy link
Member

🤞

@calebcartwright
Copy link
Member

Were the creds removed on the last deploy? If so I'll try to keep checking on the badges to see if we get any more invalid's

@paulmelnikow
Copy link
Member

paulmelnikow commented Oct 22, 2019

Yes, they were. I'm rolling back the code now, but the creds will remain unset.

@calebcartwright
Copy link
Member

AFAICT the bintray badges have been consistently working since we removed the creds. Has anyone seen anymore invalid badges in the last 4 days?

@calebcartwright
Copy link
Member

It's been over a week since the change was made and it appears this has been resolved. I'm going to close this issue out accordingly

@mpetuska
Copy link
Contributor

Could potentially be replaced with https://bintray.com/api/ui/package/:subject/:repo/:package which returns a lot of info including {..., "latestVersion": "x.y.z-M..."}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend needs-upstream-help Not actionable without help from a service provider operations Hosting, monitoring, and reliability for the production badge servers service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests