Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1670494

Summary: sapconf has dnf repoquery issues.
Product: Red Hat Enterprise Linux 8 Reporter: Daniel Yeisley <dyeisley>
Component: sapconfAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Daniel Yeisley <dyeisley>
Severity: low Docs Contact:
Priority: high    
Version: 8.0CC: aarnold, aperotti, bfinger, fdanapfe
Target Milestone: rcKeywords: Rebase
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sapconf-0.99-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 20:40:22 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:
Bug Depends On: 1672323    
Bug Blocks:    

Description Daniel Yeisley 2019-01-29 16:47:05 UTC
Description of problem:
I pulled sapconf from brew to see how it works on RHEL 8. When I run it I dnf repoquery issues and an awk syntax error. Also, /etc/hosts is empty after execution. 

Version-Release number of selected component (if applicable):
sapconf-0.98-15.el8.noarch.rpm

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
[root@veritas7 ~]# sapconf
######        sapconf-0.98-15  by Red Hat       ######
###### Preparing System for SAP Installation  ######

Last metadata expiration check: 0:16:01 ago on Tue 29 Jan 2019 11:20:29 AM EST.
RHEL system not subscribed to RHEL for SAP channel ... WARNING
hostname settings are wrong ... not OK
/etc/sysconfig/network has been updated. The original file is backed up at /etc/sysconfig/network.sapconf-201901291136
/etc/hosts checking ... not OK
awk: cmd. line:1: (2620:52:0:102f:e2db:55ff:fe03:9d60
awk: cmd. line:1:      ^ syntax error
/etc/hosts has been updated. The original file is backed up at /etc/hosts.sapconf-201901291136
System is not recognized as a virtual guest. It's either on bare metal or on a Hypervisor that's not supported
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b] [-C]
                     [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH] [-a] [--show-duplicates]
                     [--arch [arch]] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatdepends REQ]
                     [--whatobsoletes REQ] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--recursive] [--deplist] [--querytags] [--resolve]
                     [--tree] [--srpm] [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --changelogs | --qf QUERYFORMAT | --nevra | --nvr | --envra | --groupmember]
                     [--duplicates | --installonly | --unsatisfied]
                     [--location]
                     [--conflicts | --depends | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded | --userinstalled]
                     [--recent]
                     [key [key ...]]
dnf repoquery: error: unrecognized arguments: --plugin -g --grouppkgs=mandatory
Installing Group @compat-libraries ... 
Warning: Module or Group 'compat-libraries' does not exist.
Error: Nothing to do.
Group @compat-libraries ... Installed
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b] [-C]
                     [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH] [-a] [--show-duplicates]
                     [--arch [arch]] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatdepends REQ]
                     [--whatobsoletes REQ] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--recursive] [--deplist] [--querytags] [--resolve]
                     [--tree] [--srpm] [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --changelogs | --qf QUERYFORMAT | --nevra | --nvr | --envra | --groupmember]
                     [--duplicates | --installonly | --unsatisfied]
                     [--location]
                     [--conflicts | --depends | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded | --userinstalled]
                     [--recent]
                     [key [key ...]]
dnf repoquery: error: unrecognized arguments: --plugin -g --grouppkgs=mandatory
Installing Group @large-systems ... 
Group @large-systems ... Installed
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b] [-C]
                     [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH] [-a] [--show-duplicates]
                     [--arch [arch]] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatdepends REQ]
                     [--whatobsoletes REQ] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--recursive] [--deplist] [--querytags] [--resolve]
                     [--tree] [--srpm] [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --changelogs | --qf QUERYFORMAT | --nevra | --nvr | --envra | --groupmember]
                     [--duplicates | --installonly | --unsatisfied]
                     [--location]
                     [--conflicts | --depends | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded | --userinstalled]
                     [--recent]
                     [key [key ...]]
dnf repoquery: error: unrecognized arguments: --plugin -g --grouppkgs=mandatory
Installing Group @network-file-system-client ... 
Group @network-file-system-client ... Installed
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b] [-C]
                     [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH] [-a] [--show-duplicates]
                     [--arch [arch]] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatdepends REQ]
                     [--whatobsoletes REQ] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--recursive] [--deplist] [--querytags] [--resolve]
                     [--tree] [--srpm] [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --changelogs | --qf QUERYFORMAT | --nevra | --nvr | --envra | --groupmember]
                     [--duplicates | --installonly | --unsatisfied]
                     [--location]
                     [--conflicts | --depends | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded | --userinstalled]
                     [--recent]
                     [key [key ...]]
dnf repoquery: error: unrecognized arguments: --plugin -g --grouppkgs=mandatory
Installing Group @performance ... 
Group @performance ... Installed
Package uuidd ... Already Installed
Package tuned-profiles-sap ... Already Installed
Service uuidd autostart ... OK
Service uuidd already running
SAP LDAP Links ... Installed:
   /usr/lib64/libldap.so.199 -> libldap-2.3.so.0
   /usr/lib64/liblber.so.199 -> liblber-2.3.so.0
SAP old version compat links ... Installed
   /usr/lib/libstdc++-libc6.1-1.so.3 -> libstdc++-libc6.2-2.so.3
NTP service is running ... OK
Checking Kernel Parameters ... In Progress
TMPFS_SIZE : set: 32, required: 71 ... NEEDS TO BE CHANGED
SHMALL : 18446744073692774399  ... OK
SHMMAX : 18446744073692774399  ... OK
SEMMSL : 32000  ... OK
SEMMNS : 1024000000  ... OK
SEMOPM : 500  ... OK
SEMMNI : 32000  ... OK
MAX_MAP_COUNT : set: 65530, required: 2000000 ... NEEDS TO BE CHANGED
Updating Kernel Parameters
TMPFS SIZE 32 smaller than required size 71 ... SETTING REQUIRED VALUE
TMPFS SIZE Set to 71 ... DONE
Activating tuned 'sap-netweaver' profile
Required glibc.x86_64 version is already installed

###### System Updated. See RECOMMENDATIONS    ######

######         RECOMMENDATIONS                ######
##  Below are recommended settings that can not   ##
##  Be carried out by the sapconf script          ##
##  Please check and set them manually            ##
## ---------------------------------------------- ##

1: RHEL system not subscribed to RHEL for SAP channel

2: Red Hat recommends to get RHEL for SAP Business Applications subscriptions for all RHEL servers running SAP applications. See SAP Note 1631106

3: SELinux is configured to be booted in enforcing mode. It's recommended to set to permissive. Please check SAP Note 2002167 for details.
######       END OF RECOMMENDATIONS           ######


Expected results:


Additional info:

Comment 1 Daniel Yeisley 2019-01-29 20:35:08 UTC
Apparently sapconf won't be included in RHEL 8. See https://projects.engineering.redhat.com/browse/RCM-38885

Comment 2 Than Ngo 2019-01-30 16:11:54 UTC
Thanks for your report, i'm looking at this.

Comment 5 Daniel Yeisley 2019-03-08 17:19:40 UTC
(In reply to Ngo Than from comment #2)
> Thanks for your report, i'm looking at this.

I noticed this error.

/etc/hosts checking ... not OK
awk: cmd. line:1: (2620:52:0:102f:e2db:55ff:fe03:9d60
awk: cmd. line:1:      ^ syntax error
/etc/hosts has been updated. The original file is backed up at /etc/hosts.sapconf-201901291136

It looks like it's due to the code at line 559.

### This fails, if ip of $hs is unreachable or $hs unknown in nameservice
ip=$(ping -q -c 1 -t 1 $hs | grep PING | sed -e "s/^[^(]*[(]//" | sed -e "s/[)].*$//")

[root@veritas6 ~]# ping -q -c 1 -t 1 $hs | grep PING | sed -e "s/^[^(]*[(]//" | sed -e "s/[)].*$//"
veritas6.lab.eng.bos.redhat.com (2620:52:0:102f:92b1:1cff:fe2a:cf1c

Comment 6 Bernd Finger 2019-03-22 18:07:07 UTC
About the repoquery error, maybe this helps analyzing the issue:

repoquery ocurres only in line 747 of the script sapconf:

"/usr/bin/sapconf" line 747 of 1017 --73%-- col 28

    747                 for r in $(repoquery --plugin -g --grouppkgs=mandatory -l $(echo $gp| cut -c2-)); do
    748                         rpm -q $r > /dev/null 2>&1
    749                         rc=$?
    750                         gi=$(( $rc + $gi ))
    751                 done


Now isolating the case:

[root@lu0530v1 ~]# RPMS="@compat-libraries @large-systems @network-file-system-client @performance uuidd tuned-profiles-sap"

[root@lu0530v1 ~]# for gp in $RPMS; do echo $gp; done | awk '/@/{print}' | cut -c2-
compat-libraries
large-systems
network-file-system-client
performance

-> string "compat-libraries" can be used for testing the repoquery command.


On RHEL 7.6, the repoquery command works:
[root@lu0530v0 ~]# cat /etc/system-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[root@lu0530v0 ~]# uname -a
Linux lu0530v0.wdf.sap.corp 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4 20:48:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

[root@lu0530v0 ~]# repoquery --plugin -g --grouppkgs=mandatory -l compat-libraries
compat-glibc
libpng12
compat-openldap
compat-libf2c-34
openssl098e
compat-db47
compat-libcap1
compat-libgfortran-41
compat-libtiff3


On RHEL 8, the same repoquery command fails:
[root@lu0530v1 ~]# cat /etc/system-release
Red Hat Enterprise Linux release 8.0 Beta (Ootpa)
[root@lu0530v1 ~]# uname -a
Linux lu0530v1 4.18.0-74.el8.x86_64 #1 SMP Wed Feb 27 17:53:43 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@lu0530v1 ~]# repoquery --plugin -g --grouppkgs=mandatory -l compat-libraries
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
usage: dnf repoquery [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b | --nobest]
                     [-C] [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bzs BUGZILLA] [--cves CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH] [-a] [--show-duplicates]
                     [--arch [arch]] [-f FILE [FILE ...]]
                     [--whatconflicts REQ] [--whatdepends REQ]
                     [--whatobsoletes REQ] [--whatprovides REQ]
                     [--whatrequires REQ] [--whatrecommends REQ]
                     [--whatenhances REQ] [--whatsuggests REQ]
                     [--whatsupplements REQ] [--alldeps | --exactdeps]
                     [--recursive] [--deplist] [--querytags] [--resolve]
                     [--tree] [--srpm] [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --changelogs | --qf QUERYFORMAT | --nevra | --nvr | --envra | --groupmember]
                     [--duplicates | --installonly | --unsatisfied]
                     [--location]
                     [--conflicts | --depends | --enhances | --provides | --recommends | --requires | --requires-pre | --suggests | --supplements]
                     [--available]
                     [--installed | --extras | --upgrades | --unneeded | --userinstalled]
                     [--recent]
                     [key [key ...]]
dnf repoquery: error: unrecognized arguments: --plugin -g --grouppkgs=mandatory

Note: man repoquery on RHEL 8 no longer contains the "--grouppkgs" option. But leaving just this option out still produces the error.

Comment 7 Bernd Finger 2019-03-22 22:01:31 UTC
I did some more investigation and found that when replacing:
--->
repoquery --plugin -g --grouppkgs=mandatory -l $(echo $gp| cut -c2-)
<---
by:
--->
LANG=C yum groupinfo $gp 2>&1 | \
   awk '/ Mandatory Packages:/{a=1;n=0}/Packages:/&&!/Mandatory/{a=0}{sub ("+", ""); n++;if ((a==1)&&(n>1)){print $1}}'
<---
, the resulting output is identical except for the sort order. The disadvantage though is that this is dependent on the output formatting which might change in future versions of yum. So I hope there is a more elegant solution, using yum query modifiers for example.

Comment 8 Bernd Finger 2019-03-24 10:26:59 UTC
I tested the sapconf script with the modifications as per my previous entry (dated 2019-03-22 22:01:31 UTC), and it ran without errors on a RHEL 8 RC1 host. However, I discovered that the 2 LDAP links and the libstdc++ links point to nonexisting files. But this is of course out of scope here.

Comment 9 Than Ngo 2019-03-25 12:22:24 UTC
Bernd, thanks your investigation and the replacing. I think we can use this replacing as workaround temporary before the issue is fixed in dnf.

Comment 14 Bernd Finger 2019-04-18 14:08:20 UTC
Due to package and package requirement changes from RHEL 7 to 8, the best and easiest option to solve this issue would probably be to remove the call to function check_rpms() (line 999) and to remove function check_rpms() completely from sapconf until the issue is finally fixed.

Comment 15 Bernd Finger 2019-04-18 15:33:38 UTC
Should be line 998 (I added set -x for testing purposes) ;-)

Comment 22 Arne Arnold 2019-05-24 09:58:25 UTC
Hi colleagues,

I just noticed recent comments on this bug and just wanted to get everyone on the same page regarding status and way forward.
- as mentioned in comment #17, we decided to exclude sapconf package from 8.0 compose to proceed with RCM delivery
- in parallel, Bernd Finger and Markus Koch had already started to leverage Ansible / RHEL System Roles to automate RHEL8 system preparation
- as aligned with Christoph Brune (Manager of SAP tech alliance team) we'll use these RHEL System Roles as a replacement of former sapconf.rpm (providing similar functionality & API, but leveraging different technology).
- the RHEL system role for SAP is planned to be available / shipped with RHEL 8.1

While development had been almost finished, it seams we haven't assigned QE resources yet. If you, Than or Daniel could sign-up for this task, would be great. Please get in contact with Bernd Finger to receive further details.

Arne

Comment 23 Daniel Yeisley 2019-06-11 17:24:05 UTC
sapconf-0.99-3.el8.noarch included in RHEL-8.1.0-20190604.7 does not have the repo query issue. Moving to verified.

Comment 25 errata-xmlrpc 2019-11-05 20:40:22 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, 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/RHBA-2019:3313