Project

General

Profile

Actions

Bug #36238

closed

Installer --reset-data fails on an external DB setup

Added by Evgeni Golov about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
foreman-installer script
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2053421

Description of problem:
Installer reset on an external DB setup fails, effectively blocking backup restore on that setup.

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

How reproducible:
always

Steps to Reproduce:
1. Have an external DB setup (SAT + DB host)
2. On the Satellite, run `satellite-installer --reset-data`

Actual results:
Installer fails:
2022-02-11 04:12:08 [NOTICE] [configure] 1250 configuration steps out of 1850 steps complete.
2022-02-11 04:13:37 [NOTICE] [configure] 1500 configuration steps out of 1850 steps complete.
2022-02-11 04:14:49 [ERROR ] [configure] 'pulpcore-manager migrate --noinput' returned 1 instead of one of [0]
2022-02-11 04:14:49 [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-02-11 04:14:49 [NOTICE] [configure] 1750 configuration steps out of 1850 steps complete.
2022-02-11 04:14:52 [NOTICE] [configure] System configuration has finished.

There were errors detected during install.

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 by https://github.com/theforeman/foreman-installer/blob/416f45216493f9ad4d331a54d7cc92e42b8dbfd5/hooks/pre/10-reset_data.rb#L68-L76

Expected results:
Successfull reset

Actions #1

Updated by Evgeni Golov about 1 year ago

  • Subject changed from Installer --reset-data fails on an external DB setup to Installer --reset-data fails on an external DB setup
  • Category set to foreman-installer script
Actions #2

Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-installer/pull/844 added
Actions #3

Updated by The Foreman Bot about 1 year ago

  • Fixed in Releases 3.7.0 added
Actions #4

Updated by Evgeni Golov about 1 year ago

  • Status changed from Ready For Testing to Closed
Actions #5

Updated by Ewoud Kohl van Wijngaarden 10 months ago

  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF