Jira (PUP-10430) Yum package provider update/downgrade not working correctly with epochs

9 views
Skip to first unread message

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:36:09 AM4/21/20
to puppe...@googlegroups.com
Gheorghe Popescu created an issue
 
Puppet / Bug PUP-10430
Yum package provider update/downgrade not working correctly with epochs
Issue Type: Bug Bug
Affects Versions: PUP 6.14.0, PUP 5.5.19
Assignee: Unassigned
Components: Types and Providers
Created: 2020/04/21 7:35 AM
Priority: Normal Normal
Reporter: Gheorghe Popescu

When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch.

Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters:  https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167

 

This can be reproduces using `python-docker-pycreds` package on a redhat7 box.

available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7

installed version: 1:0.3.0-7.el7

running: 

❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum

results in trying to use `update` flag with an older version:

Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7 Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’ Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’ Debug: Cannot parse 1.10.6-3.el7 as a RPM version range Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead

 

 

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

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:37:14 AM4/21/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch.

Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters: [ https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167|https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167]


 

This can be reproduces using `python-docker-pycreds` package on a redhat7 box.

available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7

installed version: 1:0.3.0-7.el7

running: 
{noformat}
❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum{noformat}

results in trying to use `update` flag with an older version:
{noformat}
Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7 Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’ Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’ Debug: Cannot parse 1.10.6-3.el7 as a RPM version range Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
{noformat}
 

 

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:38:07 AM4/21/20
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:39:06 AM4/21/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch.

Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters .

rpm comparions
  https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167|https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167]

usage in yum:   [https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/yum.rb#L279-L284]

 

This can be reproduces using `python-docker-pycreds` package on a redhat7 box.

available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7

installed version: 1:0.3.0-7.el7

running: 
{noformat}❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum{noformat}
results in trying to use `update` flag with an older version:
{noformat}

Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7
Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’
Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’
Debug: Cannot parse 1.10.6-3.el7 as a RPM version range
Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
{noformat}
 

 

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:40:03 AM4/21/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch.

Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters.

rpm comparions:  [ https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167|https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167]

usage in yum: [https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/yum.rb#L279-L284]

 

This can be reproduces reproduced using `python-docker-pycreds` package on a redhat7 box.


available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7

installed version: 1:0.3.0-7.el7

running: 
{noformat}❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum{noformat}
results in trying to use `update` flag with an older version:
{noformat}Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7
Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’
Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’
Debug: Cannot parse 1.10.6-3.el7 as a RPM version range
Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
{noformat}
 

 

Gheorghe Popescu (Jira)

unread,
Apr 21, 2020, 10:42:03 AM4/21/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch
.


Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters.

rpm comparions:  [ https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167|https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167]

usage in yum: [https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/yum.rb#L279-L284]

 

This can be reproduced using `python-docker-pycreds` package on a redhat7 box.

Example:

-
available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7

- installed version: 1:0.3.0-7.el7


running: 
{noformat}❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum{noformat}
results in trying to use `update` flag with an older version:
{noformat}Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7
Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’
Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’
Debug: Cannot parse 1.10.6-3.el7 as a RPM version range
Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
{noformat}
 

 
Reply all
Reply to author
Forward
0 new messages