Bug 1445150

Summary: Upgrade w/ 6.2.9 snap5 failed on upgrade Step: migrate_foreman
Product: Red Hat Satellite Reporter: Sanket Jagtap <sjagtap>
Component: UpgradesAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: high    
Version: 6.2.9CC: bbuckingham, inecas, jcallaha, mbacovsk, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.11.0.76-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Sanket Jagtap 2017-04-25 06:38:35 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Satellite 6.2.9 snap 5

How reproducible:
Always

Steps to Reproduce:
1.Upgrade from 6.1 to 6.2.9 snap 5
2.
3.

Actual results:
Upgrade Step: migrate_foreman...
[####.com] out: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
[####.com] out: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
[####.com] out: true
[####.com] out: 
[####.com] out: /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
[####.com] out: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
[####.com] out: == 20150930183738 MigrateContentHosts: migrating ==============================
[####.com] out: == 20150930183738 MigrateContentHosts: migrated (25.5164s) ====================
[####.com] out: 
[####.com] out: == 20151009084350 DropPtables: migrating ======================================
[####.com] out: -- drop_table(:ptables)
[####.com] out:    -> 0.0626s
[####.com] out: == 20151009084350 DropPtables: migrated (0.0628s) =============================
[####.com] out: 
[####.com] out: == 20151014144004 HostCollectionToHosts: migrating ============================
[####.com] out: -- create_table(:katello_host_collection_hosts, {:force=>true})
[####.com] out:    -> 0.1796s
[####.com] out: -- add_foreign_key("katello_host_collection_hosts", "katello_host_collections", {:name=>"katello_host_collection_hosts_host_collection_id_fk", :column=>"host_collection_id"})
[####.com] out:    -> 0.0200s
[####.com] out: -- add_foreign_key("katello_host_collection_hosts", "hosts", {:name=>"katello_host_collection_hosts_host_id_fk", :column=>"host_id"})
[####.com] out:    -> 0.0105s
[####.com] out: -- add_index(:katello_host_collection_hosts, [:host_collection_id])
[####.com] out:    -> 0.0081s
[####.com] out: -- add_index(:katello_host_collection_hosts, [:host_id])
[####.com] out:    -> 0.0067s
[####.com] out: -- drop_table(:katello_system_host_collections)
[####.com] out:    -> 0.0223s
[####.com] out: -- rename_column(:katello_host_collections, :max_content_hosts, :max_hosts)
[####.com] out:    -> 0.0110s
[####.com] out: -- rename_column(:katello_host_collections, :unlimited_content_hosts, :unlimited_hosts)
[####.com] out:    -> 0.0045s
[####.com] out: == 20151014144004 HostCollectionToHosts: migrated (0.2665s) ===================
[####.com] out: 
[####.com] out: == 20151015152947 AddVirtOnlyToKatelloPools: migrating ========================
[####.com] out: -- add_column(:katello_pools, :virt_only, :boolean, {:default=>false, :null=>false})
[####.com] out:    -> 0.0310s
[####.com] out: -- add_column(:katello_pools, :unmapped_guest, :boolean, {:default=>false, :null=>false})
[####.com] out:    -> 0.0280s
[####.com] out: == 20151015152947 AddVirtOnlyToKatelloPools: migrated (0.0593s) ===============
[####.com] out: 
[####.com] out: == 20151019174035 RenameDomainHostCount: migrating ============================
[####.com] out: -- rename_column(:domains, :hosts_count, :total_hosts)
[####.com] out:    -> 0.0045s
[####.com] out: == 20151019174035 RenameDomainHostCount: migrated (0.0046s) ===================
[####.com] out: 
[####.com] out: == 20151022123457 AddRecurringLogicState: migrating ===========================
[####.com] out: -- add_column(:foreman_tasks_recurring_logics, :state, :string, {:index=>true})
[####.com] out:    -> 0.0069s
[####.com] out: == 20151022123457 AddRecurringLogicState: migrated (0.0071s) ==================
[####.com] out: 
[####.com] out: == 20151023144501 RegenerateRedHatKexec: migrating ============================
[####.com] out: == 20151023144501 RegenerateRedHatKexec: migrated (0.1590s) ===================
[####.com] out: 
[####.com] out: == 20151025120534 AddHiddenValueToLookupKey: migrating ========================
[####.com] out: -- add_column(:lookup_keys, :hidden_value, :boolean, {:default=>false})
[####.com] out:    -> 0.0645s
[####.com] out: == 20151025120534 AddHiddenValueToLookupKey: migrated (0.0648s) ===============
[####.com] out: 
[####.com] out: == 20151104100257 AddHostsCountToHostgroup: migrating =========================
[####.com] out: -- add_column(:hostgroups, :hosts_count, :integer, {:default=>0})
[####.com] out:    -> 0.0366s
[####.com] out: == 20151104100257 AddHostsCountToHostgroup: migrated (0.0368s) ================
[####.com] out: 
[####.com] out: == 20151109152507 AddHostStatusHostIdIndex: migrating =========================
[####.com] out: -- add_index(:host_status, [:type, :host_id], {:unique=>true})
[####.com] out:    -> 0.0147s
[####.com] out: == 20151109152507 AddHostStatusHostIdIndex: migrated (0.0267s) ================
[####.com] out: 
[####.com] out: == 20151112152108 CreateTriggerings: migrating ================================
[####.com] out: -- create_table(:foreman_tasks_triggerings)
[####.com] out:    -> 0.0104s
[####.com] out: -- change_table(:foreman_tasks_recurring_logics)
[####.com] out:    -> 0.0014s
[####.com] out: == 20151112152108 CreateTriggerings: migrated (0.0121s) =======================
[####.com] out: 
[####.com] out: == 20151118165125 AddSizeToScapContent: migrating =============================
[####.com] out: -- change_column(:foreman_openscap_scap_contents, :scap_file, :binary, {:limit=>16777216})
[####.com] out:    -> 0.1564s
[####.com] out: == 20151118165125 AddSizeToScapContent: migrated (0.1566s) ====================
[####.com] out: 
[####.com] out: == 20151119155419 AddArfFieldsToMessage: migrating ============================
[####.com] out: -- add_column(:messages, :description, :text)
[####.com] out:    -> 0.0026s
[####.com] out: -- add_column(:messages, :rationale, :text)
[####.com] out:    -> 0.0010s
[####.com] out: -- add_column(:messages, :scap_references, :text)
[####.com] out:    -> 0.0008s
[####.com] out: -- add_column(:messages, :severity, :string)
[####.com] out:    -> 0.0010s
[####.com] out: == 20151119155419 AddArfFieldsToMessage: migrated (0.0058s) ===================
[####.com] out: 
[####.com] out: == 20151120090851 AddOpenscapProxyToHostAndHostgroup: migrating ===============
[####.com] out: -- add_column(:hostgroups, :openscap_proxy_id, :integer)
[####.com] out:    -> 0.0013s
[####.com] out: -- add_column(:hosts, :openscap_proxy_id, :integer)
[####.com] out:    -> 0.0012s
[####.com] out: -- add_column(:reports, :openscap_proxy_id, :integer)
[####.com] out:    -> 0.0025s
[####.com] out: == 20151120090851 AddOpenscapProxyToHostAndHostgroup: migrated (0.0053s) ======
[####.com] out: 
[####.com] out: == 20151120153254 DeleteBootableInterface: migrating ==========================
[####.com] out: == 20151120153254 DeleteBootableInterface: migrated (0.0154s) =================
[####.com] out: 
[####.com] out: == 20151219152536 RenameIndexRepositoryErrata: migrating ======================
[####.com] out: -- index_exists?(:katello_repository_errata, [:erratum_id, :repository_id], {:name=>"index_katello_repository_errata_on_erratum_id_and_repository_id"})
[####.com] out:    -> 0.0030s
[####.com] out: -- rename_index(:katello_repository_errata, "index_katello_repository_errata_on_erratum_id_and_repository_id", "index_katello_repository_errata_on_erratum_id_and_repo_id")
[####.com] out:    -> 0.0014s
[####.com] out: == 20151219152536 RenameIndexRepositoryErrata: migrated (0.0047s) =============
[####.com] out: 
[####.com] out: == 20151219203225 RenameIndexRepositoryPuppetModule: migrating ================
[####.com] out: -- index_exists?(:katello_repository_puppet_module, [:module_id, :repo_id], {:name=>"index_katello_repository_puppet_module_on_module_id_and_repo_id"})
[####.com] out:    -> 0.0018s
[####.com] out: == 20151219203225 RenameIndexRepositoryPuppetModule: migrated (0.0019s) =======
[####.com] out: 
[####.com] out: == 20151220093801 RemoveSpacesFromSmartVariableKey: migrating =================
[####.com] out: == 20151220093801 RemoveSpacesFromSmartVariableKey: migrated (0.0652s) ========
[####.com] out: 
[####.com] out: == 20160114200145 AddMirrorOnSyncToRepositories: migrating ====================
[####.com] out: -- add_column(:katello_repositories, :mirror_on_sync, :boolean, {:default=>true, :null=>false})
[####.com] out:    -> 0.0796s
[####.com] out: == 20160114200145 AddMirrorOnSyncToRepositories: migrated (0.1646s) ===========
[####.com] out: 
[####.com] out: == 20160129192548 AddDockerV2Schema: migrating ================================
[####.com] out: -- create_table(:katello_docker_manifests)
[####.com] out:    -> 0.0186s
[####.com] out: -- create_table(:katello_repository_docker_manifests)
[####.com] out:    -> 0.0088s
[####.com] out: -- add_column(:katello_docker_tags, :uuid, :string, {:limit=>255})
[####.com] out:    -> 0.0084s
[####.com] out: -- add_column(:katello_docker_tags, :docker_manifest_id, :integer)
[####.com] out:    -> 0.0009s
[####.com] out: -- add_index(:katello_docker_tags, :uuid, {:unique=>true})
[####.com] out:    -> 0.0086s
[####.com] out: -- add_index(:katello_repository_docker_manifests, [:docker_manifest_id, :repository_id], {:name=>:katello_repo_docker_manifest_repo_id, :unique=>true})
[####.com] out:    -> 0.0065s
[####.com] out: -- add_foreign_key(:katello_repository_docker_manifests, :katello_repositories, {:column=>:repository_id})
[####.com] out:    -> 0.0046s
[####.com] out: -- add_foreign_key(:katello_docker_tags, :katello_docker_manifests, {:column=>:docker_manifest_id})
[####.com] out:    -> 0.0032s
[####.com] out: == 20160129192548 AddDockerV2Schema: migrated (0.0607s) =======================
[####.com] out: 
[####.com] out: == 20160131182301 AddDownloadPolicyToKatelloRepositories: migrating ===========
[####.com] out: -- add_column(:katello_repositories, :download_policy, :string, {:limit=>255})
[####.com] out:    -> 0.0013s
[####.com] out: == 20160131182301 AddDownloadPolicyToKatelloRepositories: migrated (0.0230s) ==
[####.com] out: 
[####.com] out: == 20160201131211 AddExpiredLogsToSmartProxy: migrating =======================
[####.com] out: -- add_column(:smart_proxies, :expired_logs, :string, {:default=>"0"})
[####.com] out:    -> 0.0239s
[####.com] out: == 20160201131211 AddExpiredLogsToSmartProxy: migrated (0.0241s) ==============
[####.com] out: 
[####.com] out: == 20160203195736 RemoveDockerImageSchema: migrating ==========================
[####.com] out: -- remove_column(:katello_docker_tags, :docker_image_id)
[####.com] out:    -> 0.0028s
[####.com] out: -- drop_table(:katello_repository_docker_images)
[####.com] out:    -> 0.0053s
[####.com] out: -- drop_table(:katello_docker_images)
[####.com] out:    -> 0.0055s
[####.com] out: == 20160203195736 RemoveDockerImageSchema: migrated (0.0141s) =================
[####.com] out: 
[####.com] out: == 20160211134035 RemoveSystemErrata: migrating ===============================
[####.com] out: -- drop_table("katello_system_errata")
[####.com] out:    -> 0.0050s
[####.com] out: == 20160211134035 RemoveSystemErrata: migrated (0.0052s) ======================
[####.com] out: 
[####.com] out: == 20160215143900 AddSubnetDomainRelationConstraints: migrating ===============
[####.com] out: -- change_column(:subnet_domains, :subnet_id, :integer, {:null=>false})
[####.com] out:    -> 0.0169s
[####.com] out: -- change_column(:subnet_domains, :domain_id, :integer, {:null=>false})
[####.com] out:    -> 0.0124s
[####.com] out: -- add_index(:subnet_domains, [:subnet_id, :domain_id], {:unique=>true})
[####.com] out:    -> 0.0078s
[####.com] out: == 20160215143900 AddSubnetDomainRelationConstraints: migrated (0.0375s) ======/usr/share/foreman/app/models/concerns/facets/managed_host_extensions.rb:43:in `block (2 levels) in register_facet_relation': stack level too deep (SystemStackError)
[####.com] out: 	from /usr/share/foreman/app/models/concerns/facets/managed_host_extensions.rb:45:in `block (2 levels) in register_facet_relation'
[####.com] out: 	from /usr/share/foreman/app/models/concerns/facets/managed_host_extensions.rb:45:in `block (2 levels) in register_facet_relation'
[####.com] out: 	from /usr/share/foreman/app/models/concerns/facets/managed_host_extensions.rb:45:in `block (2 levels) in register_facet_relation'

Expected results:
Upgrade should be successful

Additional info:
This may be caused due to another bz https://bugzilla.redhat.com/show_bug.cgi?id=1435385 that contains fix related to facets

Comment 3 Shimon Shtein 2017-04-25 11:54:33 UTC
Connecting redmine issue http://projects.theforeman.org/issues/19374 from this bug

Comment 4 Satellite Program 2017-04-25 16:09:07 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19374 has been resolved.

Comment 5 jcallaha 2017-04-26 14:15:00 UTC
Verified in Satellite 6.2.9 Snap 6

...
Upgrade Step: migrate_foreman...
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
true

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.124/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
false

Upgrade Step: Running installer...
Installing             Done                                               [100%] [..........................................................................................................]
  The full log is at /var/log/foreman-installer/satellite.log
Upgrade Step: restart_services...

Comment 6 Bryan Kearney 2017-05-01 14:29:40 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, 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/RHBA-2017:1191

Comment 7 Bryan Kearney 2017-05-01 14:29:43 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, 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/RHBA-2017:1191