Bug 1904369 - Package dependency is wrong on Satellite UI
Summary: Package dependency is wrong on Satellite UI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.7.0
Hardware: All
OS: All
medium
medium vote
Target Milestone: 6.10.0
Assignee: Justin Sherrill
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-04 08:59 UTC by Avijit Roy
Modified: 2021-11-16 14:09 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-katello-4.1.1.17-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:33 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32358 0 Normal New Package dependency is wrong on Satellite UI 2021-04-20 12:59:23 UTC
Foreman Issue Tracker 33407 0 None None None 2021-09-10 17:40:47 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:44 UTC

Description Avijit Roy 2020-12-04 08:59:54 UTC
Description of problem:

For Example: tfm-rubygem-hammer_cli_foreman_tasks

If we check the dependency using rpm we see the below output. 

rpm -q --requires tfm-rubygem-hammer_cli_foreman_tasks
config(tfm-rubygem-hammer_cli_foreman_tasks) = 0.0.14-1.el7sat
rh-ruby25-ruby(release)
rh-ruby25-ruby(rubygems)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
tfm-rubygem(hammer_cli_foreman) > 0.1.1
tfm-rubygem(hammer_cli_foreman) < 3.0.0 
tfm-rubygem(powerbar) >= 1.0.11
tfm-rubygem(powerbar) < 3.0
tfm-runtime
rpmlib(PayloadIsXz) <= 5.2-1

For the same package, the UI shows a different result. 

Content >> Packages >> Serach for 'tfm-rubygem-hammer_cli_foreman_tasks' >> Dependencies

rh-ruby25-ruby(release)
rh-ruby25-ruby(rubygems)
tfm-rubygem(hammer_cli_foreman) > 0.1.1
tfm-rubygem(hammer_cli_foreman) > 3.0.0   -----> This is showing diffrent in rpm output. 
tfm-rubygem(powerbar) > 3.0  -----> This is showing diffrent in rpm output.
tfm-rubygem(powerbar) >= 1.0.11
tfm-runtime

Version-Release number of selected component (if applicable):
Satellite 6.7+


Actual results:

rpm -q --requires and dependency on satellite UI is showing different information. 


Expected results:
rpm -q --requires and dependency on satellite UI should produce similar information. 

Additional info:

Comment 2 Tanya Tereshchenko 2021-04-20 08:04:31 UTC
Hi Brad, could someone from Katello share how the look up for dependencies is performed int he UI and how Pulp is involved.
I'm struggling a bit to figure out which API call can be used for that. Thanks!

Comment 4 Justin Sherrill 2021-04-20 12:59:20 UTC
Created redmine issue https://projects.theforeman.org/issues/32358 from this bug

Comment 7 Tanya Tereshchenko 2021-04-20 14:38:17 UTC
Nice! Moving to Repositories in a hope that it's the right component :)

Thanks for the fix, Justin!

Comment 8 Bryan Kearney 2021-04-20 19:52:48 UTC
Upstream bug assigned to jsherril

Comment 9 Bryan Kearney 2021-04-20 19:52:50 UTC
Upstream bug assigned to jsherril

Comment 10 Bryan Kearney 2021-04-21 20:04:37 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32358 has been resolved.

Comment 11 Tasos Papaioannou 2021-06-01 17:25:16 UTC
The issue still exists with the fix present.

If I make the corresponding changes in app/services/katello/pulp3/rpm.rb and restart services, then the issue is resolved:

# diff -pruN /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.1/app/services/katello/pulp3/rpm.rb.bak /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.1/app/services/katello/pulp3/rpm.rb
--- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.1/app/services/katello/pulp3/rpm.rb.bak	2021-06-01 13:16:53.480136494 -0400
+++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.1/app/services/katello/pulp3/rpm.rb	2021-06-01 13:17:14.299521837 -0400
@@ -27,7 +27,7 @@ module Katello
 
       def requires
         results = []
-        flags = {'GT' => '>', 'LT' => '>', 'EQ' => '=', 'GE' => '>=', 'LE' => '<='}
+        flags = {'GT' => '>', 'LT' => '<', 'EQ' => '=', 'GE' => '>=', 'LE' => '<='}
 
         backend_data['requires']&.each do |requirement|
           requires_str = ""
@@ -46,7 +46,7 @@ module Katello
 
       def provides
         results = []
-        flags = {'GT' => '>', 'LT' => '>', 'EQ' => '=', 'GE' => '>=', 'LE' => '<='}
+        flags = {'GT' => '>', 'LT' => '<', 'EQ' => '=', 'GE' => '>=', 'LE' => '<='}
 
         backend_data['provides']&.each do |provided|
           provides_str = ""

Comment 12 Brad Buckingham 2021-09-10 17:40:48 UTC
Associating a redmine that addresses that failedqa and moving to POST as PR is merged upstream.

Comment 16 addubey 2021-10-26 08:49:25 UTC
Verified.


Tested on: Satellite-6.10.0 Snap 24.0


Steps followed: 

1. Checking dependency with (rpm -q --requires tfm-rubygem-hammer_cli_foreman_tasks) on the stdout

2. Navigate to Content >> Packages >> Search for 'tfm-rubygem-hammer_cli_foreman_tasks' >> Dependencies



Observation: rpm -q --requires on stdout and dependency on satellite UI possess similar information.

Comment 19 errata-xmlrpc 2021-11-16 14:09:33 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 (Moderate: Satellite 6.10 Release), 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-2021:4702


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