[PUP-1270] 'pkg' package provider does not understand IPS package versions properly Created: 2013/12/30  Updated: 2019/04/04  Resolved: 2014/12/08

Status: Closed
Project: Puppet
Component/s: Types and Providers
Affects Version/s: None
Fix Version/s: PUP 4.0.0

Type: Bug Priority: Normal
Reporter: redmine.exporter Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: redmine, solaris
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Story Points: 2
Sprint: Week 2014-1-29 to 2014-2-05, Week 2014-2-5 to 2014-2-12
QA Contact: Narmadha Perumal

 Description   

It would seem the 'pkg' provider (for illumos/Solaris/OpenSolaris IPS) does not
do the right thing with IPS package versions. We're running OmniOS and seeing
this:

    kekkonen ~ % pfexec puppet apply -e 'package {"mdb": ensure => latest }'
    Notice: Compiled catalog for kekkonen.niksula.hut.fi in environment production in 1.17 seconds
    Notice: Finished catalog run in 6.39 seconds
    kekkonen ~ % pfexec pkg update -nv mdb                                                  
                Packages to update:        1
         Estimated space available: 14.11 TB
    Estimated space to be consumed: 24.61 MB
           Create boot environment:       No
    Create backup boot environment:      Yes
              Rebuild boot archive:       No
 
    Changed packages:
    omnios
      developer/debug/mdb
        0.5.11,5.11-0.151006:20130731T194820Z -> 0.5.11,5.11-0.151006:20131019T183740Z

So puppet thinks there are no updates, but pkg correctly notices that an update
is available (only the timestamp has changed, not the version, build release,
or branch numbers).

puppet resource provides some insight into this:

    kekkonen ~ % puppet resource package mdb
    package { 'mdb':
      ensure => '0.5.11-0.151006',
    }

This version number is not correct, it's missing the build release (5.11) and
timestamp.



 Comments   
Comment by Lauri Tirkkonen [ 2013/12/30 ]

https://github.com/puppetlabs/puppet/pull/2200

Comment by Lauri Tirkkonen [ 2014/01/07 ]

As stated in the PR I would appreciate if someone who knows more about package providers would provide some assistance with the implementation details.

Comment by Kylo Ginsberg [ 2014/02/11 ]

See discussion in the PR, but tl;dr is I'm kinda stumped on how best to handle this and opened up a thread on puppet-dev asking for advice.

Comment by Kylo Ginsberg [ 2014/02/19 ]

More discussion in the pull. I'm pulling this out of the sprint. When someone comes up for air and we have a repro on Solaris 11, let's pull it out of the backlog.

Comment by Adrien Thebo [ 2014/11/12 ]

Cody Herriges has said that he'll take a look at this change.

Comment by Josh Cooper [ 2014/12/04 ]

Merged in 4526459 and acceptance fixes updated in 573cbacaf

Comment by John Duarte [ 2014/12/08 ]

Verified that puppet resource includes the full version if the IPS package.

Previous result (using puppet 3.7.2)

root@euyfsxgrq58ig03:~/puppet-3.7.2# ./bin/puppet resource package mdb
package { 'mdb':
  ensure => '0.5.11-0.175.1.0.0.24.2',
}
root@euyfsxgrq58ig03:~/puppet-3.7.2# ./bin/puppet apply -e 'package {"mdb": ensure => latest }'
Notice: Compiled catalog for euyfsxgrq58ig03.delivery.puppetlabs.net in environment production in 0.11 seconds
Warning: pkg warning: 
Notice: /Stage[main]/Main/Package[mdb]/ensure: ensure changed '0.5.11-0.175.1.0.0.24.2' to 'latest'
Notice: Finished catalog run in 10.03 seconds

Current result (using puppet at SHA 8a1cbb162)

root@de3pgjn5mmiq151:~# puppet resource package mdb
package { 'mdb':
  ensure => '0.5.11,5.11-0.175.1.0.0.24.2:20120919T184217Z',
}
root@de3pgjn5mmiq151:~# puppet -V
3.7.3
root@de3pgjn5mmiq151:~# puppet resource package mdb
package { 'mdb':
  ensure => '0.5.11,5.11-0.175.1.0.0.24.2:20120919T184217Z',
}
root@de3pgjn5mmiq151:~# puppet apply -e 'package {"mdb": ensure => latest }'
Notice: Compiled catalog for de3pgjn5mmiq151.delivery.puppetlabs.net in environment production in 0.59 seconds
Notice: /Stage[main]/Main/Package[mdb]/ensure: ensure changed '0.5.11,5.11-0.175.1.0.0.24.2:20120919T184217Z' to 'latest'
Notice: Applied catalog in 10.42 seconds
root@de3pgjn5mmiq151:~# pkg update -nv mdb
No updates available for this image.

Comment by Josh Cooper [ 2014/12/08 ]

I don't think this is correct. If the currently installed version is:

package { 'mdb':
  ensure => '0.5.11,5.11-0.175.1.0.0.24.2:20120919T184217Z',
}

And you do ensure => latest, then I wouldn't expect latest to install the version that is already installed:

ensure changed '0.5.11,5.11-0.175.1.0.0.24.2:20120919T184217Z' to 'latest'

I suspect that puppet will "reinstall" that version every time you specify "latest", which it shouldn't do.

Comment by Lauri Tirkkonen [ 2014/12/09 ]

Josh, I think that's a separate bug in 'latest'. I am not seeing it on my test package, using puppet 87fad92f18966ea62544df16d251885794c5ec92 under OmniOS:

kekkonen ~/repos/puppet 141 % pkg list -vfa PUP-1270-test-package
FMRI                                                                         IFO
pkg://niksula.hut.fi/PUP-1270-test-package@1.2,5.11-0.151006:20140930T124721Z i--
pkg://niksula.hut.fi/PUP-1270-test-package@1.2,5.11-0.151006:20140930T115744Z ---
pkg://niksula.hut.fi/PUP-1270-test-package@1.1,5.11:20140219T191731Z         ---
pkg://niksula.hut.fi/PUP-1270-test-package@1.0,5.11-0.151006:20140220T084443Z ---
pkg://niksula.hut.fi/PUP-1270-test-package@1.0,5.11:20140219T191632Z         ---
pkg://niksula.hut.fi/PUP-1270-test-package@1.0,5.11:20140219T191204Z         ---
kekkonen ~/repos/puppet % RUBYLIB=`pwd`/lib pfexec ./bin/puppet apply --verbose -e 'package {"PUP-1270-test-package": ensure => latest }'
Notice: Compiled catalog for kekkonen.niksula.hut.fi in environment production in 1.55 seconds
Info: Applying configuration version '1418118002'
Notice: Applied catalog in 1.29 seconds

I do, however, see it for a package which has a greater version available (but which is not installable)

kekkonen ~/repos/puppet % pkg list -vfa mdb
FMRI                                                                         IFO
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151008:20131204T022439Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20140622T160130Z       i--
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20140404T045546Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20131019T183740Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130731T194820Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130624T214930Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130506T161059Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151004:20121011T224059Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120614T212626Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120418T225329Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120401T174139Z       ---
kekkonen ~/repos/puppet % RUBYLIB=`pwd`/lib pfexec ./bin/puppet apply --verbose -e 'package {"mdb": ensure => latest }'
Notice: Compiled catalog for kekkonen.niksula.hut.fi in environment production in 2.31 seconds
Info: Applying configuration version '1418118115'
Notice: /Stage[main]/Main/Package[mdb]/ensure: ensure changed '0.5.11,5.11-0.151006:20140622T160130Z' to 'latest'
Notice: Applied catalog in 10.39 seconds
kekkonen ~/repos/puppet % pkg list -vfa mdb
FMRI                                                                         IFO
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151008:20131204T022439Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20140622T160130Z       i--
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20140404T045546Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20131019T183740Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130731T194820Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130624T214930Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151006:20130506T161059Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151004:20121011T224059Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120614T212626Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120418T225329Z       ---
pkg://omnios/developer/debug/mdb@0.5.11,5.11-0.151002:20120401T174139Z       ---

However, that bug existed before merging the fix for this one:

HEAD is now at 75ec21b... Merge branch 'pr/3255'
kekkonen ~/repos/puppet % RUBYLIB=`pwd`/lib pfexec ./bin/puppet apply --verbose -e 'package {"mdb": ensure => latest }'
Notice: Compiled catalog for kekkonen.niksula.hut.fi in environment production in 0.78 seconds
Info: Applying configuration version '1418118398'
Notice: /Stage[main]/Main/Package[mdb]/ensure: ensure changed '0.5.11-0.151006' to 'latest'
Notice: Applied catalog in 9.53 seconds

Comment by Josh Cooper [ 2015/01/06 ]

Thanks Lauri Tirkkonen! Would you mind searching jira to see if there is already a ticket, and if not, filing one?

Comment by Lauri Tirkkonen [ 2015/01/06 ]

https://tickets.puppetlabs.com/browse/PUP-3811


Lauri Tirkkonen | +358 50 5341376 | lotheac @ IRCnet

Generated at Sat Dec 07 15:49:45 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.