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 when calling ape plugins list #2363

Closed
2 tasks done
fubuloubu opened this issue Nov 1, 2024 · 4 comments · Fixed by #2365
Closed
2 tasks done

Error when calling ape plugins list #2363

fubuloubu opened this issue Nov 1, 2024 · 4 comments · Fixed by #2365
Labels
category: bug Something isn't working

Comments

@fubuloubu
Copy link
Member

Have you ensured that all of these are up to date?

  • Ape
  • Ape plugins

What version of Ape are you on?

0.8.19

What command(s) is the bug in?

ape plugins list

Operating System

Linux

Description

$ ape plugins list
Traceback (most recent call last):
  File "~/.local/bin/ape", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "site-packages/ape/_cli.py", line 113, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/ape_plugins/_cli.py", line 115, in _list
    metadata = PluginMetadataList.load(cli_ctx.plugin_manager)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/ape/plugins/_utils.py", line 208, in load
    plugins = plugins.union(github_client.available_plugins)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "site-packages/ape/utils/_github.py", line 98, in available_plugins
    return {
           ^
  File "site-packages/ape/utils/_github.py", line 98, in <setcomp>
    return {
           ^
  File "site-packages/ape/utils/_github.py", line 107, in get_org_repos
    response = self._get(f"orgs/{self.ORGANIZATION_NAME}/repos", params=params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/ape/utils/_github.py", line 222, in _get
    return self._request("GET", url, params=params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "site-packages/ape/utils/_github.py", line 227, in _request
    response.raise_for_status()
  File "site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.github.com/orgs/ApeWorX/repos?per_page=100&page=1

Reproduction code

ape plugins list
@fubuloubu fubuloubu added the category: bug Something isn't working label Nov 1, 2024
Copy link

linear bot commented Nov 1, 2024

@fubuloubu
Copy link
Member Author

I appear to be getting this with older versions, thinking this is just the lack of a good error message or fallback handling

@fubuloubu
Copy link
Member Author

ah, my token was expired

@antazoey
Copy link
Member

antazoey commented Nov 1, 2024

The token shouldnt even be necessary since you didnt do --all, so will fix that
will be perf as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants