Project

General

Profile

Bug #21248

--upgrade-puppet doesn't migrate environments in the correct location

Added by Eric Helms over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Installer
Target version:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1498749

Description of problem:
--upgrade-puppet doesn't migrate environments in the correct location.
Environments are migrated from p3 /etc/puppet/environments to wrong "/etc/puppetlabs/code/environments/environments" and thus are not recognized by agents at hosts.
Environments should be moved into p4 "/etc/puppetlabs/code/environments":

@upgraded p4:
  1. find /etc -name KT_Default_Organization_*
    /etc/puppetlabs/code/environments/environments/KT_Default_Organization_Library_RHEL7_2 < p4 but wrong location !!!
    /etc/puppet/environments/KT_Default_Organization_Library_RHEL7_2 < p3 original
@fresh p4:
  1. find /etc -name KT_Default_Organization_*
    /etc/puppetlabs/code/environments/KT_Default_Organization_Library_RHEL7_2

Version-Release number of selected component (if applicable):
satellite-6.3.0-19.0.beta.el7sat.noarch
satellite-installer-6.3.0.4-1.beta.el7sat.noarch
katello-installer-base-3.4.5.2-1.el7sat.noarch

How reproducible:

Steps to Reproduce:

1. Have an puppet environment with a module applied on a host:

  1. hammer environment info --name KT_Default_Organization_Library_RHEL7_2
    Id: 2
    Name: KT_Default_Organization_Library_RHEL7_2
    Puppetclasses:
    access_insights_client
    foreman_scap_client
    foreman_scap_client::params
    mc <<< applied module
    stdlib
    stdlib::stages
    Locations:
    Default Location
    Organizations:
    Default Organization
    Created at: 2017/10/04 15:46:13
    Updated at: 2017/10/04 15:46:13

2. Upgrade puppet:

  1. satellite-installer --upgrade-puppet
    ...
    Upgrade Step: copy_data...
    cp -rfp /etc/puppet/environments /etc/puppetlabs/code/environments finished successfully!
    cp -rfp /var/lib/puppet/ssl /etc/puppetlabs/puppet finished successfully!
    cp -rfp /var/lib/puppet/foreman_cache_data /opt/puppetlabs/puppet/cache/ finished successfully!
    ...

3. Check up the environment after puppet upgrade:

@HOST:
  1. service puppet restart
  2. journalctl -efu puppet
    ...
    Oct 04 20:57:08 <HOST_FQDN> systemd1: Started Puppet agent.
    Oct 04 20:57:08 <HOST_FQDN> systemd1: Starting Puppet agent...
    Oct 04 20:57:14 <HOST_FQDN> puppet-agent985: Starting Puppet client version 3.8.6
    Oct 04 20:57:14 <HOST_FQDN> puppet-agent1298: Unable to fetch my node definition, but the agent run will continue:
    Oct 04 20:57:14 <HOST_FQDN> puppet-agent1298: Find /KT_Default_Organization_Library_RHEL7_2/node/<HOST_FQDN>?transaction... resulted in 404 with the message: {"message":"Not Found: Could not find environment 'KT_Default_Organization_Library_RHEL7_2'","issue_kind":"RUNTIME_ERROR"}
    Oct 04 20:57:14 <HOST_FQDN> puppet-agent1298: (/File[/var/lib/puppet/facts.d]) Could not evaluate: Could not retrieve information from environment KT_Default_Organization_Library_RHEL7_2 source(s) puppet://<SAT_FQDN>/pluginfacts
    Oct 04 20:57:14 <HOST_FQDN> puppet-agent1298: (/File[/var/lib/puppet/lib]) Could not evaluate: Could not retrieve information from environment KT_Default_Organization_Library_RHEL7_2 source(s) puppet://<SAT_FQDN>/plugins
    Oct 04 20:57:17 <HOST_FQDN> puppet-agent1298: Could not retrieve catalog from remote server: Find /KT_Default_Organization_Library_RHEL7_2/catalog/<HOST_FQDN>?facts_fo... resulted in 404 with the message: {"message":"Not Found: Could not find environment 'KT_Default_Organization_Library_RHEL7_2'","issue_kind":"RUNTIME_ERROR"}
    Oct 04 20:57:17 <HOST_FQDN> puppet-agent1298: Using cached catalog
    Oct 04 20:57:17 <HOST_FQDN> puppet-agent1298: Could not retrieve catalog; skipping run
    Oct 04 20:57:17 <HOST_FQDN> puppet985: /usr/share/ruby/vendor_ruby/puppet/agent.rb:87:in `exit': no implicit conversion from nil to integer (TypeError)

Actual results:
environments in wrong location thus not recognized by agents

Expected results:
environments moved into correct location and recognized by agents

Workaround (after puppet upgrade):
  1. mv /etc/puppetlabs/code/environments/{environments/KT_*,}

Associated revisions

Revision 8005830a (diff)
Added by Eric Helms over 4 years ago

Fixes #21248 - Properly copy environments in Puppet 4 upgrade

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Eric Helms
  • Pull request https://github.com/Katello/katello-installer/pull/548 added

#2 Updated by Justin Sherrill over 4 years ago

  • Legacy Backlogs Release (now unused) set to 250

#3 Updated by Eric Helms over 4 years ago

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

#4 Updated by The Foreman Bot over 4 years ago

  • Pull request https://github.com/Katello/katello-installer/pull/554 added

#5 Updated by Andrew Kofink over 4 years ago

  • Pull request deleted (https://github.com/Katello/katello-installer/pull/554)

#6 Updated by The Foreman Bot over 4 years ago

  • Pull request https://github.com/Katello/katello-installer/pull/554 added

Also available in: Atom PDF