Upgrade to Satellite 6.12 fails on duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq"
Environment
- Red Hat Satellite 6.11
- being upgraded to 6.12
Issue
An upgrade of Satellite 6.11 -> 6.12 fails on django.db.utils.IntegrityError: duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq" error.
Resolution
Various uniq indices can be corrupted, so it is recommended to run:
runuser -u postgres -- reindexdb -a
to understand the scope of the problem. If this does not find a corrupted index, everything is green for you and let resume any operation.
If the reindexdb detects an issue, there are two options: A) revert back to a snapshot prior data corruption and run reindex there, or B) try to fix the corrupted indices
A) Revert back to a snapshot prior the data corruption occurred
The data corruption started to occur since LEAPP upgrade from RHEL7 to RHEL8. Where running the reindex command with a successful outcome at any time after the LEAPP upgrade does fully resolve these issues. Therefore, whenever possible, try to revert back to a snapshot, such that:
- if the snapshot was taken after LEAPP upgrade, run the reindex. It it succeeds, let resume since then. If it fails, repeat the procedure (fix data coruption OR revert to an older snaphost)
- if the snapshot was taken before LEAPP upgrade, then:
- run LEAPP upgrade
- run the reindex command immediatelly afterwards
- resume any operation or Satellite upgrade
B) Try to fix the corrupted indices
Red Hat Engineering is preparing a complete procedure for this. It is recommended to wait for the complete procedure, as otherwise resuming normal operations can easily introduce a new data corruption.
ONLY in case manual fix of one broken index is attempted to be underwent, let continue further.
It is highly recommended to create a backup of the Satellite, since direct changes in postgres DB will follow.
Quick check if you are affected
Very quick check that can verify at any time if you are affected by this problem (for broken one particular index):
su - postgres -c "psql pulpcore -c \"REINDEX INDEX rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq;\""
If that command returns REINDEX, everything is green. If it fails, it prints one of potentially multiple duplicate records violating the uniq index.
Quick solution that shall work
- On Satellite, Set the orphan protection time to 3
hammer settings set --name orphan_protection_time --value 3
- Wait for exactly four minutes and then run the command for orphan cleanup.
foreman-rake katello:delete_orphaned_content
-
The script will trigger tasks in Web UI -> Monitor -> Tasks page. Wait until the remove orphans tasks to finish successfully.
-
Return back the settings:
hammer settings set --name orphan_protection_time --value 1440
In case the above does not help
First, identify all duplicit records violating uniq index:
su - postgres -c "psql pulpcore -c \"COPY (SELECT name,stream,version,context,arch FROM rpm_modulemd) TO STDOUT WITH (FORMAT 'csv');\"" | sort | uniq -c | sort -n | grep -v "\s*1\s"
will print records like:
2 pmdk,1-fileformat-v6,8050020210407181047,b4937e53,x86_64
2 pmdk,1_fileformat_v6,8050020210527144347,b4937e53,x86_64
2 pmdk,1_fileformat_v6,8060020220211152608,d63f516d,x86_64
2 pmdk,1_fileformat_v6,8060020220324145225,d63f516d,x86_64
Meaning there are two records for name='pmdk' AND stream='1-fileformat-v6' AND version='8050020210407181047' AND context='b4937e53' AND arch='x86_64' (and three other duplicate records). Each such line means a duplicate record pair that violates uniq index.
For each such duplicate record, apply the below procedure.
su - postgres -c "psql pulpcore"
Then search:
pulpcore=# SELECT content_ptr_id,name,stream,version,context,arch FROM rpm_modulemd WHERE name LIKE 'pmdk' AND stream LIKE '1_fileformat_v6' AND version LIKE '8040020210405195856' AND context LIKE '9f9e2e7e' AND arch LIKE 'x86_64';
content_ptr_id | name | stream | version | context | arch
--------------------------------------+------+-----------------+---------------------+----------+--------
3e389ef6-3a4c-4ee4-8b53-8eb0423e7c9e | pmdk | 1_fileformat_v6 | 8040020210405195856 | 9f9e2e7e | x86_64
23d18dd1-9851-43bd-bfc7-c9cca3112a81 | pmdk | 1_fileformat_v6 | 8040020210405195856 | 9f9e2e7e | x86_64
(2 rows)
pulpcore=#
You should use LIKE instead of =, otherwise you might not see both duplicate records.
For both `content_ptr_id, find if it is associated to a repository:
pulpcore=# SELECT * FROM core_repositorycontent WHERE content_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
pulp_id | pulp_created | pulp_last_updated | content_id | repository_id | version_added_id | version_removed_id
---------+--------------+-------------------+------------+---------------+------------------+--------------------
(0 rows)
pulpcore=# SELECT * FROM core_repositorycontent WHERE content_id = '3e389ef6-3a4c-4ee4-8b53-8eb0423e7c9e';
pulp_id | pulp_created | pulp_last_updated | content_id | repository_id |
version_added_id | version_removed_id
--------------------------------------+-------------------------------+-------------------------------+--------------------------------------+--------------------------------------+---------
-----------------------------+--------------------
18c48eef-aa5d-4013-8b30-f2e6503f86ca | 2022-11-25 17:38:15.330864-05 | 2022-11-25 17:38:15.33087-05 | 3e389ef6-3a4c-4ee4-8b53-8eb0423e7c9e | 5a9b1348-0805-4b60-adcf-636c5fcf9846 | bbfc715d
-104a-4d54-a8dc-b975147c9990 |
..
(8 rows)
pulpcore=#
If one content is not referred by any repository, skip below step and continue with DELETE commands.
If both contents are referred by a repository, then we must unassociate all references to either one content. That can be achieved by either:
A) identify repository that contains the content and remove that repository:
pulpcore=# SELECT * FROM rpm_rpmrepository AS rr INNER JOIN core_repositorycontent AS cr ON rr.repository_ptr_id = cr.repository_id WHERE cr.content_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
repository_ptr_id | metadata_signing_service_id | original_checksum_types | retain_package_versions | autopublish | gpgcheck | metadata_checksum_type | package_checksum_type | repo_gpgcheck | sqlite_metadata | last_sync_details | pulp_id |
pulp_created | pulp_last_updated | content_id | repository_id | version_added_id | version_removed_id
--------------------------------------+-----------------------------+-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------+-------------------------+-------------+----------+------------------------+----------
-------------+---------------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------+--
-----------------------------+-------------------------------+--------------------------------------+--------------------------------------+--------------------------------------+-----------
---------
99149e8e-f93b-416a-8f62-007f5ffa1208 | | {"group": "sha256", "other": "sha256", "modules": "sha256", "primary": "sha256", "other_db": "sha256", "filelists": "sha256", "productid": "sha256", "primary_db": "sha256", "updateinfo": "sha256", "filelists_db": "sha256"} | 0 | f | 0 | | | 0 | f | {"url": "https://cdn.redhat.com/content/dist/rhel8/8.5/x86_64/appstream/os", "revision": "1664221241", "sync_policy": "mirror_complete", "download_policy": "on_demand", "repomd_checksum": "28626e5574f24e43366cd9c4a58b321c7bb8def5907e1bc4e03cb92baf275648", "most_recent_version": 15}
(1 row)
pulpcore=#
Here the repo is RHEL8.5 AppStream. Try to disable that repository (if possible), which should remove the rpm_rpmrepository and core_repositorycontent records. Try that for either content, if possible. If not possible, then do the following:
B) If it is not possible to remove repository associated with either content, let update repository associations from one content to another:
pulpcore=# UPDATE core_repositorycontent SET content_id = '3e389ef6-3a4c-4ee4-8b53-8eb0423e7c9e' WHERE content_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
UPDATE 1
pulpcore=#
Now, if there is no repository reference to either one of the duplicity content, let delete it (together with all other references to it) - here we assume the "no repository reference content" has id 23d18dd1-9851-43bd-bfc7-c9cca3112a81
DELETE FROM rpm_modulemd_packages WHERE modulemd_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
DELETE FROM rpm_modulemd WHERE content_ptr_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
DELETE FROM core_contentartifact WHERE content_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
DELETE FROM core_content WHERE pulp_id = '23d18dd1-9851-43bd-bfc7-c9cca3112a81';
To verify all duplicate records are resolved, try to reindex via the "problematic" uniq index:
pulpcore=# REINDEX INDEX rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq;
REINDEX
pulpcore=#
If you notice some duplicate record error, then apply the procedure for the output values also.
Once the REINDEX passes, let leave psql console and re-run the upgrade again. Be aware other indices might get broken, since just one table / one index has been properly healed by this procedure.
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
LEAPP upgrade of postgres from RHEL7 to RHEL8 Content from wiki.postgresql.org is not included.does change locale data in a way calculated indices get invalidated, which allows inserting duplicate records. A remedy step is to reindex all tables in all databases after the RHEL7->8 upgrade, to re-build the indices based on new sorting behind.
Once the reindex succeeds completely, the problem is resolved.
This content is not included.This bugzilla will add the reindex step as automatically executed during LEAPP upgrade.
Diagnostic Steps
Installer log contains:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Operations to perform:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Apply all migrations: admin, ansible, auth, certguard, container, contenttypes, core, file, guardian, rpm, sessions
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Running migrations:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Applying rpm.0044_noartifact_modules...Traceback (most recent call last):
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self.cursor.execute(sql, params)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq"
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: DETAIL: Key (name, stream, version, context, arch)=(pmdk, 1_fileformat_v6, 8040020210405195856, 9f9e2e7e, x86_64) already exists.
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: The above exception was the direct cause of the following exception:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns:
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Traceback (most recent call last):
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/bin/pulpcore-manager", line 33, in <module>
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: sys.exit(load_entry_point('pulpcore==3.18.10', 'console_scripts', 'pulpcore-manager')())
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/pulpcore/app/manage.py", line 11, in manage
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: execute_from_command_line(sys.argv)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: utility.execute()
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: self.fetch_command(subcommand).run_from_argv(self.argv)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: self.execute(*args, **cmd_options)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: output = self.handle(*args, **options)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 89, in wrapped
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: res = handle_func(*args, **kwargs)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 244, in handle
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: post_migrate_state = executor.migrate(
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: state = migration.apply(state, schema_editor)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/migrations/migration.py", line 126, in apply
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/migrations/operations/special.py", line 190, in database_forwards
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: self.code(from_state.apps, schema_editor)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/pulp_rpm/app/migrations/0044_noartifact_modules.py", line 32, in convert_artifact_to_snippets
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Modulemd.objects.bulk_update(modules_with_snippet, ["snippet"])
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return getattr(self.get_queryset(), name)(*args, **kwargs)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 568, in bulk_update
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: self.filter(pk__in=pks).update(**update_kwargs)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 783, in update
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: rows = query.get_compiler(self.db).execute_sql(CURSOR)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: cursor = super().execute_sql(result_type)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: cursor.execute(sql, params)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return executor(sql, params, many, context)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self.cursor.execute(sql, params)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: raise dj_exc_value.with_traceback(traceback) from exc_value
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self.cursor.execute(sql, params)
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: django.db.utils.IntegrityError: duplicate key value violates unique constraint "rpm_modulemd_name_stream_version_context_arch_f6598e4e_uniq"
2022-11-29 10:11:58 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: DETAIL: Key (name, stream, version, context, arch)=(pmdk, 1_fileformat_v6, 8040020210405195856, 9f9e2e7e, x86_64) already exists.
2022-11-29 10:11:58 [ERROR ] [configure] 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2022-11-29 10:11:58 [ERROR ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: change from 'notrun' to ['0'] failed: 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2022-11-29 10:11:58 [DEBUG ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]: Evaluated in 18.60 seconds
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.