Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2154734 - Getting 'null value in column \"image_manifest_id\" violates not-null constraint' when syncing openstack container repos
Summary: Getting 'null value in column \"image_manifest_id\" violates not-null constra...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.10.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.13.0
Assignee: satellite6-bugs
QA Contact: sganar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-19 03:02 UTC by Hao Chang Yu
Modified: 2023-11-29 04:25 UTC (History)
15 users (show)

Fixed In Version: pulp-container-2.10.11
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2174984 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:23:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp_container issues 1190 0 None closed Getting 'null value in column \"image_manifest_id\" violates not-null constraint' when syncing openstack container repos... 2023-01-11 09:45:32 UTC
Red Hat Issue Tracker SAT-14676 0 None None None 2023-01-05 00:25:56 UTC
Red Hat Knowledge Base (Solution) 6998791 0 None None None 2023-03-27 10:25:30 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:23:53 UTC

Description Hao Chang Yu 2022-12-19 03:02:34 UTC
Description of problem:
Capsules failed to sync the openstack container repositories with the following error:
----------------------------------
  error:
    traceback: |2
        File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 342, in _perform_task
          result = func(*args, **kwargs)
        File "/usr/lib/python3.6/site-packages/pulp_container/app/tasks/synchronize.py", line 44, in synchronize
          return dv.create()
        File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py", line 151, in create
          loop.run_until_complete(pipeline)
        File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
          return future.result()
        File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
          await asyncio.gather(*futures)
        File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 43, in __call__
          await self.run()
        File "/usr/lib/python3.6/site-packages/pulp_container/app/tasks/sync_stages.py", line 457, in run
          objs=manifest_to_list_list, ignore_conflicts=True, batch_size=1000
        File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
        File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 474, in bulk_create
          ids = self._batched_insert(objs_without_pk, fields, batch_size, ignore_conflicts=ignore_conflicts)
        File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 1211, in _batched_insert
          self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)
        File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 1186, in _insert
          return query.get_compiler(using=using).execute_sql(return_id)
        File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1377, in execute_sql
          cursor.execute(sql, params)
        File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
          return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
        File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
          return executor(sql, params, many, context)
        File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
          return self.cursor.execute(sql, params)
        File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
          raise dj_exc_value.with_traceback(traceback) from exc_value
        File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
          return self.cursor.execute(sql, params)
    description: |
      null value in column "image_manifest_id" violates not-null constraint
      DETAIL:  Failing row contains (105527, amd64, linux, , , , , null, d55659df-811f-452e-a9a1-cc07205daa9b).
  worker: "/pulp/api/v3/workers/275806b5-c56b-42e8-b170-09bce2b290e9/"
-----------------------------------


This issue seems to be related to bug #2026277 but on different table and column.

Capsules failed to sync the following but not limited to the below RHOSP repositories.
------------------------
openstack-cinder-api
openstack-neutron-server
openstack-neutron-dhcp-agent
openstack-neutron-server
------------------------


Below are the installed Pulp rpms for Satellite 6.10.7.
---------------------
libmodulemd-1.7.0-1.pulp.el7sat.x86_64
pulpcore-selinux-1.2.7-1.el7pc.x86_64
python3-pulpcore-3.14.16-1.el7pc.noarch
python3-pulp-ansible-0.9.0-1.el7pc.noarch
python3-pulp-certguard-1.4.0-1.el7pc.noarch
python3-pulp-container-2.8.4-0.1.el7pc.noarch
python3-pulp-file-1.8.2-1.el7pc.noarch
python3-pulp-rpm-3.14.14-1.el7pc.noarch
tfm-rubygem-smart_proxy_pulp-3.0.0-1.el7sat.noarch
-----------------------


Additional Info:

Looking at the hotfix PR (https://github.com/pulp/pulp_container/pull/568). It seems like we also need a "await list_dc.resolution()"
after line 121 (https://github.com/pulp/pulp_container/pull/535/files#diff-b702cbd3ebdff19bf8e4dfc14688aa3fb36e1a47ef6cf84d24e0f75b61247d36R121)
to make sure "list_dc" is resolved before man_dc.

sync_stages.py has been refactored in upstream Pulp "https://github.com/pulp/pulp_container/pull/608" which might fix the issue but it is not even included in 6.12 yet.

Comment 1 Daniel Alley 2022-12-19 23:52:30 UTC
i

Comment 2 Ina Panova 2022-12-22 16:57:55 UTC
This is a one liner fix https://github.com/pulp/pulp_container/issues/1190

Please specify pulp-container versions this fix needs to be included.

Comment 16 sganar 2023-03-03 13:37:06 UTC
Verified.

Tested on Satellite 6.13.0 Snap 12.0
python39-pulp-container-2.14.0-2.el8pc.noarch

Steps followed: 
1. Create a custom product.
2. Add some OSP repos and sync them and check sync status (I added openstack-cinder-api, openstack-neutron-server,openstack-neutron-dhcp-agent, openstack-nova-api)
3. Configure a capsule and trigger optimized sync.

Observation: 
The Synchronisation is successful and no issues are found.

Comment 19 errata-xmlrpc 2023-05-03 13:23:43 UTC
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

Comment 20 Red Hat Bugzilla 2023-11-29 04:25:05 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.