-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug]: Cannot use repository on Github Enterprise instance with rate limiting disabled. #321
Comments
Thanks for the bug report. As I don't have any GitHub enterprise, it will be hard for me to fix it. I understand it's a uncaught error around the rate limit, so I will try to fix it in beta. I will return to you when I tried one fix in beta. You should install the plugin with BRAT to test it. |
Do you know which is the status / error code returned? So I can caught this specific error. I couldn't get any help in the documentation :/ |
GHE returns
|
Thank you. I released a beta update with an attempt to fix this error! The beta version is BRAT
|
Version What I found is that this I fixed things but updating line if settings.github.api.tiersForApi === GithubTiersVersion.entreprise && error.name === "HttpError" && error.status === 404 && error.response.data === "Rate limiting is not enabled." return 5000; n.b. I put the enterprise test first so that short-circuiting will ignore the other conditions if GHE is not being used. |
Thanks, will update the code :) |
I released the last version in beta! |
My apologies -- there was an error in my previous comment. This line should actually read: && (error as any).response.data.message === "Rate limiting is not enabled."
// ^^^^^^^ i.e. |
Looks like you switched up 2 of the identifiers on line 456; you have Here's the complete {
"name": "HttpError",
"status": 404,
"response": {
"url": "https://redacted.hostname.tld/api/v3/rate_limit",
"status": 404,
"headers": {
"cache-control": "no-cache",
"content-type": "application/json; charset=utf-8",
"x-accepted-oauth-scopes": "",
"x-github-media-type": "github.v3; format=json",
"x-github-request-id": "bbd23232-9b29-402e-bd1c-057acb0e9dd2",
"x-oauth-scopes": "gist, read:org, repo"
},
"data": {
"message": "Rate limiting is not enabled.",
"documentation_url": "https://docs.github.com/[email protected]/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user"
}
},
"request": {
"method": "GET",
"url": "https://redacted.hostname.tld/api/v3/rate_limit",
"headers": {
"accept": "application/vnd.github.v3+json",
"user-agent": "octokit-core.js/4.2.4 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.5.8 Chrome/120.0.6099.283 Electron/28.2.3 Safari/537.36",
"authorization": "token [REDACTED]"
},
"request": {}
}
} |
Argh, sorry. |
Should be fixed with -4 version in beta |
Looks good to me! Thank you. |
Issue validation
Command used
Upload single current active note, Test the connection to the configured repository
Plugin version
7.0.2
Describe the bug
This Obsidian plugin cannot be used with a Github Enterprise instance where rate limiting has been disabled. When I attempt to do so, the Obsidian console log generates the following messages:
This is against an internal (corporate) GHE instance that has no rate limiting -- as indicated by the following output from executing
gh api --verbose /rate_limit
against the enterprise server:This same command is successful when executed against
api.github.com
:How to reproduce ?
Minimal Reproducible Example
Configuration
Relevant log output
plugin:obsidian-mkdocs-publisher:21 [GitHub Publisher](qn.eval): Repository Tim-Peoples/project-status exists. Now testing the main branch. plugin:obsidian-mkdocs-publisher:21 [GitHub Publisher](main): HttpError: Rate limiting is not enabled. at eval (plugin:obsidian-mkdocs-publisher:17:43928)
OS
No response
Anything else?
No response
Obsidian information
The text was updated successfully, but these errors were encountered: