Project

General

Profile

Actions

Bug #15641

closed

foreman-proxy config file migrations fail with missing migration state file

Added by Paul Smyth over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Debian/Ubuntu
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Upgraded to version 1.12 and now puppet and therefore the key component is broke.

Disabling all modules in the group ['puppet'] due to a failure in one of them: Parameter ':puppet_version' is expected to have a non-empty value
Backtrace
/usr/share/foreman-proxy/modules/puppet_proxy/configuration_loader.rb:4:in `load_programmable_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:289:in `load_programmable_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:246:in `load_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:60:in `load_plugin_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:147:in `block in initialize_plugins'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:147:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:147:in `initialize_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:122:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'

Actions #1

Updated by Dominic Cleal over 7 years ago

  • Status changed from New to Feedback

The error's stating that you don't have :puppet_version set in puppet.yml (usually in /etc/foreman-proxy/settings.d/), see https://theforeman.org/manuals/1.12/index.html#4.3.6Puppet for the configuration - the smart proxy Puppet config files have changed.

If you're using packages, config files should be migrated during the upgrade. I think /var/log/foreman-proxy/migrate_settings.log will contain the process logs.

If you're using a source installation, run rake migrate_settings.

If you're using theforeman/foreman_proxy to configure the smart proxy, upgrade it to the latest version.

Actions #2

Updated by Paul Smyth over 7 years ago

I've used packages on Ubuntu, afaik.

Migrate settings log contains this:
/usr/share/foreman-proxy/extra/migrate_settings.rb:16:in `load_past_migrations!': Migration state file /usr/share/foreman-proxy/config/migration_state can't be found (RuntimeError)
from /usr/share/foreman-proxy/extra/migrate_settings.rb:264:in `<main>'

Adding this has now broken two components instead of one

Disabling all modules in the group ['puppet_proxy_legacy', 'puppet'] due to a failure in one of them: Provider 'puppet_proxy_legacy' settings conflict with the main plugin's settings: [:puppet_conf, :puppet_ssl_ca]

/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:276:in `merge_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:245:in `load_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:81:in `block in load_provider_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in `load_provider_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `block in initialize_plugins'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `initialize_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:122:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'

This is despite the fact that I've corrected puppet_proxy_legacy.yml to contain the correct entries and confirmed they match puppet.conf

Actions #3

Updated by Dominic Cleal over 7 years ago

  • Tracker changed from Support to Bug
  • Project changed from Foreman to Packaging
  • Subject changed from Disabling all modules in the group ['puppet'] due to a failure in one of them: Parameter ':puppet_version' is expected to have a non-empty value to foreman-proxy config file migrations fail with missing migration state file
  • Category changed from Puppet integration to Debian/Ubuntu
  • Status changed from Feedback to Assigned
  • Assignee set to Dominic Cleal
  • Priority changed from Urgent to Normal

Paul Smyth wrote:

I've used packages on Ubuntu, afaik.

Migrate settings log contains this:
/usr/share/foreman-proxy/extra/migrate_settings.rb:16:in `load_past_migrations!': Migration state file /usr/share/foreman-proxy/config/migration_state can't be found (RuntimeError)
from /usr/share/foreman-proxy/extra/migrate_settings.rb:264:in `<main>'

Thanks, this looks like a bug in the Debian package I introduced in 38a2776. Running touch /etc/foreman-proxy/migration_state should fix this for future upgrades.

Adding this has now broken two components instead of one

Disabling all modules in the group ['puppet_proxy_legacy', 'puppet'] due to a failure in one of them: Provider 'puppet_proxy_legacy' settings conflict with the main plugin's settings: [:puppet_conf, :puppet_ssl_ca]

/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:276:in `merge_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:245:in `load_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:81:in `block in load_provider_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in `load_provider_settings'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `block in initialize_plugins'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:155:in `initialize_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:122:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'

This is despite the fact that I've corrected puppet_proxy_legacy.yml to contain the correct entries and confirmed they match puppet.conf

It's likely that you have duplicate entries now between config files, entries that shouldn't be in puppet.yml, though it's hard to tell without seeing all of the configs. There are quite a few steps to the migration, not only that change.

I'd suggest running:

  1. touch /etc/foreman-proxy/migration_state
  2. ruby /usr/share/foreman-proxy/extra/migrate_settings.rb
  3. mkdir ~/foreman-proxy-configs-backup
  4. cp -a /etc/foreman-proxy/settings.d/* ~/foreman-proxy-configs-backup/
  5. cp /usr/share/foreman-proxy/tmp/result/settings.d/*.yml /etc/foreman-proxy/settings.d/
  6. chgrp foreman-proxy /etc/foreman-proxy/settings.d/*.yml
  7. service foreman-proxy restart

This should run the proper migrations and activate them.

Actions #4

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-packaging/pull/1220 added
Actions #5

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release set to 161
Actions #6

Updated by Paul Smyth over 7 years ago

Confirmed as resolved. Thanks Dominic

Actions #7

Updated by Dominic Cleal over 7 years ago

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

Also available in: Atom PDF