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

PulpTemporaryUploadedFile is not supported on _create_pulp_namespace

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • crc-2023-10-17
    • crc-2023-06-27
    • Backend
    • None

      Description

      When editing a namespace twice, or running mgmt cmd download-namespace-logos, we get an exception in the _create_pulp_namespace task.

      Steps to Reproduce

      1. Edit a namespace
      2. In the Logo URL delete the last character and re-add it and see the "You have unsaved changes" message
      3. Click Save
      4. See a successful _create_pulp_namespace occur
      5. Repeat steps 1-3
      6. See the _create_pulp_namespace have the error

      how reproducible: always in CRC Prod via manual edit

      Error:

      Input tmpl559uley-A10-NewLogos-Blue-NoReg-RGB.png of type: <class 'pulpcore.app.files.PulpTemporaryUploadedFile'> is not supported.
      
        File "/venv/lib64/python3.9/site-packages/pulpcore/tasking/pulpcore_worker.py", line 458, in _perform_task
          result = func(*args, **kwargs)
        File "/app/galaxy_ng/app/tasks/namespaces.py", line 103, in _create_pulp_namespace
          avatar_artifact.save()
        File "/venv/lib64/python3.9/site-packages/pulpcore/app/models/content.py", line 152, in save
          super().save(*args, **kwargs)
        File "/usr/lib64/python3.9/contextlib.py", line 79, in inner
          return func(*args, **kwds)
        File "/venv/lib64/python3.9/site-packages/django_lifecycle/mixins.py", line 169, in save
          save(*args, **kwargs)
        File "/venv/lib64/python3.9/site-packages/django/db/models/base.py", line 739, in save
          self.save_base(using=using, force_insert=force_insert,
        File "/venv/lib64/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
          updated = self._save_table(
        File "/venv/lib64/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
          results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
        File "/venv/lib64/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
          return manager._insert(
        File "/venv/lib64/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
        File "/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
          return query.get_compiler(using=using).execute_sql(returning_fields)
        File "/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1415, in execute_sql
          for sql, params in self.as_sql():
        File "/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1358, in as_sql
          value_rows = [
        File "/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1359, in <listcomp>
          [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
        File "/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1359, in <listcomp>
          [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
        File "/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1310, in pre_save_val
          return field.pre_save(obj, add=True)
        File "/venv/lib64/python3.9/site-packages/pulpcore/app/models/fields.py", line 76, in pre_save
          return super().pre_save(model_instance, add)
        File "/venv/lib64/python3.9/site-packages/django/db/models/fields/files.py", line 302, in pre_save
          file.save(file.name, file.file, save=False)
        File "/venv/lib64/python3.9/site-packages/django/db/models/fields/files.py", line 89, in save
          self.name = self.storage.save(name, content, max_length=self.field.max_length)
        File "/venv/lib64/python3.9/site-packages/django/core/files/storage.py", line 54, in save
          name = self._save(name, content)
        File "/venv/lib64/python3.9/site-packages/storages/backends/s3boto3.py", line 445, in _save
          obj.upload_fileobj(content, ExtraArgs=params, Config=self._transfer_config)
        File "/venv/lib64/python3.9/site-packages/boto3/s3/inject.py", line 725, in object_upload_fileobj
          return self.meta.client.upload_fileobj(
        File "/venv/lib64/python3.9/site-packages/boto3/s3/inject.py", line 636, in upload_fileobj
          return future.result()
        File "/venv/lib64/python3.9/site-packages/s3transfer/futures.py", line 103, in result
          return self._coordinator.result()
        File "/venv/lib64/python3.9/site-packages/s3transfer/futures.py", line 266, in result
          raise self._exception
        File "/venv/lib64/python3.9/site-packages/s3transfer/tasks.py", line 269, in _main
          self._submit(transfer_future=transfer_future, **kwargs)
        File "/venv/lib64/python3.9/site-packages/s3transfer/upload.py", line 579, in _submit
          upload_input_manager = self._get_upload_input_manager_cls(
        File "/venv/lib64/python3.9/site-packages/s3transfer/upload.py", line 546, in _get_upload_input_manager_cls
          raise RuntimeError( 

              bmclaugh@redhat.com Brian McLaughlin
              awcrosby5 Andrew Crosby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: