Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-428

when collection name is too long, publish fails and error is misleading

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.0, 4.4cloud02
    • 2.0
    • Backend
    • None
    • AAH Sprint 8, AAH Sprint 9

      SUMMARY

      when collection name is too long, publish fails and error is misleading

      STEPS TO REPRODUCE

       

      ansible-galaxy collection publish --ignore-certs /tmp/collection-build-SBqU8a/0/perftest-collection_aaaaaaaa_vm1_aaaaaaaaa_aaaaaaa_redhat_com-2.0.0.tar.gz

      EXPECTED RESULTS

      Error message should explain what went wrong - pulp_id attribute is set to None is not relevant to the actual problem.

      ACTUAL RESULTS

       

      {{# ansible-galaxy collection publish --ignore-certs /tmp/collection-build-SBqU8a/0/perftest-collection_aaaaaaaa_vm1_aaaaaaaaa_aaaaaaa_redhat_com-2.0.0.tar.gz
      Publishing collection artifact '/tmp/collection-build-SBqU8a/0/perftest-collection_aaaaaaaa_vm1_aaaaaaaaa_aaaaaaa_redhat_com-2.0.0.tar.gz' to published_repo https://aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com/api/galaxy/content/inbound-perftest/
      Collection has been published to the Galaxy server published_repo https://aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com/api/galaxy/content/inbound-perftest/
      Waiting until Galaxy import task https://aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com/api/galaxy/content/inbound-perftest/v3/imports/collections/319b656f-0bd1-46f5-8146-b0dd4f8f1192/ has completed
      ERROR! Galaxy import process failed: PulpTemporaryFile object can't be deleted because its pulp_id attribute is set to None. (Code: UNKNOWN)}}

      This is the traceback hidden in journal:

       

      Mar 11 05:56:58 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: pulp: rq.worker:INFO: 15756@dhcp159-71.sbu.lab.eng.bos.redhat.com: 69721332-57ac-433e-b50d-719385c22041
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: pulp: pulp_ansible.app.tasks.collections:INFO: Processing collection from tmp/files/0d/bb7e39-1847-4eb4-8b81-f9b00f5172f5
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: pulp: rq.worker:ERROR: Traceback (most recent call last):
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 153, in import_collection
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: collection_version = create_collection_from_importer(importer_result)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 214, in create_collection_from_importer
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: serializer.is_valid(raise_exception=True)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rest_framework/serializers.py", line 242, in is_valid
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: raise ValidationError(self.errors)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: rest_framework.exceptions.ValidationError: {'name': [ErrorDetail(string='Ensure this field has no more than 32 characters.', code='max_length')]}
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: During handling of the above exception, another exception occurred:
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: Traceback (most recent call last):
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: rv = job.perform()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: self._result = self._execute()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: return self.func(*self.args, **self.kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/galaxy_ng/app/tasks/publishing.py", line 47, in import_and_move_to_staging
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: expected_version=kwargs['expected_version'],
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 161, in import_collection
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: temp_file.delete()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulpcore/app/models/content.py", line 143, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: super().delete(*args, **kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 141, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: super().delete(*args, **kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 917, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: (self._meta.object_name, self._meta.pk.attname)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: AssertionError: PulpTemporaryFile object can't be deleted because its pulp_id attribute is set to None.
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: Traceback (most recent call last):
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 153, in import_collection
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: collection_version = create_collection_from_importer(importer_result)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 214, in create_collection_from_importer
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: serializer.is_valid(raise_exception=True)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rest_framework/serializers.py", line 242, in is_valid
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: raise ValidationError(self.errors)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: rest_framework.exceptions.ValidationError: {'name': [ErrorDetail(string='Ensure this field has no more than 32 characters.', code='max_length')]}
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: During handling of the above exception, another exception occurred:
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: Traceback (most recent call last):
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: rv = job.perform()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: self._result = self._execute()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: return self.func(*self.args, **self.kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/galaxy_ng/app/tasks/publishing.py", line 47, in import_and_move_to_staging
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: expected_version=kwargs['expected_version'],
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py", line 161, in import_collection
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: temp_file.delete()
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/pulpcore/app/models/content.py", line 143, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: super().delete(*args, **kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 141, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: super().delete(*args, **kwargs)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 917, in delete
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: (self._meta.object_name, self._meta.pk.attname)
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: AssertionError: PulpTemporaryFile object can't be deleted because its pulp_id attribute is set to None.
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: pulp: rq.worker:INFO: 15756@dhcp159-71.sbu.lab.eng.bos.redhat.com: f4b44cd6-62e9-4643-bc2e-9d3eb6535954
       Mar 11 05:56:59 aaaaaaaa-vm2-aaaaaaaaa.aaaaaaa.redhat.com rq[15756]: pulp: rq.worker:INFO: 15756@dhcp159-71.sbu.lab.eng.bos.redhat.com: Job OK (f4b44cd6-62e9-4643-bc2e-9d3eb6535954)

              Unassigned Unassigned
              jhutar-1 Jan Hutař
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: