Bug 1269021

Summary: Searching an errata with "!" displays incorrect results
Product: Red Hat Satellite Reporter: tkubota <tkubota>
Component: Errata ManagementAssignee: Justin Sherrill <jsherril>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.2CC: bbuckingham, bkearney, jsherril, sthirugn, tkubota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-23 19:10:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description tkubota 2015-10-06 03:36:04 UTC
Description of problem:
-----------------------

I tried to exclude a or some package(s) by searching but got incorrect results.
There are 587 installable errata in my test Satellite client.
When I try to exclude kernel by searching with 'package_name != kernel',
kernel erratas are not excluded.

However, when I try to exclude bind by searching with 'package_name != bind',
bind erratas are excluded.  

I tried some of packages to exclude.
I tried these below and it looked they worked fine as I expected.

'package_name !~ bind'
'package_name !~ bind or ~ ypbind'
'package_name !~ pam'
'package_name !~ pam or ~ spamassassin or ~ pam_passwdqc'
'package_name !~ net-snmp'
'package_name !~ tzdata'
'package_name !~ sqlite'
'package_name !~ selinux-policy'
'package_name !~ python'
'package_name !~ sudo'
'package_name !~ dovecot'
'package_name !~ grep'
'package_name !~ openssl'
'package_name !~ cpuspeed'
   :
   :

I tired these below and it didn't look they worked.  I don't know
why those erratas are not excluded.

'package_name !~ lvm2'
'package_name !~ kernel'
'package_name !~ sssd'


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

Red Hat Satellite Version 6.1.2 


How reproducible:
-----------------
always


Steps to Reproduce:
-------------------
1.Navigate to Web UI -> Content -> Errata Tab (or)
  Navigate to Hosts -> Content Hosts -> Select a Content host -> Errata Tab
2.Search for package_name !~ kernel


Actual results:
---------------
kernel erratas are not excluded.


Expected results:
-----------------
kernel erratas are excluded.


Additional info:
----------------

Comment 4 Justin Sherrill 2016-02-26 22:04:11 UTC
The reason for this is the way that the search works via simple sql joins.  For example in this case a particular errata (RHSA-2016:0185) contains these packages:

kernel-3.10.0-327.10.1.el7.x86_64
kernel-abi-whitelists-3.10.0-327.10.1.el7.noarch
kernel-debug-3.10.0-327.10.1.el7.x86_64
kernel-debug-devel-3.10.0-327.10.1.el7.x86_64
kernel-devel-3.10.0-327.10.1.el7.x86_64
kernel-doc-3.10.0-327.10.1.el7.noarch
kernel-headers-3.10.0-327.10.1.el7.x86_64
kernel-tools-3.10.0-327.10.1.el7.x86_64
kernel-tools-libs-3.10.0-327.10.1.el7.x86_64
perf-3.10.0-327.10.1.el7.x86_64
python-perf-3.10.0-327.10.1.el7.x86_64 

What the query 'package_name !~ kernel' actually is saying is 'return me all errata where every package in the errata's package list does not contain the word 'kernel'.  

For the above errata the following query works:

package_name !~ kernel and package_name !~ perf


This is not ideal I agree and will have to think about a possible solution

Comment 8 Bryan Kearney 2017-03-23 19:10:26 UTC
There is a an upstream issue opened for this. We will no longer be tracking this downstream. If you believe this was closed in error please feel free to re-open with additional information.

Comment 12 Bryan Kearney 2017-04-03 16:47:50 UTC
Actually, I was incorrect in my previous comment. This is not fixed upstream, but given priorties I do not believe we will be addressing this in the near term.

Comment 19 Satellite Program 2017-04-23 21:41:17 UTC
Created redmine issue http://projects.theforeman.org/issues/19356 from this bug

Comment 22 Justin Sherrill 2017-05-16 13:27:55 UTC
While reviewing some scoped search documentation (the library we use for searching), I realized that this is possible to do in 6.2:

Simply search for: 

"not package_name = nss"

And this will return you all errata that do not have the package 'nss' in it.  I believe this resolves this request.  Apologies for not realizing this earlier.