Closed AlanCoding closed 1 month ago
This is chasing a traceback I got hints of. We couldn't reproduce it at first, but the double-nested derived model got it.
Documenting practices related to this fix, we have to deal with different values of this setting:
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
And we have to deal with different databases (postgres vs. sqlite3).
AAH-3319
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/lib64/python3.11/contextlib.py", line 81, in inner pulp-1 | return func(*args, **kwds) pulp-1 | ^^^^^^^^^^^^^^^^^^^ pulp-1 | File "/src/galaxy_ng/galaxy_ng/app/api/v3/viewsets/namespace.py", line 93, in destroy pulp-1 | self.perform_destroy(namespace) pulp-1 | File "/usr/local/lib/python3.11/site-packages/rest_framework/mixins.py", line 95, in perform_destroy pulp-1 | instance.delete() pulp-1 | File "/usr/lib64/python3.11/contextlib.py", line 81, in inner pulp-1 | return func(*args, **kwds) pulp-1 | ^^^^^^^^^^^^^^^^^^^ pulp-1 | File "/usr/local/lib/python3.11/site-packages/django_lifecycle/mixins.py", line 205, in delete pulp-1 | value = super().delete(*args, **kwargs) pulp-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pulp-1 | File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 1132, in delete pulp-1 | return collector.delete() pulp-1 | ^^^^^^^^^^^^^^^^^^ pulp-1 | File "/usr/local/lib/python3.11/site-packages/django/db/models/deletion.py", line 512, in delete pulp-1 | signals.post_delete.send( pulp-1 | File "/usr/local/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 176, in send pulp-1 | return [ pulp-1 | ^ pulp-1 | File "/usr/local/lib/python3.11/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp> pulp-1 | (receiver, receiver(signal=self, sender=sender, **named)) pulp-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pulp-1 | File "/src/django-ansible-base/ansible_base/rbac/triggers.py", line 260, in rbac_post_delete_remove_object_roles pulp-1 | get_evaluation_model(instance).objects.filter(content_type_id=ct.id, object_id=instance.pk).delete() pulp-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pulp-1 | File "/src/django-ansible-base/ansible_base/rbac/models.py", line 740, in get_evaluation_model pulp-1 | raise RuntimeError(f'Model {cls._meta.model_name} primary key type of {pk_field} is not supported') pulp-1 | RuntimeError: Model collectionimport primary key type of ansible.CollectionImport.task is not supported
Issues 0 New issues 0 Accepted issues
Measures 0 Security Hotspots 86.7% Coverage on New Code 0.0% Duplication on New Code
See analysis details on SonarCloud
This is chasing a traceback I got hints of. We couldn't reproduce it at first, but the double-nested derived model got it.
Documenting practices related to this fix, we have to deal with different values of this setting:
And we have to deal with different databases (postgres vs. sqlite3).
AAH-3319