Navigation Menu

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

[BUG] Container token secret error #834

Closed
git-hyagi opened this issue Dec 19, 2022 · 0 comments · Fixed by #835
Closed

[BUG] Container token secret error #834

git-hyagi opened this issue Dec 19, 2022 · 0 comments · Fixed by #835
Assignees
Labels
bug Something isn't working go-alpha Go-based operator issues prio-list Issue with high priority and no assigners

Comments

@git-hyagi
Copy link
Collaborator

Describe the bug
Panic when trying to configure container token:

pulp [ea43c64ce37f4cb1a7fd13a579446490]: django.request:ERROR: Internal Server Error: /token/
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pulp_container/app/registry_api.py", line 372, in get
    data = authorization_service.generate_token()
  File "/usr/local/lib/python3.8/site-packages/pulp_container/app/authorization.py", line 69, in generate_token
    with open(settings.PUBLIC_KEY_PATH, "rb") as public_key:
IsADirectoryError: [Errno 21] Is a directory: '/etc/pulp/keys/container_auth_public_key.pem'

To Reproduce
Steps to reproduce the behavior:
Configure Pulp CR with container token auth:

...
spec:
  container_auth_private_key_name: container_auth_private_key.pem
  container_auth_public_key_name: container_auth_public_key.pem
  container_token_secret: pulp-container-auth
...

make a request to token service:

$ PULP_PWD=$(oc extract secret/pulp-admin-password --to=-)
$ oc exec deployment/pulp-api -- curl -i -su admin:${PULP_PWD}  'http://localhost:24817/token/?service=api'
HTTP/1.1 500 Internal Server Error
Server: gunicorn
Date: Mon, 19 Dec 2022 17:50:03 GMT
Connection: close
Content-Type: text/html
X-Frame-Options: DENY
Content-Length: 145
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Correlation-ID: d324945d0260416abdd299144fb93841
Access-Control-Expose-Headers: Correlation-ID

the panic from the issue description will appear in pulp-api pod logs.

@git-hyagi git-hyagi added bug Something isn't working go-alpha Go-based operator issues prio-list Issue with high priority and no assigners labels Dec 19, 2022
@git-hyagi git-hyagi self-assigned this Dec 19, 2022
git-hyagi added a commit to git-hyagi/pulp-operator that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go-alpha Go-based operator issues prio-list Issue with high priority and no assigners
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant