-
Notifications
You must be signed in to change notification settings - Fork 2
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
bbr::use_bbi() fails #317
Comments
Thanks for submitting this @bmreilly and for posting those screenshots. We're looking into this now and we'll let you know when we figure out the source of this. |
Can you please try running these three commands (in order) in your R console, and let me know if you receive an error on any of them:
|
Thanks for trying that. Are you able to visit this link in your browser? (It should take you to a page of JSON text.)
|
Regardless of the result of that, can you also try visiting this link in your browser (it should prompt you to download a zip file, you can press Cancel - I just want to see if you will even get prompted):
Thanks again for bringing this issue to our attention. |
Thanks for doing that. I was wondering if it was a firewall blocking the link, but that is not the case (at least at the browser level). I am going to keep investigating. |
What is a good email to reach you at? (I am thinking live debugging may help here.) |
On our call we discovered that the error is isolated to this piece, indicating that there is an issue downloading/accessing the bbi latest release via the github API:
For posterity, this is on Metworx 21.08.3 using the following R / OS version:
|
Perfect, thank you for providing this @bmreilly. This will help us find the issue. |
Thanks both of you. We'll keep looking into this. I'll just add a few relevant points:
|
Yes, that'd be my bet (more details below).
Hmm I'm not following why that would rule it out. The rate-limiting for unauthenticated requests (as they are for demo of triggering the error after exceeding request limitHere's a demonstration that I can trigger a consistent error by exhausting my limit. $ while :; do sleep 0.1 && \
curl -fSsL https://api.github.com/repos/metrumresearchgroup/bbi/releases/latest >/dev/null || \
break; done
curl: (22) The requested URL returned error: 403
# confirm I am at limit
$ curl -fsSL https://api.github.com/rate_limit | jq .rate
{
"limit": 60,
"remaining": 0,
"reset": 1713207165,
"used": 60,
"resource": "core"
}
use_bbi("foo")
#> Installing bbi on a linux system
#> ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
#> Error: lexical error: invalid char in json text.
#> /tmp/Rtmps2hjoB/file74526c727e66
#> (right here) ------^
#> In addition: Warning message:
#> In download.file(glue("https://api.github.com/repos/{owner}/{repo}/releases/latest"), :
#> cannot open URL 'https://api.github.com/repos/metrumresearchgroup/bbi/releases/latest': HTTP status was '403 Forbidden' follow-up questionsThat doesn't necessarily mean this is what @bmreilly is hitting into, but I think it's the most likely culprit.
|
Thanks for checking in on this @kyleam
I was forgetting about the "per IP" part, hence my earlier misfire on dismissing this as the problem. Still... it seems weird to me that several users would stumble onto this around the same time. Unless, as you suggest, they're doing something else (perhaps unintentionally) that's hitting the API too. In terms of the error handling, Eric and I noticed that too. I think those improvements are a good idea, no matter what the underlying cause here is. |
Here is the output of the command:
Looks like I have exhausted my allowed requests. I don't know of any other processes that would hit the github API with unauthenticated requests, let alone 60 per hour. Do you have any idea how I could search for processes that are doing this? |
As an additional test, I started a new workflow with a different IP address and I got the same issue as above. I'm not exactly sure what this means, but I'm more confident that the github API requests were not due to something custom I had done. |
@bmreilly Thanks for the additional information.
Right, it seems unlikely to be triggered directly by you. I suspect that all (or some subset) of workflows on your private subnet are configured in a way that they share the same public IP address (see here for a description of AWS NAT gateways). I believe you'd have to check with admins on your end about the details of the networking configuration. A shared public IP for many workflows would make it less surprising that you're regularly exceeding the limit, although I still find it somewhat surprising. It's hard to say, though, and it just takes one user regularly hitting the public GitHub API with, say, an automated script. Anyway, we're planning on making some adjustment to avoid failing due to the a. deposit binaries and latest release info somewhere else to avoid the rate limit (solution mentioned above) b. deposit just the latest version info elsewhere because that's what is being rate-limited, not the release tarball itself c. get the latest version another way if pinging For a, the high-level steps would be something like:
For b, the publish elsewhere could be placing, say, a json file on a gh-pages site (which we're planning to setup soon anyway for another purpose). And then we'd have to update For c, the main "another way" that comes to mind is using ls-remote:
Then I'm undecided on which of those I think is the best way to go but am currently leaning toward b. |
Recently I tried to use
bbr::use_bbi()
and I am getting a JSON parsing error. I'm wondering if the location of files to download has changed and needs to be updated?It looks like it is coming from
bbr:::current_release_url(owner = 'metrumresearchgroup', repo = 'bbi')
The text was updated successfully, but these errors were encountered: