Bug 2118772 - Satellite upgrade to 6.12 fails during db:migrate with PG::UndefinedColumn: ERROR: column "created_at" of relation "taxable_taxonomies" does not exist
Summary: Satellite upgrade to 6.12 fails during db:migrate with PG::UndefinedColumn: E...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Organizations and Locations
Version: 6.12.0
Hardware: All
OS: All
unspecified
urgent
Target Milestone: 6.12.0
Assignee: satellite6-bugs
QA Contact: Shweta Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-16 17:49 UTC by Gaurav Talreja
Modified: 2022-11-16 13:35 UTC (History)
3 users (show)

Fixed In Version: foreman-3.3.0.5-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35388 0 Normal New Drop unnecessary timestamps only if column exists 2022-08-19 07:05:44 UTC
Red Hat Issue Tracker SAT-12283 0 None None None 2022-08-18 13:05:03 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:25 UTC

Description Gaurav Talreja 2022-08-16 17:49:35 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Satellite 6.12.0 Snap 6.1

How reproducible:
Always

Steps to Reproduce:
1. Setup 6.11.2 with required repos and update f-m from 6.12 maintenance repo
1. # foreman-maintain upgrade run --target-version 6.12  --whitelist="repositories-validate,repositories-setup"
...
Running Migration scripts to Satellite 6.12
================================================================================
Setup repositories:                                                   [SKIPPED]
--------------------------------------------------------------------------------
Unlock packages:                                                      [OK]
--------------------------------------------------------------------------------
Update package(s) :                                                   [OK]
--------------------------------------------------------------------------------
Procedures::Installer::Upgrade: 2022-08-16 13:14:13 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-08-16 13:14:19 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-08-16 13:14:19 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-08-16 13:14:25 [WARN  ] [pre] Skipping system checks.
2022-08-16 13:14:25 [WARN  ] [pre] Skipping system checks.
2022-08-16 13:14:35 [NOTICE] [configure] Starting system configuration.
2022-08-16 13:14:52 [NOTICE] [configure] 250 configuration steps out of 1562 steps complete.
2022-08-16 13:15:04 [NOTICE] [configure] 500 configuration steps out of 2413 steps complete.
2022-08-16 13:15:05 [NOTICE] [configure] 750 configuration steps out of 2413 steps complete.
2022-08-16 13:15:07 [NOTICE] [configure] 1000 configuration steps out of 2413 steps complete.
2022-08-16 13:15:08 [NOTICE] [configure] 1250 configuration steps out of 2413 steps complete.
2022-08-16 13:15:22 [NOTICE] [configure] 1500 configuration steps out of 2416 steps complete.
2022-08-16 13:15:32 [NOTICE] [configure] 1750 configuration steps out of 2421 steps complete.
2022-08-16 13:15:34 [NOTICE] [configure] 2000 configuration steps out of 2464 steps complete.
2022-08-16 13:16:29 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-08-16 13:16:29 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-08-16 13:16:54 [NOTICE] [configure] 2250 configuration steps out of 2464 steps complete.
2022-08-16 13:17:36 [NOTICE] [configure] System configuration has finished.

  There were errors detected during install.
  Please address the errors and re-run the installer to ensure the system is properly configured.
  Failing to do so is likely to result in broken functionality.

  The full log is at /var/log/foreman-installer/satellite.log
Package versions are being locked.
                                      [FAIL]
Failed executing LANG=en_US.utf-8 satellite-installer  --disable-system-checks, exit status 6
--------------------------------------------------------------------------------
Scenario [Migration scripts to Satellite 6.12] failed.

The following steps ended up in failing state:

  [installer-upgrade]

Resolve the failed steps and rerun the command.

If the situation persists and, you are unclear what to do next,
contact Red Hat Technical Support.

In case the failures are false positives, use
--whitelist="installer-upgrade,repositories-setup"
...


Actual results:
upgrade fails when running /usr/bin/foreman-rake db:migrate during the installer step

Expected results:
Upgrade successfully to 6.12

Additional info:

Comment 3 Brad Buckingham 2022-08-18 12:59:19 UTC
This may be related to the fix for bug 2108719.  The MR for that bug introduced this migration to drop the created_at / updated_at.  If those no longer exist in 6.12, that migration may not be necessary.

Comment 4 Leos Stejskal 2022-08-19 07:05:43 UTC
Created redmine issue https://projects.theforeman.org/issues/35388 from this bug

Comment 5 Marek Hulan 2022-08-23 13:03:25 UTC
The patch prepared in upstream wouldn't fix the issue. The workaround right now is to rename the migration file and then re-run the installer. Something like this should help

mv ~foreman/db/migrate/20220108135305_drop_unnecessary_timestamps.rb ~foreman/db/migrate/20220515130414_drop_unnecessary_timestamps.rb
satellite-installer

Comment 13 errata-xmlrpc 2022-11-16 13:35:16 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.12 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-2022:8506


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