Bug 1466912

Summary: --upgrade-puppet is broken as installer is trying to ensure puppet-server
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: InstallationAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: ehelms, lpramuk
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.4.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:41:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2017-06-30 17:44:48 UTC
Though I'm upgrading to puppet4 the installer first remove p3 puppet-server and later on tries to ensure that p3 puppet-server package is present.
But that fails as p4 puppet-agent got already installed.
Yet p4 server package is named puppetserver (without dash) 

Steps to reproduce:

<pre>
1. Install katello scenario using puppet3
# foreman-installer -S katello

2. Enable puppet4 repo
# rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm

3. Upgrade puppet using installer
# foreman-installer --upgrade-puppet
...
Upgrade Step: upgrade_puppet_package...

================================================================================
 Package           Arch       Version            Repository                Size
================================================================================
Removing:
 puppet-server     noarch     3.8.7-1.el7        @puppetlabs-products     4.9 k

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 4.9 k
Warning: RPMDB altered outside of yum.

Removed:
  puppet-server.noarch 0:3.8.7-1.el7                                            



================================================================================
 Package                Arch   Version                 Repository          Size
================================================================================
Installing:
 puppet-agent           x86_64 1.8.3-1.el7             puppetlabs-pc1      25 M
     replacing  facter.x86_64 1:2.4.6-1.el7
     replacing  puppet.noarch 3.8.7-1.el7
 puppetserver           noarch 2.7.2-1.el7             puppetlabs-pc1      33 M
Installing for dependencies:
 java-1.8.0-openjdk-headless
                        x86_64 1:1.8.0.121-0.b13.el7_3 rhel-7-server-rpms  31 M

Transaction Summary
================================================================================
Install  2 Packages (+1 Dependent package)
...

Puppet 3 to 4 upgrade initialization complete, continuing with installation
 Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.7-1.el7.noarch is obsoleted by puppet-agent-1.8.3-1.el7.x86_64 which is already installed
 Package: puppet-server-3.8.7-1.el7.noarch (puppetlabs-products)
           Requires: puppet = 3.8.7-1.el7
           Installed: puppet-agent-1.8.3-1.el7.x86_64 (@puppetlabs-pc1)
               puppet >= 4.0.0-1.el7
...
 /Stage[main]/Puppet::Server::Install/Package[puppet-server]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.7-1.el7.noarch is obsoleted by puppet-agent-1.8.3-1.el7.x86_64 which is already installed

</pre>

Comment 1 Lukas Pramuk 2017-06-30 17:44:53 UTC
Created from redmine issue http://projects.theforeman.org/issues/18301

Comment 3 Satellite Program 2017-06-30 18:02:00 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18301 has been resolved.

Comment 4 Lukas Pramuk 2017-06-30 18:04:23 UTC
Downstream traceback is:

# satellite-installer --upgrade-puppet
...
Puppet 3 to 4 upgrade initialization complete, continuing with installation
 Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.6-2.el7sat.noarch is obsoleted by puppet-agent-1.8.2-2.el7sat.x86_64 which is already installed
 Package: puppet-server-3.8.6-2.el7sat.noarch (satellite)
           Requires: puppet = 3.8.6-2.el7sat
           Installed: puppet-agent-1.8.2-2.el7sat.x86_64 (@puppet4_internal)
               puppet >= 4.0.0-2.el7sat
           Available: puppet-3.8.6-2.el7sat.noarch (satellite)
               puppet = 3.8.6-2.el7sat
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:232:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:101:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/yum.rb:196:in `install'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:88:in `block (3 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:487:in `set'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:561:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:134:in `sync_if_needed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:80:in `perform_changes'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:230:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:246:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:386:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:385:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
/usr/share/gems/gems/kafo-2.0.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:142:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:222:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:350:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
 /Stage[main]/Puppet::Server::Install/Package[puppet-server]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.6-2.el7sat.noarch is obsoleted by puppet-agent-1.8.2-2.el7sat.x86_64 which is already installed
 Package: puppet-server-3.8.6-2.el7sat.noarch (satellite)
           Requires: puppet = 3.8.6-2.el7sat
           Installed: puppet-agent-1.8.2-2.el7sat.x86_64 (@puppet4_internal)
               puppet >= 4.0.0-2.el7sat
           Available: puppet-3.8.6-2.el7sat.noarch (satellite)
               puppet = 3.8.6-2.el7sat
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Installing             Done                                               [100%] [.....................................]
  Something went wrong! Check the log for ERROR-level output
  The full log is at /var/log/foreman-installer/satellite.log

# rpm -qa puppet*
puppet-agent-1.8.2-2.el7sat.x86_64
puppetserver-2.7.2-2.el7sat.noarch
puppet-agent-oauth-0.5.1-3.el7.noarch

>>> though all p4 rpms are installed the installer still believes it's a p3 installation

Comment 5 Satellite Program 2017-08-03 22:02:32 UTC
Upstream bug assigned to ehelms

Comment 6 Satellite Program 2017-08-03 22:02:34 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18301 has been resolved.

Comment 7 Lukas Pramuk 2017-08-09 11:52:43 UTC
FailedQA.

@satellite-6.3.0-16.0.beta.el7sat.noarch
puppet-agent-1.8.2-2.el7sat.x86_64
puppetserver-2.7.2-2.el7sat.noarch
katello-installer-base-3.4.4-1.el7sat.noarch


The original reproducer is fixed:
1. # satellite-installer --upgrade-puppet

However, the issue (trying to ensure p3 server is present) persists upon next installer run(s):
1. # satellite-installer --upgrade-puppet

2. # satellite-installer
 satellite-installer
 Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.6-4.el7sat.noarch is obsoleted by puppet-agent-1.8.2-2.el7sat.x86_64 which is already installed
 Package: puppet-server-3.8.6-4.el7sat.noarch (satellite)
           Requires: puppet = 3.8.6-4.el7sat
           Installed: puppet-agent-1.8.2-2.el7sat.x86_64 (@puppet4_repo)
               puppet >= 4.0.0-2.el7sat
           Available: puppet-3.8.6-4.el7sat.noarch (satellite)
               puppet = 3.8.6-4.el7sat
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:232:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider.rb:101:in `execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/package/yum.rb:196:in `install'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/package.rb:88:in `block (3 levels) in <module:Puppet>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:487:in `set'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:561:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `sync'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:134:in `sync_if_needed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:80:in `perform_changes'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:230:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:246:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:386:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:385:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
/usr/share/gems/gems/kafo-2.0.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:142:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:222:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:350:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
 /Stage[main]/Puppet::Server::Install/Package[puppet-server]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-server' returned 1: Package puppet-3.8.6-4.el7sat.noarch is obsoleted by puppet-agent-1.8.2-2.el7sat.x86_64 which is already installed
 Package: puppet-server-3.8.6-4.el7sat.noarch (satellite)
           Requires: puppet = 3.8.6-4.el7sat
           Installed: puppet-agent-1.8.2-2.el7sat.x86_64 (@puppet4_repo)
               puppet >= 4.0.0-2.el7sat
           Available: puppet-3.8.6-4.el7sat.noarch (satellite)
               puppet = 3.8.6-4.el7sat
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Installing             Done                                               [100%] [.....................................]
  Something went wrong! Check the log for ERROR-level output
  The full log is at /var/log/foreman-installer/satellite.log

>>> so we need either to reset puppet params every installer run or to fix it another way

Comment 8 Eric Helms 2017-08-10 01:08:19 UTC
I cannot seem to reproduce your error. Can you please enumerate your full list of steps from installation, yum actions, installer actions, up until the error?

Comment 9 Lukas Pramuk 2017-08-10 16:43:53 UTC
Reproducer steps:

1. Install p3 Satellite (no need to setup internal capsule)
# satellite-installer -S satellite

2. Enable internal p4 repo
baseurl=http://.../pulp/repos/Sat6-CI/Library/custom/Satellite_Puppet_4_6_3_Composes/Satellite_Puppet_4_6_3_RHEL7_x86_64/

3. Upgrade to p4 using installer
# satellite-installer --upgrade-puppet

> this was fixed

4. Next installer run(s) are failing
# satellite-installer

> this still needs to be fixed

Comment 11 Lukas Pramuk 2017-09-04 12:04:22 UTC
VERIFIED.

1. Enable puppet4 repo

2. Upgrade puppet version
# satellite-installer --upgrade-puppet
Upgrading puppet...
...
Upgrade Step: upgrade_puppet_package...
...
Upgrade Step: stop_services...
...
Upgrade Step: copy_data...
...
Upgrade Step: remove_puppet_port_httpd...
...
Upgrade Step: start_httpd...
...
Puppet 3 to 4 upgrade initialization complete, continuing with installation
Resetting puppet params...
Puppet 3 to 4 upgrade param reset, continuing with installation
Installing             Done                                               [100%] [.....................................]
  Success!
  * Katello is running at https://<SATFQDN>
  * To install an additional Foreman proxy on separate machine continue by running:

      foreman-proxy-certs-generate --foreman-proxy-fqdn "$FOREMAN_PROXY" --certs-tar "/root/$FOREMAN_PROXY-certs.tar"

  The full log is at /var/log/foreman-installer/satellite.log
Upgrade Step: restart_services...
...

# exec bash
# puppet -V
4.8.1

>>> with --upgrade-puppet option the installer successfully upgraded puppet version

Comment 12 Lukas Pramuk 2017-09-04 12:07:53 UTC
@satellite-6.3.0-17.0.beta.el7sat.noarch
katello-installer-base-3.4.5-1.el7sat.noarch
puppet-agent-1.8.2-2.el7sat.x86_64
puppetserver-2.7.2-2.el7sat.noarch

Comment 13 Bryan Kearney 2018-02-21 16:39:46 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 14 Bryan Kearney 2018-02-21 16:41: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

Comment 15 Satellite Program 2018-02-21 16:51:07 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