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

Can't publish an rpm publication when using rbac #3381

Closed
jlsherrill opened this issue Jan 16, 2024 · 1 comment · Fixed by #3382 or pulp/pulp-service#37
Closed

Can't publish an rpm publication when using rbac #3381

jlsherrill opened this issue Jan 16, 2024 · 1 comment · Fixed by #3382 or pulp/pulp-service#37
Labels

Comments

@jlsherrill
Copy link
Contributor

Version
pulp-ubi container image 39a9398

Describe the bug
When trying to create an rpm publication I'm getting a traceback:

ulp [0ed4752d7e7d49b9ae99506f9e8fe4f9]: django.request:ERROR: Internal Server Error: /pulp/edc307cb/api/v3/publications/rpm/rpm/
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/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.8/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/viewsets.py", line 125, 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 497, in dispatch
self.initial(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pulpcore/app/viewsets/base.py", line 300, in initial
super().initial(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 415, in initial
self.check_permissions(request)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 332, in check_permissions
if not permission.has_permission(request, self):
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 69, in has_permission
allowed = self._evaluate_statements(statements, request, view, action)
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 113, in _evaluate_statements
matched = self._get_statements_matching_conditions(
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 262, in _get_statements_matching_conditions
passed = self._check_condition(condition, request, view, action)
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 286, in _check_condition
result = method(request, view, action, arg)
File "/usr/local/lib/python3.8/site-packages/pulpcore/app/global_access_conditions.py", line 292, in has_repo_attr_model_or_domain_or_obj_perms
return has_model_or_domain_perms(request, view, action, permission) or has_repo_attr_obj_perms(
File "/usr/local/lib/python3.8/site-packages/pulpcore/app/global_access_conditions.py", line 284, in has_repo_attr_obj_perms
plugin_repository = view.get_object().repository.cast()
File "/usr/local/lib/python3.8/site-packages/rest_framework/generics.py", line 88, in get_object
assert lookup_url_kwarg in self.kwargs, (
AssertionError: Expected view RpmPublicationViewSet to be called with a URL keyword argument named "pk". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly.

To Reproduce
Steps to reproduce the behavior:

I'll let @dkliban fill this in

Expected behavior
able to create a publication

Additional context
Add any other context about the problem here. Please provide links to any previous discussions via Discourse or Bugzilla.

@dkliban dkliban transferred this issue from pulp/pulpcore Jan 16, 2024
@dkliban
Copy link
Member

dkliban commented Jan 16, 2024

Looks like this issue is specific to the RPM plugin.

dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulp-service that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulp-service that referenced this issue Jan 16, 2024
This is a patch to fix pulp/pulp_rpm#3381

This change requires running migration.
dkliban added a commit to dkliban/pulp-service that referenced this issue Jan 16, 2024
This is a patch to fix pulp/pulp_rpm#3381

This change requires running migration.
dkliban added a commit to pulp/pulp-service that referenced this issue Jan 16, 2024
This is a patch to fix pulp/pulp_rpm#3381

This change requires running migration.
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 17, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 17, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 17, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 17, 2024
@dkliban dkliban reopened this Jan 17, 2024
dkliban added a commit to dkliban/pulp_rpm that referenced this issue Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
2 participants