AutoActuary / app-builder

Next iteration of deploy-scripts
0 stars 0 forks source link

Github Token validation can result in: 404 Client Error: Not Found for url #42

Open heetbeet opened 4 months ago

heetbeet commented 4 months ago

image

File "C:\Users\guyelad\AppData\Local\autoactuary\app-builder\versions\v0.4.1\site-packages\github_release.py", line 171, in _recursive_gh_get
    response.raise_for_status()
File "C:\Users\guyelad\AppData\Local\autoactuary\app-builder\versions\v0.4.1\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/VirtualActuary/RMA-Funeral-Parlour-Pricing-Tool/releases

The error message shown indicates that a 404 (Not Found) HTTP error was raised when trying to access a specific GitHub URL using a GitHub token. This can happen for several reasons:

  1. Invalid or Expired Token: GitHub tokens have a validity period. If the token has expired or has been revoked, it will no longer have the permissions to access the URL.

  2. Changes in Repository URL or Permissions: If the repository URL has changed or if the permissions associated with the token do not allow access to the specified URL, a 404 error can occur.

  3. Repository Deletion or Renaming: The repository you are trying to access might have been deleted or renamed, resulting in a 404 error when the old URL is used.

  4. Scope of the Token: The scope of the GitHub token might not include the necessary permissions to access the repository's releases. Ensure that the token has the correct scope for the operations you are performing.

  5. Network or API Issues: Temporary network issues or changes in the GitHub API could also cause such errors.

In this specific case, if creating a new GitHub token resolves the issue, it is likely that the previous token had expired, been revoked, or its permissions were insufficient.

To troubleshoot and fix this issue, you can:

Would you like help with generating a new GitHub token or updating the token in your application?

heetbeet commented 4 months ago

The user have no idea why they get an error or how to fix it.

Recommendation: If the token is invalid, it's useless. The approach for another such type error was to just go ahead and delete the token so that the token issuing gets reset. Let's do the same here

Further recommendation: For any other errors that occurs during the Github token process, let the user at least know there is a token cached and that token can be deleted. Something like Delete file tools/.github_token and see if that resets the GitHub authentication