Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
I don't know how it can even happen as Sat 6.10 also does not have the bad schema but I would really expect that installer will be able to handle this issue in a much better way.
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
Hi, thank you for bringing this to our attention. I'm afraid we're not planning on having any updates to the 6.11 line, but this might help those who might be in the same situation.
On a more general note, we moved from Bugzilla to Jira some time ago and Bugzilla is considered to be archived at this point. Comments posted to the linked jira issue ([1] in the case of this BZ) have a better chance of being seen by more people.
[1] - https://issues.redhat.com/browse/SAT-12272
Description of problem: Upgrading to Satellite 6.11 fails on db:migrate stage with error "null value in column "created_at" violates not-null constraint" Version-Release number of selected component (if applicable): Satellite 6.11 [ RHEL 7 ] How reproducible: In customer environments Steps to Reproduce: 1. Install Satellite 6.10 2. Upgrade to 6.11 as per documentation 3. Actual results: Upgrade fails: ~~ \ Executing installer2022-07-19 10:48:00 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0] 2022-07-19 10:48:00 [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] | Executing installer2022-07-19 10:48:42 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0] 2022-07-19 10:48:42 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0] ~~ Error from logs: ~~ 2022-07-19 10:48:00 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: 2022-07-19 10:48:00 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Caused by: 2022-07-19 10:48:00 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint 2022-07-19 10:48:00 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: DETAIL: Failing row contains (321220, 4, 1, ForemanPuppet::Environment, null, null). ~~ "foreman-rake db:migrate" output: ~~~ == 20220208135305 MigrateEnvironmentIgnoreType: migrating ===================== rake aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint DETAIL: Failing row contains (321227, 4, 1, ForemanPuppet::Environment, null, null). ~~~ Expected results: The upgrade should be successful. Additional info: The issue happens as The schema of taxable_taxonomies table somehow is not correct. For a satellite having this issue: ~~~ [root@rhsat ~]$ echo "\d+ taxable_taxonomies" | su - postgres -c "psql foreman" Table "public.taxable_taxonomies" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------------+-----------------------------+-----------+----------+------------------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('taxable_taxonomies_id_seq'::regclass) | plain | | taxonomy_id | integer | | | | plain | | taxable_id | integer | | | | plain | | taxable_type | character varying(255) | | | | extended | | created_at | timestamp without time zone | | not null | | plain | | updated_at | timestamp without time zone | | not null | | plain | | Indexes: "taxable_taxonomies_pkey" PRIMARY KEY, btree (id) "taxable_index" UNIQUE, btree (taxable_type, taxable_id, taxonomy_id) "index_taxable_taxonomies_on_taxonomy_id_and_taxable_type" btree (taxonomy_id, taxable_type) Foreign-key constraints: "taxable_taxonomies_taxonomy_id_fk" FOREIGN KEY (taxonomy_id) REFERENCES taxonomies(id) Access method: heap [root@rhsat ~]$ echo "select * from taxable_taxonomies where created_at is null;" | su - postgres -c "psql foreman" id | taxonomy_id | taxable_id | taxable_type | created_at | updated_at ----+-------------+------------+--------------+------------+------------ (0 rows) ~~~ Expected: ~~~ # echo "\d+ taxable_taxonomies" | su - postgres -c "psql foreman" Table "public.taxable_taxonomies" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------------+-----------------------------+-----------+----------+------------------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('taxable_taxonomies_id_seq'::regclass) | plain | | taxonomy_id | integer | | | | plain | | taxable_id | integer | | | | plain | | taxable_type | character varying(255) | | | | extended | | created_at | timestamp without time zone | | | | plain | | updated_at | timestamp without time zone | | | | plain | | Indexes: "taxable_taxonomies_pkey" PRIMARY KEY, btree (id) "taxable_index" UNIQUE, btree (taxable_type, taxable_id, taxonomy_id) "index_taxable_taxonomies_on_taxonomy_id_and_taxable_type" btree (taxonomy_id, taxable_type) Foreign-key constraints: "taxable_taxonomies_taxonomy_id_fk" FOREIGN KEY (taxonomy_id) REFERENCES taxonomies(id) Access method: heap ~~~ Workaround: # su - postgres -c "psql foreman" ALTER TABLE taxable_taxonomies ALTER COLUMN created_at DROP NOT NULL; ALTER TABLE taxable_taxonomies ALTER COLUMN updated_at DROP NOT NULL; exit # foreman-rake db:migrate --trace If no issues are reported this time, proceed with re-running the upgrade.