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: # 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: # 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: # 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: # 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: # service puppet restart # journalctl -efu puppet ... Oct 04 20:57:08 <HOST_FQDN> systemd[1]: Started Puppet agent. Oct 04 20:57:08 <HOST_FQDN> systemd[1]: Starting Puppet agent... Oct 04 20:57:14 <HOST_FQDN> puppet-agent[985]: Starting Puppet client version 3.8.6 Oct 04 20:57:14 <HOST_FQDN> puppet-agent[1298]: Unable to fetch my node definition, but the agent run will continue: Oct 04 20:57:14 <HOST_FQDN> puppet-agent[1298]: 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-agent[1298]: (/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-agent[1298]: (/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-agent[1298]: 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-agent[1298]: Using cached catalog Oct 04 20:57:17 <HOST_FQDN> puppet-agent[1298]: Could not retrieve catalog; skipping run Oct 04 20:57:17 <HOST_FQDN> puppet[985]: /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): # mv /etc/puppetlabs/code/environments/{environments/KT_*,}
Created redmine issue http://projects.theforeman.org/issues/21248 from this bug
Upstream bug assigned to ehelms
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21248 has been resolved.
VERIFIED. @satellite-6.3.0-21.0.beta.el7sat.noarch katello-installer-base-3.4.5.8-1.el7sat.noarch 1. Have a puppet environment 2. Upgrade puppet 3. Check migrated puppet environment location # find /etc -name KT_Default_Organization_* /etc/puppetlabs/code/environments/KT_Default_Organization_Library_RHEL7_2 /etc/puppet/environments/KT_Default_Organization_Library_RHEL7_2 >>> p3 environment gets migrated correctly into /etc/puppetlabs/code/environments/
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/RHSA-2018:0336