Bug 1498749 - --upgrade-puppet doesn't migrate environments in the correct location
Summary: --upgrade-puppet doesn't migrate environments in the correct location
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Eric Helms
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-05 07:18 UTC by Lukas Pramuk
Modified: 2019-09-26 14:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:46:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 21248 0 Normal Closed --upgrade-puppet doesn't migrate environments in the correct location 2020-12-30 17:54:13 UTC

Description Lukas Pramuk 2017-10-05 07:18:58 UTC
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_*,}

Comment 3 Eric Helms 2017-10-09 12:35:22 UTC
Created redmine issue http://projects.theforeman.org/issues/21248 from this bug

Comment 4 Satellite Program 2017-10-09 14:15:51 UTC
Upstream bug assigned to ehelms

Comment 5 Satellite Program 2017-10-09 14:15:54 UTC
Upstream bug assigned to ehelms

Comment 6 Satellite Program 2017-10-13 16:04:51 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21248 has been resolved.

Comment 7 Lukas Pramuk 2017-10-23 21:38:11 UTC
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/

Comment 8 Bryan Kearney 2018-02-21 16:42:41 UTC
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

Comment 9 Bryan Kearney 2018-02-21 16:46:48 UTC
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


Note You need to log in before you can comment on or make changes to this bug.