Project

General

Profile

Actions

Bug #38146

closed

db:migrate fails on 3.12 to 3.13 upgrade when you have RedHat subscriptions

Added by Brian O'Neill 15 days ago. Updated 10 days ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Activation Key
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Error from db:migrate

2025-01-14 20:23:33 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: StandardError: An error has occurred, this and all later migrations canceled:
2025-01-14 20:23:33 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
2025-01-14 20:23:33 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: undefined method `organization' for #<Katello::Util::FakeActivationKey id: 8, name: "Red Hat
Enterprise Linux", description: nil, organization_id: 1, environment_id: 4, created_at: "2023-08-22 21:10:28.552603000 +0000", updated_at: "2023-08-22 21:27:43.731203000 +0000", user_id: 5, max_hosts: nil, content_view_id: nil, cp
_id: "8a48b82f8a1dcacf018a1f15ac5a0081", release_version: nil, unlimited_hosts: true, auto_attach: true, purpose_role: "Red Hat Enterprise Linux Server", purpose_usage: "Production">

Tracked this down to /usr/share/gems/gems/katello-4.15.0/app/lib/katello/util/cveak_migrator.rb

At the bottom if I commented out 2 lines and changed the last it works

          #default_content_view = ak.organization.default_content_view
          #library = ak.organization.library
          #ak&.update_columns(content_view_id: default_content_view&.id, environment_id: library&.id)
          ak&.update_columns(content_view_id: 1, environment_id: 1)

This gets past the ak.organization values not existing and just sets them to 1.

No idea what the proper fix is, I'm guessing there is a better way to get defaults, but, that is unknown to me.


Related issues 1 (0 open1 closed)

Is duplicate of Katello - Bug #38147: FakeActivationKey doesn't respond to #organization methodClosedJeremy LenzActions
Actions #1

Updated by Jeremy Lenz 10 days ago

  • Is duplicate of Bug #38147: FakeActivationKey doesn't respond to #organization method added
Actions #2

Updated by Jeremy Lenz 10 days ago

  • Status changed from New to Duplicate
Actions #3

Updated by Jeremy Lenz 10 days ago

  • Target version deleted (Katello 4.16.0)
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF