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: looper requires JWT for retrieving public PEP from PEPhub #516

Open
nsheff opened this issue Aug 22, 2024 · 5 comments
Open

Error: looper requires JWT for retrieving public PEP from PEPhub #516

nsheff opened this issue Aug 22, 2024 · 5 comments
Assignees
Labels
Milestone

Comments

@nsheff
Copy link
Contributor

nsheff commented Aug 22, 2024

I entered a registry path to a public PEP in my looper config.

I ran looper run and I get this error:

looper run -d -l 1 
Looper version: 2.0.0a1
Command: run
Using looper config (.looper.yaml).
Traceback (most recent call last):
  File "/home/nsheff/.local/bin/looper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/looper/cli_pydantic.py", line 352, in main
    return run_looper(args, parser, test_args=test_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/looper/cli_pydantic.py", line 221, in run_looper
    project_dict=PEPHubClient()._load_raw_pep(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/typing_extensions.py", line 2673, in wrapper
    return arg(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/pephubclient/pephubclient.py", line 272, in _load_raw_pep
    return self.load_raw_pep(registry_path, query_param)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/pephubclient/pephubclient.py", line 290, in load_raw_pep
    pephub_response = self.send_request(
                      ^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/pephubclient/helpers.py", line 56, in send_request
    raise ResponseError("JWT has expired. Please log in again.")
pephubclient.exceptions.ResponseError: JWT has expired. Please log in again.

It seems to me it should not error that my JWT has expired if I'm trying to do something that shouldn't need a JWT in the first place.

I'm not sure if this is a bug in looper, or PEPHubClient, or what.

@nsheff nsheff added the bug label Aug 22, 2024
@nsheff
Copy link
Contributor Author

nsheff commented Aug 22, 2024

Two things:

  • this shouldn't be a bug (it should not require log in to get a public PEP).
  • wherever this message is coming from, can we add to it instructions for how to log in? I don't have that memorized and people encountering this error will be like, "what?" Just add by running 'phc login' -- this means it's probably a pephubclient bug.

@nsheff
Copy link
Contributor Author

nsheff commented Aug 22, 2024

Maybe related to: pepkit/pephubclient#42

@donaldcampbelljr
Copy link
Contributor

I've added some exception messaging to alert the user that they can try running 'phc login' if they get a response error.

@nsheff
Copy link
Contributor Author

nsheff commented Aug 23, 2024

Ok -- I think you did that in the wrong spot though. That should be done in the PEPhubclient error, not here!

@nsheff
Copy link
Contributor Author

nsheff commented Aug 27, 2024

This appears to be a pephub API endpoint bug, actually. if it's public, why is it evaluating credentials? it should only evaluate the JWT if I'm requesting a private resource.

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

No branches or pull requests

3 participants