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

api/v1/imports: change task.kwargs to enc_kwargs #2103

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Mar 21, 2024

pulpcore changed Task kwargs to enc_kwargs, updating v1 serializers

(follows #2099)

Fixes:

pulp_1          | AttributeError: 'Task' object has no attribute 'kwargs'
pulp_1          | pulp [f8ef146e15464fab96da675ac0d5b750]: django.request:ERROR: Internal Server Error: /api/automation-hub/v1/imports/
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 125, 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 "/src/galaxy_ng/galaxy_ng/app/api/v1/viewsets/roles.py", line 250, in list
pulp_1          |     return super(LegacyRoleImportsViewSet, self).list(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 768, in data
pulp_1          |     ret = super().data
pulp_1          |           ^^^^^^^^^^^^
pulp_1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 253, 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 686, in to_representation
pulp_1          |     return [
pulp_1          |            ^
pulp_1          |   File "/usr/local/lib/python3.11/site-packages/rest_framework/serializers.py", line 687, 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/rest_framework/serializers.py", line 522, 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 1838, in to_representation
pulp_1          |     return method(value)
pulp_1          |            ^^^^^^^^^^^^^
pulp_1          |   File "/src/galaxy_ng/galaxy_ng/app/api/v1/serializers.py", line 769, in get_summary_fields
pulp_1          |     'request_username': task.kwargs.get('request_username'),
pulp_1          |                         ^^^^^^^^^^^
pulp_1          | AttributeError: 'Task' object has no attribute 'kwargs'

during GET /api/v1/imports/

(for some reason, despite https://github.com/pulp/pulpcore/blob/3.49/pulpcore/app/migrations/0114_remove_task_args_remove_task_kwargs.py running, enc_kwargs is None for previously created tasks, but new tasks work as expected)

pulpcore changed this, updating v1 serializers

No-Issue
@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 Mar 21, 2024
@rochacbruno rochacbruno 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 Mar 21, 2024
@himdel himdel merged commit 6af55dc into ansible:master Mar 25, 2024
25 of 29 checks passed
@himdel himdel deleted the fix-task-kwargs branch March 25, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants