Bug 1269021 - Searching an errata with "!" displays incorrect results
Searching an errata with "!" displays incorrect results
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Errata Management (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: GA
: --
Assigned To: Justin Sherrill
Katello QA List
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2015-10-05 23:36 EDT by tkubota
Modified: 2017-05-16 09:27 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-03-23 15:10:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 19356 None None None 2017-04-23 17:41 EDT

  None (edit)
Description tkubota 2015-10-05 23:36:04 EDT
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:

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 17:04:11 EST
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:


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 15:10:26 EDT
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 12:47:50 EDT
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 pm-sat@redhat.com 2017-04-23 17:41:17 EDT
Created redmine issue http://projects.theforeman.org/issues/19356 from this bug
Comment 22 Justin Sherrill 2017-05-16 09:27:55 EDT
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.

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