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

A pulp containernamespace assignment has no reverse_args. #2240

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

jctanner
Copy link
Collaborator

@jctanner jctanner commented Aug 21, 2024

https://issues.redhat.com/browse/AAH-3368

pulp-1          | pulp [ee6c528f05374bd0973af0bf7ecc8dff]: django.request:ERROR: Internal Server Error: /api/galaxy/_ui/v2/role_user_assignments/                                              
pulp-1          | Traceback (most recent call last):                                           
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner                                                                        
pulp-1          |     response = get_response(request)                                         
pulp-1          |                ^^^^^^^^^^^^^^^^^^^^^                                         
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response                                                                    
pulp-1          |     response = wrapped_callback(request, *callback_args, **callback_kwargs)                                                                                                  
pulp-1          |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                  
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view                                                                   
pulp-1          |     return view_func(*args, **kwargs)                                        
pulp-1          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^                                        
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/viewsets.py", line 124, in view                                                                               
pulp-1          |     return self.dispatch(request, *args, **kwargs)                                                                                                                           
pulp-1          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                           
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch                                                                              
pulp-1          |     response = self.handle_exception(exc)                                    
pulp-1          |                ^^^^^^^^^^^^^^^^^^^^^^^^^^                                    
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception                                                                      
pulp-1          |     self.raise_uncaught_exception(exc)                                       
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception                                                              
pulp-1          |     raise exc                                                                
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch                                                                              
pulp-1          |     response = handler(request, *args, **kwargs)                             
pulp-1          |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                             
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 43, in list                                                                                  
pulp-1          |     return self.get_paginated_response(serializer.data)                                                                                                                      
pulp-1          |                                        ^^^^^^^^^^^^^^^                                                                                                                       
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 795, in data                                                                            
pulp-1          |     ret = super().data                                                       
pulp-1          |           ^^^^^^^^^^^^                                                       
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 249, in data                                                                            
pulp-1          |     self._data = self.to_representation(self.instance)                                                                                                                       
pulp-1          |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                       
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 713, in to_representation                                                               
pulp-1          |     return [                                                                 
pulp-1          |            ^                                                                 
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 714, in <listcomp>                                                                      
pulp-1          |     self.child.to_representation(item) for item in iterable                                                                                                                  
pulp-1          |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                       
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/ansible_base/lib/serializers/common.py", line 74, in to_representation                                                       
pulp-1          |     ret = super().to_representation(obj)                                     
pulp-1          |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                     
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 538, in to_representation                                                               
pulp-1          |     ret[field.field_name] = field.to_representation(attribute)                                                                                                               
pulp-1          |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                               
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/fields.py", line 1872, in to_representation                                                                   
pulp-1          |     return method(value)                                                     
pulp-1          |            ^^^^^^^^^^^^^                                                     
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/ansible_base/rbac/api/serializers.py", line 289, in _get_related                                                             
pulp-1          |     if related_url := get_url_for_object(content_obj):                                                                                                                       
pulp-1          |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                        
pulp-1          |   File "/usr/local/lib/python3.11/site-packages/ansible_base/lib/abstract_models/common.py", line 29, in get_url_for_object                                                  
pulp-1          |     return obj.get_absolute_url()                                            
pulp-1          |            ^^^^^^^^^^^^^^^^^^^^^^                                            
pulp-1          |   File "/src/galaxy_ng/galaxy_ng/app/__init__.py", line 162, in get_absolute_url                                                                                             
pulp-1          |     kwargs = {k: getattr(obj, k) for k in reverse_args}                                                                                                                      
pulp-1          |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                      
pulp-1          |   File "/src/galaxy_ng/galaxy_ng/app/__init__.py", line 162, in <dictcomp>                                                                                                   
pulp-1          |     kwargs = {k: getattr(obj, k) for k in reverse_args}                                                                                                                      
pulp-1          |                  ^^^^^^^^^^^^^^^                                             
pulp-1          | AttributeError: 'ContainerRepository' object has no attribute 'base_path'                                                                                                    
pulp-1          | ('pulp [ee6c528f05374bd0973af0bf7ecc8dff]: ::ffff:127.0.0.1 - admin [21/Aug/2024:15:07:00 +0000] "GET /api/galaxy/_ui/v2/role_user_assignments/ HTTP/1.0" 500 194013 "-" "curl/7.76.1"',)

Fixes a traceback when fetching the _ui/v2/role_user_assignments/ endpoint
after making an EE owner via the old pulp APIs.

No-Issue

Signed-off-by: James Tanner <[email protected]>
@github-actions github-actions bot added backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) backport-4.9 This PR should be backported to stable-4.9 (2.4) labels Aug 21, 2024
@jctanner jctanner removed backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) backport-4.9 This PR should be backported to stable-4.9 (2.4) labels Aug 21, 2024
@jctanner jctanner merged commit 9a5ad88 into ansible:master Aug 21, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant