Push container images to 'Pulp as single container'

Hi,
I’ve managed to create container repository and distribution on my pulp instance ( [multi-process container deployment). Now I’d like to push some image there but get the following error:

# podman login --tls-verify=false -u admin -p mypassword localhost:24817
Error: authenticating creds for "localhost:24817": pinging container registry localhost:24817: received unexpected HTTP status: 500 Internal Server Error
#

I provide the same credentials I use for pulp cli.

Log from container:

pulp [4312bd0a7d8e45b49dcf1892df346215]: django.request:ERROR: Internal Server Error: /v2/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 497, in dispatch
    self.initial(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 415, in initial
    self.check_permissions(request)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 332, in check_permissions
    if not permission.has_permission(request, self):
  File "/usr/local/lib/python3.9/site-packages/pulp_container/app/token_verification.py", line 209, in has_permission
    raise NotAuthenticated()
rest_framework.exceptions.NotAuthenticated: {'errors': [{'code': 'UNAUTHORIZED', 'message': ErrorDetail(string='Authentication credentials were not provided.', code='not_authenticated'), 'detail': {}}]}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/pulp_container/app/registry_api.py", line 270, in handle_exception
    response = super().handle_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 456, in handle_exception
    auth_header = self.get_authenticate_header(self.request)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 190, in get_authenticate_header
    return authenticators[0].authenticate_header(request)
  File "/usr/local/lib/python3.9/site-packages/pulp_container/app/token_verification.py", line 149, in authenticate_header
    realm = settings.TOKEN_SERVER
  File "/usr/local/lib/python3.9/site-packages/dynaconf/base.py", line 145, in __getattr__
    value = getattr(self._wrapped, name)
  File "/usr/local/lib/python3.9/site-packages/dynaconf/base.py", line 328, in __getattribute__
    return super().__getattribute__(name)
AttributeError: 'HookableSettings' object has no attribute 'TOKEN_SERVER'
('pulp [4312bd0a7d8e45b49dcf1892df346215]: ::ffff:10.88.0.1 - - [15/May/2024:17:28:26 +0000] "GET /v2/ HTTP/1.1" 500 145 "-" "containers/5.26.2 (github.com/containers/image)"',)
pulp [2b286ab2d70c4997bdfd304fe0aa2875]: django.request:WARNING: Not Found: /v1/_ping
('pulp [2b286ab2d70c4997bdfd304fe0aa2875]: ::ffff:10.88.0.1 - - [15/May/2024:17:28:36 +0000] "GET /v1/_ping HTTP/1.1" 404 179 "-" "containers/5.26.2 (github.com/containers/image)"',)

Any hints? What is the proper way of pushing docker images to pulp?

It seems like you might be missing some settings needed by the container. Did you follow the instructions here for setting up Pulp: (Pulp in One Container | software repository management)? In particular I think you need the settings TOKEN_SERVER and TOKEN_SIGNATURE_ALGORITHM to both be set in your config file.

1 Like

Thanks gerrod,

I was able to disable token authentication with TOKEN_AUTH_DISABLED=True.

Basic authentication works fine. Now was able to push the image however I struggle with pulling it.Is there some documentation out there?

I’m following Push Content to a Repository — Pulp container Support 2.20.0 documentation

I’m able to login but http just fails with:

 <!doctype html>
<html lang="en">
<head>
  <title>Not Found</title>
</head>
<body>
  <h1>Not Found</h1><p>The requested resource was not found on this server.</p>
</body>
</html>

Is that /v2/ correct http GET $BASE_ADDR/v2/test/this/tags/list ?

Thanks

Ok you can ignore above. I was able to just pull it with podman pull now.

3 Likes