Bug #15011

migrate_foreman error upgrading from 6.1 to 6.2 -> error: katello_content_facets during foreman migration

Added by Ivan Necas about 6 years ago. Updated almost 4 years ago.

Plugin integration
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from
Description of problem:

Attempting to upgrade to an early version of Satellite 6.2 Beta (internal build) from 6.1 is resulting in an error during foreman_migrate.

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


How reproducible:


Steps to Reproduce:
1. install Satellite 6.1
2. update packages to Satellite 6.2
3. patch system to include fixes for bug 1332700 and bug 1333027
4. foreman-installer --upgrade

Actual results:

  1. foreman-installer --upgrade
    Upgrade Step: stop_services...
    Upgrade Step: start_databases...
    Upgrade Step: update_http_conf...
    Upgrade Step: migrate_pulp...
    Upgrade Step: start_httpd...
    Upgrade Step: migrate_candlepin...
    Upgrade Step: migrate_foreman...
    Upgrade step migrate_foreman failed. Check logs for more information.

Expected results:

No error during the migrate_foreman step.

Additional info:

Note: see attached log for complete installer run.

In the /var/log/foreman-installer/katello.log, the following is observed:


[ERROR 2016-05-10 22:03:29 main] API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
/opt/theforeman/tfm/root/usr/share/gems/gems/katello- warning: already initialized constant Katello::WhitelistConstraint::PATHS
/opt/theforeman/tfm/root/usr/share/gems/gems/katello- warning: previous definition of PATHS was here
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::Error: ERROR: relation "katello_content_facets" does not exist
LINE 5: WHERE a.attrelid = '"katello_content_facets"'...
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"katello_content_facets"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum


/usr/share/foreman/db/migrate/20140910153654_move_host_nics_to_interfaces.rb:24:in `block in up'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/usr/share/foreman/db/migrate/20140910153654_move_host_nics_to_interfaces.rb:20:in `up'


Associated revisions

Revision d1e1d191 (diff)
Added by Ivan Necas about 6 years ago

Fixes #15011 - don't expect the facet tables in migration

The problem was the
db/migrate/20140910153654_move_host_nics_to_interfaces.rb tries to
read the attributes that get extended by the facets, but the facets
table might not be ready yet.

To avoid unnecessary checks in production where the host.attributes
is used pretty heavily, we define the method with checks in migration


#1 Updated by Ivan Necas about 6 years ago

  • Category set to Plugin integration
  • Status changed from New to Assigned

#2 Updated by The Foreman Bot about 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request added

#3 Updated by Ivan Necas about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 6 years ago

  • Legacy Backlogs Release (now unused) set to 136

Also available in: Atom PDF