Bug 2053421
Summary: | Installer --reset-data fails on an external DB setup | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Vladimír Sedmík <vsedmik> | |
Component: | Installation | Assignee: | Evgeni Golov <egolov> | |
Status: | CLOSED ERRATA | QA Contact: | Griffin Sullivan <gsulliva> | |
Severity: | high | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.10.3 | CC: | ahumbe, egolov, ehelms, gsulliva, gtalreja, iballou, jpathan, lpramuk | |
Target Milestone: | 6.14.0 | Keywords: | AutomationBlocker, Triaged | |
Target Release: | Unused | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2242906 (view as bug list) | Environment: | ||
Last Closed: | 2023-11-08 14:17:47 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Vladimír Sedmík
2022-02-11 09:26:16 UTC
The error I see in the logs is: 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 82, in _execute 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self.cursor.execute(sql) 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: psycopg2.errors.DuplicateObject: type "pulp_evr_array_item" already exists 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: @ This issue might be caused by the Pulpcore DB not being fully dropped for external DBs. Justin found this bit of code that drops tables: https://github.com/theforeman/foreman-installer/blob/8411f367ce5cb9e185523a42ac3bac54d7379eb9/hooks/pre/10-reset_data.rb#L69-L75 If the whole DB isn't dropped, the types won't get removed, causing the duplicate error. Yeah, looking at the installer log, the real error is: 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: Applying rpm.0013_RAW_rpm_evr_extension...Traceback (most recent call last): 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 82, in _execute 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: return self.cursor.execute(sql) 2022-02-11 03:11:53 [INFO ] [configure] /Stage[main]/Pulpcore::Database/Pulpcore::Admin[migrate --noinput]/Exec[pulpcore-manager migrate --noinput]/returns: psycopg2.errors.DuplicateObject: type "pulp_evr_array_item" already exists And looking at the migration (https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/migrations/0013_RAW_rpm_evr_extension.py), it creates types and functions, not tables. So it's never deleted. Created redmine issue https://projects.theforeman.org/issues/36238 from this bug Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36238 has been resolved. Verified in 6.14 snap 10 satellite-installer --reset-data runs normally with an external DB Steps to Reproduce: 1. Have an external DB setup (SAT + DB host) 2. On the Satellite, run `satellite-installer --reset-data` Results: Installer runs successfully 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.14 security and bug fix update), 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:6818 |