Project

Profile

Help

Issue #4170

closed

Checksum constraint error when syncing a package

Added by daviddavis about 6 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 45
Quarter:

Description

Failure from pulp_smash below.

pulp_rpm/tests/functional/api/test_publish.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../virtualenv/python3.6.7/lib/python3.6/site-packages/pulp_smash/pulp3/utils.py:82: in sync
    return client.post(urljoin(remote['_href'], 'sync/'), data)
../../../virtualenv/python3.6.7/lib/python3.6/site-packages/pulp_smash/api.py:444: in post
    return self.request('POST', url, json=json, **kwargs)
../../../virtualenv/python3.6.7/lib/python3.6/site-packages/pulp_smash/api.py:481: in request
    requests.request(method, **request_kwargs),
../../../virtualenv/python3.6.7/lib/python3.6/site-packages/pulp_smash/api.py:148: in json_handler
    _handle_202(client._cfg, response, client.pulp_host)  # pylint:disable=protected-access
../../../virtualenv/python3.6.7/lib/python3.6/site-packages/pulp_smash/api.py:88: in _handle_202
    _check_tasks(tasks, ('error',))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tasks = ({'_href': '/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/', 'created': '2018-11-16T18:11:27.696106Z', 'crea...te-packages/django/db/backends/utils.py", line 85, in _execute\n    return self.cursor.execute(sql, params)\n'}, ...},)
task_errors = ('error',)
    def _check_tasks(tasks, task_errors):
        """Inspect each task's ``error``, ``exception`` and ``traceback`` fields.

        If any of these fields is non-null for any tasks, raise a
        ``TaskReportError``.
        """
        for task in tasks:
            for field in task_errors:
                if task[field] is not None:
                    msg = 'Task report {} contains a {}: {}\nFull task report: {}'
                    msg = msg.format(task['_href'], field, task[field], task)
>                   raise exceptions.TaskReportError(msg, task)
E                   pulp_smash.exceptions.TaskReportError: ('Task report /pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/ contains a error: {\'code\': None, \'description\': \'duplicate key value violates unique constraint "pulp_rpm_package_pkgId_key"\\nDETAIL:  Key ("pkgId")=(ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1) already exists.\\n\', \'traceback\': \'  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/worker.py", line 793, in perform_job\\n    rv = job.perform()\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 599, in perform\\n    self._result = self._execute()\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 605, in _execute\\n    return self.func(*self.args, **self.kwargs)\\n  File "/home/travis/build/pulp/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 69, in synchronize\\n    loop.run_until_complete(pipeline)\\n  File "/opt/python/3.6.7/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete\\n    return future.result()\\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/api.py", line 129, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/content_unit_stages.py", line 115, in __call__\\n    declarative_content.content.save()\\n  File "/home/travis/build/pulp/pulp/pulpcore/pulpcore/app/models/base.py", line 83, in save\\n    return super().save(*args, **kwargs)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save\\n    force_update=force_update, update_fields=update_fields)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 748, in save_base\\n    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 831, in _save_table\\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 869, in _do_insert\\n    using=using, raw=raw)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method\\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert\\n    return query.get_compiler(using=using).execute_sql(return_id)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql\\n    cursor.execute(sql, params)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute\\n    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers\\n    return executor(sql, params, many, context)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\\n    return self.cursor.execute(sql, params)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__\\n    raise dj_exc_value.with_traceback(traceback) from exc_value\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\\n    return self.cursor.execute(sql, params)\\n\'}\nFull task report: {\'_href\': \'/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/\', \'created\': \'2018-11-16T18:11:27.696106Z\', \'state\': \'failed\', \'started_at\': \'2018-11-16T18:11:27.807960Z\', \'finished_at\': \'2018-11-16T18:11:28.477947Z\', \'non_fatal_errors\': [], \'error\': {\'code\': None, \'description\': \'duplicate key value violates unique constraint "pulp_rpm_package_pkgId_key"\\nDETAIL:  Key ("pkgId")=(ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1) already exists.\\n\', \'traceback\': \'  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/worker.py", line 793, in perform_job\\n    rv = job.perform()\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 599, in perform\\n    self._result = self._execute()\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 605, in _execute\\n    return self.func(*self.args, **self.kwargs)\\n  File "/home/travis/build/pulp/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 69, in synchronize\\n    loop.run_until_complete(pipeline)\\n  File "/opt/python/3.6.7/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete\\n    return future.result()\\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/api.py", line 129, in create_pipeline\\n    await asyncio.gather(*futures)\\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/content_unit_stages.py", line 115, in __call__\\n    declarative_content.content.save()\\n  File "/home/travis/build/pulp/pulp/pulpcore/pulpcore/app/models/base.py", line 83, in save\\n    return super().save(*args, **kwargs)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save\\n    force_update=force_update, update_fields=update_fields)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 748, in save_base\\n    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 831, in _save_table\\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 869, in _do_insert\\n    using=using, raw=raw)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method\\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert\\n    return query.get_compiler(using=using).execute_sql(return_id)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql\\n    cursor.execute(sql, params)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute\\n    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers\\n    return executor(sql, params, many, context)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\\n    return self.cursor.execute(sql, params)\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__\\n    raise dj_exc_value.with_traceback(traceback) from exc_value\\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\\n    return self.cursor.execute(sql, params)\\n\'}, \'worker\': \'/pulp/api/v3/workers/2/\', \'parent\': None, \'spawned_tasks\': [], \'progress_reports\': [{\'message\': \'Downloading and Parsing Metadata\', \'state\': \'completed\', \'total\': 5, \'done\': 5, \'suffix\': \'\', \'task\': \'/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/\'}, {\'message\': \'Downloading Artifacts\', \'state\': \'completed\', \'total\': None, \'done\': 0, \'suffix\': \'\', \'task\': \'/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/\'}, {\'message\': \'Associating Content\', \'state\': \'canceled\', \'total\': None, \'done\': 0, \'suffix\': \'\', \'task\': \'/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/\'}], \'created_resources\': []}', {'_href': '/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/', 'created': '2018-11-16T18:11:27.696106Z', 'state': 'failed', 'started_at': '2018-11-16T18:11:27.807960Z', 'finished_at': '2018-11-16T18:11:28.477947Z', 'non_fatal_errors': [], 'error': {'code': None, 'description': 'duplicate key value violates unique constraint "pulp_rpm_package_pkgId_key"\nDETAIL:  Key ("pkgId")=(ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1) already exists.\n', 'traceback': '  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/worker.py", line 793, in perform_job\n    rv = job.perform()\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 599, in perform\n    self._result = self._execute()\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 605, in _execute\n    return self.func(*self.args, **self.kwargs)\n  File "/home/travis/build/pulp/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 69, in synchronize\n    loop.run_until_complete(pipeline)\n  File "/opt/python/3.6.7/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete\n    return future.result()\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/api.py", line 129, in create_pipeline\n    await asyncio.gather(*futures)\n  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/content_unit_stages.py", line 115, in __call__\n    declarative_content.content.save()\n  File "/home/travis/build/pulp/pulp/pulpcore/pulpcore/app/models/base.py", line 83, in save\n    return super().save(*args, **kwargs)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save\n    force_update=force_update, update_fields=update_fields)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 748, in save_base\n    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 831, in _save_table\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 869, in _do_insert\n    using=using, raw=raw)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert\n    return query.get_compiler(using=using).execute_sql(return_id)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql\n    cursor.execute(sql, params)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute\n    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers\n    return executor(sql, params, many, context)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\n    return self.cursor.execute(sql, params)\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__\n    raise dj_exc_value.with_traceback(traceback) from exc_value\n  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\n    return self.cursor.execute(sql, params)\n'}, 'worker': '/pulp/api/v3/workers/2/', 'parent': None, 'spawned_tasks': [], 'progress_reports': [{'message': 'Downloading and Parsing Metadata', 'state': 'completed', 'total': 5, 'done': 5, 'suffix': '', 'task': '/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/'}, {'message': 'Downloading Artifacts', 'state': 'completed', 'total': None, 'done': 0, 'suffix': '', 'task': '/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/'}, {'message': 'Associating Content', 'state': 'canceled', 'total': None, 'done': 0, 'suffix': '', 'task': '/pulp/api/v3/tasks/6d288ec1-4562-467e-9538-ca64cd8b747c/'}], 'created_resources': []})

Related issues

Related to Pulp - Test #4255: Checksum constraint error when syncing a packageCLOSED - COMPLETEkersomActions
Related to RPM Support - Test #4257: QueryExistingArtifacts stage does not prevent duplicates within a streamCLOSED - COMPLETEActions
Actions #1

Updated by daviddavis about 6 years ago

  • Tags Pulp 3 added
Actions #2

Updated by daviddavis about 6 years ago

  • Subject changed from Syncing two packages with the same checksum fails to Checksum constraint error when syncing a package
  • Description updated (diff)

Updating the description. Not sure exactly what's causing this problem.

Actions #3

Updated by daviddavis about 6 years ago

I reproduced it:

http POST http://localhost:8000/pulp/api/v3/repositories/ name=foo
http POST http://localhost:8000/pulp/api/v3/remotes/rpm/ url='https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-references-updateinfo/' name=bar
http POST :8000/pulp/api/v3/remotes/rpm/1/sync/ repository=/pulp/api/v3/repositories/1/

http POST http://localhost:8000/pulp/api/v3/repositories/ name=foo2
http POST http://localhost:8000/pulp/api/v3/remotes/rpm/ url='https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/' name=bar2
http POST :8000/pulp/api/v3/remotes/rpm/2/sync/ repository=/pulp/api/v3/repositories/2/

I see duplicate key value violates unique constraint \"pulp_rpm_package_pkgId_key\" when I look at the task.

Actions #4

Updated by daviddavis about 6 years ago

It looks like this line is the problem:

https://github.com/pulp/pulp/blob/8472d2d69d76186be0c1c68c73acd9a3235d7723/plugin/pulpcore/plugin/stages/content_unit_stages.py#L115

It probably needs to catch the IntegrityError and then query the database for the unit.

Actions #5

Updated by dalley about 6 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 46
Actions #6

Updated by dalley about 6 years ago

  • Sprint changed from Sprint 46 to Sprint 45
Actions #7

Updated by ttereshc about 6 years ago

This issue might be addressed with that PR https://github.com/pulp/pulp/pull/3764/
It needs retesting.

Actions #8

Updated by dkliban@redhat.com about 6 years ago

I agree ttereshc. Here is a better formatted traceback:

Key ("pkgId")=(ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1) already exists.\
\', \'traceback\': \'  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/worker.py", line 793, in perform_job\
    rv = job.perform()\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 599, in perform\
    self._result = self._execute()\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/rq/job.py", line 605, in _execute\
    return self.func(*self.args, **self.kwargs)\
  File "/home/travis/build/pulp/pulp_rpm/pulp_rpm/app/tasks/synchronizing.py", line 69, in synchronize\
    loop.run_until_complete(pipeline)\
  File "/opt/python/3.6.7/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete\
    return future.result()\
  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/api.py", line 129, in create_pipeline\
    await asyncio.gather(*futures)\
  File "/home/travis/build/pulp/pulp/plugin/pulpcore/plugin/stages/content_unit_stages.py", line 115, in __call__\
    declarative_content.content.save()\
  File "/home/travis/build/pulp/pulp/pulpcore/pulpcore/app/models/base.py", line 83, in save\
    return super().save(*args, **kwargs)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 718, in save\
    force_update=force_update, update_fields=update_fields)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 748, in save_base\
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 831, in _save_table\
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/base.py", line 869, in _do_insert\
    using=using, raw=raw)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method\
    return getattr(self.get_queryset(), name)(*args, **kwargs)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert\
    return query.get_compiler(using=using).execute_sql(return_id)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql\
    cursor.execute(sql, params)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute\
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers\
    return executor(sql, params, many, context)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\
    return self.cursor.execute(sql, params)\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__\
    raise dj_exc_value.with_traceback(traceback) from exc_value\
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute\
    return self.cursor.execute(sql, params)

The problem is on line 115 of content_unit_stages.py. The patch you mention added a try: except block around that code.

Actions #9

Updated by dkliban@redhat.com about 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

I retested with the latest version of pulpcore and I am now observing a different traceback in this area. I am taking this issue as assigned now.

 pulp: rq.worker:ERROR: django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic'
   block.
 Traceback (most recent call last):
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
     return self.cursor.execute(sql, params)
 psycopg2.IntegrityError: duplicate key value violates unique constraint "pulp_rpm_package_pkgId_key"
 DETAIL:  Key ("pkgId")=(ceb0f0bb58be244393cc565e8ee5ef0ad36884d8ba8eec74542ff47d299a34c1) already exists.
 The above exception was the direct cause of the following exception:
 Traceback (most recent call last):
   File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/stages/content_unit_stages.py", line 116, in __call__
     declarative_content.content.save()  
   File "/home/vagrant/devel/pulp/pulpcore/pulpcore/app/models/base.py", line 83, in save
     return super().save(*args, **kwargs)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 718, in save
     force_update=force_update, update_fields=update_fields)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 748, in save_base
     updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) 
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 831, in _save_table
     result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 869, in _do_insert
     using=using, raw=raw)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method 
     return getattr(self.get_queryset(), name)(*args, **kwargs)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 1136, in _insert
     return query.get_compiler(using=using).execute_sql(return_id)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql
     cursor.execute(sql, params)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
     return super().execute(sql, params) 
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) 
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
     return executor(sql, params, many, context)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
     return self.cursor.execute(sql, params)
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
     raise dj_exc_value.with_traceback(traceback) from exc_value
   File "/home/vagrant/.virtualenvs/pulp/lib64/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
     return self.cursor.execute(sql, params)
Actions #10

Updated by dkliban@redhat.com about 6 years ago

  • Status changed from ASSIGNED to POST

Added by dkliban@redhat.com about 6 years ago

Revision db96e27f | View on GitHub

Problem: duplicate content can't by synced

Solution: fix the content unit saver stage

This patch addresses 2 problems:

  1. Error because an exception was being caught during a transaction

  2. The q() method did not provide the correct query for Content objects

closes #4170 https://pulp.plan.io/issues/4170

Added by dkliban@redhat.com about 6 years ago

Revision db96e27f | View on GitHub

Problem: duplicate content can't by synced

Solution: fix the content unit saver stage

This patch addresses 2 problems:

  1. Error because an exception was being caught during a transaction

  2. The q() method did not provide the correct query for Content objects

closes #4170 https://pulp.plan.io/issues/4170

Actions #11

Updated by dkliban@redhat.com about 6 years ago

  • Status changed from POST to MODIFIED
Actions #12

Updated by bherring almost 6 years ago

  • Related to Test #4255: Checksum constraint error when syncing a package added
Actions #13

Updated by bherring almost 6 years ago

  • Related to Test #4257: QueryExistingArtifacts stage does not prevent duplicates within a stream added
Actions #14

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #15

Updated by ttereshc almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF