[Satellite6] Upgrade Step: migrate_foreman is failing Gem loading error: Unable to activate fog-1.38.0, because fog-core-2.1.0 conflicts with fog-core (~> 1.32)
Environment
Satellite 6.5
Satellite 6.6
Issue
Upgrading of satellite is failing
[ INFO 2019-12-11T11:21:54 main] Upgrade Step: migrate_foreman...
[DEBUG 2019-12-11T11:21:59 main] rake aborted!
[DEBUG 2019-12-11T11:21:59 main] Gem loading error: Unable to activate fog-1.38.0, because fog-core-2.1.0 conflicts with fog-core (~> 1.32)
[DEBUG 2019-12-11T11:21:59 main] Caused by:
[DEBUG 2019-12-11T11:21:59 main] Gem::ConflictError: Unable to activate fog-1.38.0, because fog-core-2.1.0 conflicts with fog-core (~> 1.32)
[DEBUG 2019-12-11T11:21:59 main] /opt/theforeman/tfm/root/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
[ERROR 2019-12-11T11:21:59 main] foreman-rake db:migrate failed! Check the output for error!
[ERROR 2019-12-11T11:21:59 main] Upgrade step migrate_foreman failed. Check logs for more information.
[DEBUG 2019-12-11T11:21:59 main] Exit with status code: 1 (signal was 1)
[ERROR 2019-12-11T11:21:59 main] Errors encountered during run:
[ERROR 2019-12-11T11:21:59 main] foreman-rake db:migrate failed! Check the output for error!
======================
foreman-rake db:migrate is failing
rake aborted!
Gem loading error: Unable to activate fog-1.38.0, because fog-core-2.1.0 conflicts with fog-core (~> 1.32)
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/output.rb:13:in `strict_err'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:52:in `rescue in rescue in block in system_require'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:43:in `rescue in block in system_require'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:39:in `block in system_require'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext/runtime.rb:37:in `system_require'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:19:in `block in system_require'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/bundler_ext-0.4.1/lib/bundler_ext.rb:14:in `system_require'
/usr/share/foreman/config/application.rb:17:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/opt/rh/rh-ruby25/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/share/foreman/Rakefile:1:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `load'
/opt/rh/rh-ruby25/root/usr/bin/rake:23:in `<main>'
Resolution
Check if there are This content is not included.duplicate rpms
If yes, clean the duplicates first.
Identify obsolete rubygems which are not owned by any installed rpms
#cd /opt/theforeman/tfm/root/usr/share/gems/gems
#ls | xargs rpm -qf * | grep -i 'not owned by any package'
Delete identified obsolete rubygems and empty directories.
#ls | xargs rpm -qf * | grep -i 'not owned by any package' | awk -F ' ' '{print $2}' | xargs rm -rf
Restart satellite services
#foreman-maintain service restart
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
fog-1.38 was not deleted from /opt/theforeman/tfm/root/usr/share/gems/gems during #yum update transaction and it is referencing to old rubygem versions which are no longer available.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.