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

Error reporting fails with faulty GH token #190

Open
DilumAluthge opened this issue Jan 10, 2021 · 1 comment
Open

Error reporting fails with faulty GH token #190

DilumAluthge opened this issue Jan 10, 2021 · 1 comment
Labels
bug Something isn't working rewrite Will be done in the Julia rewrite of TagBot (see #55), but not before.

Comments

@DilumAluthge
Copy link
Member

I found an example of an Error: TagBot experienced an unexpected internal failure.

But then also, the error reporting failed as well with Error: Issue reporting failed.

Log: https://github.com/qojulia/CollectiveSpins.jl/runs/1676244536

Error: TagBot experienced an unexpected internal failure
Traceback (most recent call last):
  File "/root/tagbot/action/__main__.py", line 65, in <module>
    if not repo.is_registered():
  File "/root/tagbot/action/repo.py", line 317, in is_registered
    root = self._registry_path
  File "/root/tagbot/action/repo.py", line 100, in _registry_path
    contents = self._only(self._registry.get_contents("Registry.toml"))
  File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 1758, in get_contents
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 342, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

Error: Issue reporting failed
Traceback (most recent call last):
  File "/root/tagbot/action/__main__.py", line 65, in <module>
    if not repo.is_registered():
  File "/root/tagbot/action/repo.py", line 317, in is_registered
    root = self._registry_path
  File "/root/tagbot/action/repo.py", line 100, in _registry_path
    contents = self._only(self._registry.get_contents("Registry.toml"))
  File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 1758, in get_contents
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 342, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/tagbot/action/repo.py", line 473, in handle_error
    self._report_error(trace)
  File "/root/tagbot/action/repo.py", line 300, in _report_error
    if self._repo.private or os.getenv("GITHUB_ACTIONS") != "true":
  File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 642, in private
    self._completeIfNotSet(self._private)
  File "/usr/local/lib/python3.8/site-packages/github/GithubObject.py", line 299, in _completeIfNotSet
    self._completeIfNeeded()
  File "/usr/local/lib/python3.8/site-packages/github/GithubObject.py", line 303, in _completeIfNeeded
    self.__complete()
  File "/usr/local/lib/python3.8/site-packages/github/GithubObject.py", line 310, in __complete
    headers, data = self._requester.requestJsonAndCheck("GET", self._url.value)
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 342, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

@DilumAluthge DilumAluthge added the bug Something isn't working label Jan 10, 2021
@christopher-dG
Copy link
Member

They're using a Documenter key as the GH token

User error, but there's indeed a reporting bug: we can't check if the repo is private with bad credentials.
I'm leaning towards not reporting in this case, since it's potentially very bad to leak information about private repos.
If we really wanted to be correct, we could add another endpoint to the error reporting API that looked up the repo with its own token.

@christopher-dG christopher-dG changed the title Error: TagBot experienced an unexpected internal failure Error reporting fails with faulty GH token Jan 11, 2021
@christopher-dG christopher-dG added the rewrite Will be done in the Julia rewrite of TagBot (see #55), but not before. label Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rewrite Will be done in the Julia rewrite of TagBot (see #55), but not before.
Projects
None yet
Development

No branches or pull requests

2 participants