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

Unable to delete packages for user #132

Open
stumpylog opened this issue Apr 28, 2022 · 0 comments
Open

Unable to delete packages for user #132

stumpylog opened this issue Apr 28, 2022 · 0 comments

Comments

@stumpylog
Copy link

When using this API from within a GitHub Action, the API returns a 404 error when attempting to use delete_package_version_for_authenticated_user. However, doing a manual curl command to the same URL (with auth token) succeeded.

{'data': None,
 'full_url': 'https://api.github.com/user/packages/container/paperless-ngx/versions/16658258',
 'headers': {'Accept': 'application/vnd.github.v3+json'},
 'method': 'DELETE'}
    _main()
  File "/home/runner/work/paperless-ngx/paperless-ngx/.github/scripts/cleanup-tags.py", line 197, in _main
    api.packages.delete_package_version_for_authenticated_user(
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/ghapi/core.py", line 63, in __call__
    return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/ghapi/core.py", line 112, in __call__
    res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/fastcore/net.py", line 212, in urlsend
    return urlread(req, return_json=return_json, return_headers=return_headers)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/fastcore/net.py", line 113, in urlread
    if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
fastcore.basics.HTTP404NotFoundError: HTTP Error 404: Not Found

vs

curl -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ghp_*************" https://api.github.com/user/packages/container/paperless-ngx/versions/16658258

Previously in the same code, get_all_package_versions_for_package_owned_by_authenticated_user worked without issue, so I don't believe it is an access issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant