Jira (PUP-10410) package fails on openjdk with non-boolean status string

0 views
Skip to first unread message

Matt (Jira)

unread,
Apr 4, 2020, 7:20:03 PM4/4/20
to puppe...@googlegroups.com
Matt created an issue
 
Puppet / Bug PUP-10410
package fails on openjdk with non-boolean status string
Issue Type: Bug Bug
Affects Versions: PUP 6.14.0
Assignee: Unassigned
Components: Language
Created: 2020/04/04 4:19 PM
Environment:

All tested environments and builds

Priority: Normal Normal
Reporter: Matt
Original Estimate: 2 hours
Remaining Estimate: 2 hours

Puppet Version: 3.0 - 6.14
Puppet Server Version: 3.0 - 6.9.2
OS Name/Version: RHEL+CentOS 7 and 8

Puppet package fails to install or update java-1.8.0-openjdk-headless.  This has been consistent for 2 generations of RH linux kernels and 4 generations of Puppet

To reproduce:

  • Install a fresh build of RHEL or CentOS (reproducable on all modern versions, I tested on CentOS 8.1.1 and replicated on RHEL and CentOS 7.5 and 7.7(
  • Install Puppet (tested on puppetmaster 6.9.2-1, reproduced as far back as 3.1)
  • Try and install openjdk - headless
    matt@vm041:72% sudo puppet resource package java-1.8.0-openjdk-headless ensure=present
    package { 'java-1.8.0-openjdk-headless':   ensure   => '1:1.8.0.242.b08-0.el8_1',   provider => 'dnf', }

    matt@vm041:73%
     
    Notice that the ensure value returns a version, not a Boolean.  When I try installing the package from a manifest I get the following error:
     
    package

    { ' java-1.8.0-openjdk-headless':     ensure => true, }

     
    matt@vm041: 73% sudo puppet agent --test
    ...
    Info: Applying configuration version '1586032186'
    Error: undefined method `index' for true:TrueClass
    Info: Unknown failure using insync_values? on type: Package[java-1.8.0-openjdk-headless] / property: ensure to compare values [true] and 1:1.8.0.242.b08-0.el8_1
    Error: /Stage[main]/Linux/Package[java-1.8.0-openjdk-headless]/ensure: change from '1:1.8.0.242.b08-0.el8_1' to true failed: undefined method `index' for true:TrueClass
    Info: Stage[main]: Unscheduling all events on Stage[main]
    Notice: Applied catalog in 10.02 seconds
    matt@vm041:74%
     
    Installing the non-headless version works as expected.  Installing the package through dnf or yum works as expected
    Desired Behavior:

puppet package returns a boolean value, run exits with success

Actual Behavior:

puppet package returns a string value and fails the run

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Matt (Jira)

unread,
Apr 4, 2020, 7:25:03 PM4/4/20
to puppe...@googlegroups.com
Matt commented on Bug PUP-10410
 
Re: package fails on openjdk with non-boolean status string

The problem does not happen on run 1; the package installs correctly

 

The problem happens on run 1+N when puppet package is trying to detect the currently installed version.  The problem may be stated incorrectly above where code is expecting a version string and receiving a bool?

Josh Cooper (Jira)

unread,
Apr 6, 2020, 1:23:03 PM4/6/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 7, 2020, 9:09:04 AM4/7/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 7, 2020, 1:53:03 PM4/7/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10410
 
Re: package fails on openjdk with non-boolean status string

For next time, it helps to run with the --trace command line argument so it will print the ruby stacktrace leading up to the problem.

Mihai Buzgau (Jira)

unread,
Apr 8, 2020, 5:11:03 AM4/8/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-04-15

Mihai Buzgau (Jira)

unread,
Apr 8, 2020, 5:11:03 AM4/8/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 10, 2020, 5:11:03 AM4/10/20
to puppe...@googlegroups.com
Mihai Buzgau commented on Bug PUP-10410
 
Re: package fails on openjdk with non-boolean status string

Hi Matt!

Puppet supports the following values for ensure property:

  • present
  • absent
  • purged
  • held
  • installed
  • latest
  • /./

More info here: https://puppet.com/docs/puppet/latest/types/package.html#package-attribute-ensure

Can please consider changing your manifest from:

package { ' java-1.8.0-openjdk-headless':
  ensure => true,
} 

to 

package { ' java-1.8.0-openjdk-headless':
  ensure => installed,
} 

If you want have puppet check if the package is installed and install it if it is not.

or

package { ' java-1.8.0-openjdk-headless':
  ensure => latest,
} 

 if you want to get the latest version.

or

package { ' java-1.8.0-openjdk-headless':
  ensure => 1:1.8.0.242.b08-0.el8_1,
} 

 If you want to have the 1:1.8.0.242.b08-0.el8_1 installed.

 

Reply all
Reply to author
Forward
0 new messages