Bug 2127470
Summary: | Content view publish fails when the content view and repository both have a large name with : Error message: the server returns an error HTTP status code: 500 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | soham <smajumda> | ||||||
Component: | Pulp | Assignee: | satellite6-bugs <satellite6-bugs> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Vladimír Sedmík <vsedmik> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 6.11.3 | CC: | broose, dalley, dkliban, ggainey, iballou, ipanova, osousa, pcreech, pwaghmar, rchan, risantam, saydas, support.linux.ch, wclark | ||||||
Target Milestone: | 6.13.0 | Keywords: | Triaged | ||||||
Target Release: | Unused | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | pulp-container-2.9.9-1, pulp-container-2.10.10-1 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 2150119 2166761 (view as bug list) | Environment: | |||||||
Last Closed: | 2023-05-03 13:22:03 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
soham
2022-09-16 13:32:22 UTC
I checked out appropriate pulp-container and pulpcore branches and looked for max_length 150 which is the error is pointing to and did not find any results. @Ian any ideas where this might be coming from? I believe this is coming from the Django user model https://docs.djangoproject.com/en/4.1/ref/contrib/auth/#django.contrib.auth.models.User.username https://github.com/pulp/pulpcore/blob/dd352a39473bc8ccf37850ce0da568a813088975/pulpcore/app/serializers/user.py#L97 Or rather, perhaps a user is being saved somehow without going through that serializer first - thus resulting in the database-level error. I would think that if it hits the serializer, it would handle the error more gracefully. Ina points out: what does the user model have to do with publishing? I don't know, but I've looked everywhere and can't find anything else with a limit of 150 characters. @smajumda are you able to share the Dynflow output of the failing task so we can see exactly which part is failing and the Pulp backtrace for it? Like you all mentioned, I don't see how the Pulp User model could have anything to do with it. We don't create Pulp users from our code. Pulp folks, this is the data that gets fed into the distributions API to reproduce the issue (as an example): {:base_path=>"default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle", :repository_version=>"/pulp/api/v3/repositories/container/container/09248ad7-44c4-4761-917a-2734695f9eb6/versions/1/", :name=>"openshift4-wincw_windows-machine-config-operator-bundle-9307"} Looks like it's the base_path that's causing trouble. Traceback: Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: pulp [076c7a8b-e9c9-4a6f-a1a9-86a79675ad7e]: django.request:ERROR: Internal Server Error: /pulp/api/v3/distributions/container/container/ Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: Traceback (most recent call last): Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulp_container/app/serializers.py", line 41, in get_or_create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: result = cls.Meta.model.objects.get(**natural_key) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return getattr(self.get_queryset(), name)(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: raise self.model.DoesNotExist( Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: pulp_container.app.models.ContainerNamespace.DoesNotExist: ContainerNamespace matching query does not exist. Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: During handling of the above exception, another exception occurred: Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: Traceback (most recent call last): Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulp_container/app/serializers.py", line 41, in get_or_create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: result = cls.Meta.model.objects.get(**natural_key) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return getattr(self.get_queryset(), name)(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: raise self.model.DoesNotExist( Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: pulp_container.app.models.ContainerNamespace.DoesNotExist: ContainerNamespace matching query does not exist. Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: During handling of the above exception, another exception occurred: Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: Traceback (most recent call last): Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return self.cursor.execute(sql, params) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: psycopg2.errors.StringDataRightTruncation: value too long for type character varying(150) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: The above exception was the direct cause of the following exception: Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: Traceback (most recent call last): Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: response = get_response(request) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: response = wrapped_callback(request, *callback_args, **callback_kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return view_func(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return self.dispatch(request, *args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: response = self.handle_exception(exc) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: self.raise_uncaught_exception(exc) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: raise exc Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: response = handler(request, *args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulpcore/app/viewsets/base.py", line 448, in create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: serializer.is_valid(raise_exception=True) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/serializers.py", line 227, in is_valid Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: self._validated_data = self.run_validation(self.initial_data) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/serializers.py", line 429, in run_validation Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: value = self.validate(value) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulp_container/app/serializers.py", line 288, in validate Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: validated_data["namespace"] = ContainerNamespaceSerializer.get_or_create( Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulp_container/app/serializers.py", line 50, in get_or_create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: result = serializer.create(serializer.validated_data) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulpcore/app/serializers/base.py", line 184, in create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: instance = super().create(validated_data) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/rest_framework/serializers.py", line 962, in create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: instance = ModelClass._default_manager.create(**validated_data) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return getattr(self.get_queryset(), name)(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: obj.save(force_insert=True, using=self.db) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib64/python3.9/contextlib.py", line 79, in inner Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return func(*args, **kwds) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django_lifecycle/mixins.py", line 138, in save Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: self._run_hooked_methods(AFTER_CREATE, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django_lifecycle/mixins.py", line 255, in _run_hooked_methods Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: method(self) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django_lifecycle/decorators.py", line 77, in func Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: hooked_method(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulpcore/app/models/access_policy.py", line 76, in add_perms Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: permission_class.handle_creation_hooks(self) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulpcore/app/access_policy.py", line 63, in handle_creation_hooks Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: function(creation_hook.get("permissions"), creation_hook.get("parameters")) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/pulp_container/app/models.py", line 226, in create_namespace_group Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: group = Group.objects.create( Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return getattr(self.get_queryset(), name)(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: obj.save(force_insert=True, using=self.db) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib64/python3.9/contextlib.py", line 79, in inner Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return func(*args, **kwds) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django_lifecycle/mixins.py", line 134, in save Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: save(*args, **kwargs) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: self.save_base(using=using, force_insert=force_insert, Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: updated = self._save_table( Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: cursor.execute(sql, params) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return executor(sql, params, many, context) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return self.cursor.execute(sql, params) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__ Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: raise dj_exc_value.with_traceback(traceback) from exc_value Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: return self.cursor.execute(sql, params) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: django.db.utils.DataError: value too long for type character varying(150) Oct 4 14:35:29 sat-6-12-qa-rhel8 pulpcore-api[974]: pulp [076c7a8b-e9c9-4a6f-a1a9-86a79675ad7e]: - - [04/Oct/2022:14:35:29 +0000] "POST /pulp/api/v3/distributions/container/container/ HTTP/1.1" 500 145 "-" "OpenAPI-Generator/2.10.3/ruby" Clearing the needinfo since we can reproduce the issue. I'm not sure about that - "default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle" is still only 135 characters Here's the API way to test it in case it helps (just replace the repository version of course) curl -X POST https://`hostname`/pulp/api/v3/distributions/container/container/ -H 'Content-Type: application/json' -d '{"base_path":"default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle", "repository_version":"/pulp/api/v3/repositories/container/container/09248ad7-44c4-4761-917a-2734695f9eb6/versions/1/", "name":"openshift4-wincw_windows-machine-config-operator-bundle-9307"}' --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key If you shorten the name, it still fails. If you shorten the base_path, it works. Looks like the base_path is being appended/prepended to something perhaps? I can't speak to the container plugin but it works fine with the RPM plugin (pulp) [vagrant@pulp3-source-fedora36 ~]$ pulp rpm distribution create --name test2 --base-path "lsdfjkjhfkjadskfdsahfkjasfhsdkahfdksjahfkdsajhfkhdskdsjhdskjahfkjdsahfakdshfkdsahfkdsjhfksadhfkjadshfkjdsahfkjdshfkdsajhfkashfkjdsahfkdsajhfskdhfkadsjhfkdsahfksdahfksahfkdsjhfkahdsfsad-default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle" Started background task /pulp/api/v3/tasks/83955852-bc2d-435b-8a37-1a0683165312/ Done. { "pulp_href": "/pulp/api/v3/distributions/rpm/rpm/03a6ca9f-8c85-4d77-825b-fd18be3ab224/", "pulp_created": "2022-10-04T21:38:44.058660Z", "base_path": "lsdfjkjhfkjadskfdsahfkjasfhsdkahfdksjahfkdsajhfkhdskdsjhdskjahfkjdsahfakdshfkdsahfkdsjhfksadhfkjadshfkjdsahfkjdshfkdsajhfkashfkjdsahfkdsajhfskdhfkadsjhfkdsahfksdahfksahfkdsjhfkahdsfsad-default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle", "base_url": "http://pulp3-source-fedora36.thinkpad.example.com/pulp/content/lsdfjkjhfkjadskfdsahfkjasfhsdkahfdksjahfkdsajhfkhdskdsjhdskjahfkjdsahfakdshfkdsahfkdsjhfksadhfkjadshfkjdsahfkjdshfkdsajhfkashfkjdsahfkdsajhfskdhfkadsjhfkdsahfksdahfksahfkdsjhfkahdsfsad-default_organization-library-thisisaverybigcontentviewname-buttermilk_biscuits-openshift4-wincw_windows-machine-config-operator-bundle/", "content_guard": null, "pulp_labels": {}, "name": "test2", "repository": null, "publication": null } Created attachment 1925475 [details]
Hotfix RPM for Satellite 6.11.4 on RHEL7
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.11.4 server
2. Download the hotfix RPM for Satellite 6.11.4 attached to this BZ and copy it to Satellite server
3. # yum install ./tfm-pulpcore-python3-pulp-container-2.9.2-2.HOTFIXRHBZ2127470.el7pc.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
Created attachment 1925476 [details]
Hotfix RPM for Satellite 6.11.4 on RHEL8
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.11.4 server
2. Download the hotfix RPM for Satellite 6.11.4 attached to this BZ and copy it to Satellite server
3. # dnf install ./python38-pulp-container-2.9.2-2.HOTFIXRHBZ2127470.el8pc.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:2097 |