Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-21158

Syncing from https://galaxy.ansible.com/ failed with "get() returned more than one Collection -- it returned 2!"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Pulp
    • None
    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • CLOSED
    • 1,050
    • Moderate

      Description of problem:

      Here is the traceback:

      error:
      traceback: |2
      File "/usr/lib/python3.9/site-packages/pulpcore/tasking/pulpcore_worker.py", line 452, in _perform_task
      result = func(*args, **kwargs)
      File "/usr/lib/python3.9/site-packages/pulp_ansible/app/tasks/collections.py", line 180, in sync
      repo_version = d_version.create()
      File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/declarative_version.py", line 161, in create
      loop.run_until_complete(pipeline)
      File "/usr/lib64/python3.9/asyncio/base_events.py", line 647, in run_until_complete
      return future.result()
      File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
      await asyncio.gather(*futures)
      File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/api.py", line 43, in _call_
      await self.run()
      File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/content_stages.py", line 198, in run
      await sync_to_async(process_batch)()
      File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 435, in _call_
      ret = await asyncio.wait_for(future, timeout=None)
      File "/usr/lib64/python3.9/asyncio/tasks.py", line 442, in wait_for
      return await fut
      File "/usr/lib64/python3.9/concurrent/futures/thread.py", line 58, in run
      result = self.fn(*self.args, **self.kwargs)
      File "/usr/lib/python3.9/site-packages/asgiref/sync.py", line 476, in thread_handler
      return func(*args, **kwargs)
      File "/usr/lib/python3.9/site-packages/pulpcore/plugin/stages/content_stages.py", line 106, in process_batch
      self._pre_save(batch)
      File "/usr/lib/python3.9/site-packages/pulp_ansible/app/tasks/collections.py", line 1042, in _pre_save
      collection, created = Collection.objects.get_or_create(
      File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
      return getattr(self.get_queryset(), name)(*args, **kwargs)
      File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 581, in get_or_create
      return self.get(**kwargs), False
      File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 439, in get
      raise self.model.MultipleObjectsReturned(
      description: get() returned more than one Collection – it returned 2!

      Not exactly sure how the duplicates happened. It could be a race condition during the sync? Nevertheless, it'd be good to have a foreman-rake task to clean up the duplicates.

      Version-Release number of selected component (if applicable):

      How reproducible:

      Hard

      Steps to Reproduce:

      Sync all the collections from galaxy

      Actual results:

      Failed

      Expected results:

      Success

      Additional info:

            jira-bugzilla-migration RH Bugzilla Integration
            jira-bugzilla-migration RH Bugzilla Integration
            RH Bugzilla Integration RH Bugzilla Integration
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: