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 2169684 - unpackaged gives false positive about /usr/lib/jvm/java-*-openjdk-*.x86_64/bin/jfr
Summary: unpackaged gives false positive about /usr/lib/jvm/java-*-openjdk-*.x86_64/bi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: sos
Version: 9.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jose Castillo
QA Contact: Adriana Jurkechova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-14 10:22 UTC by Pavel Moravec
Modified: 2023-05-31 18:49 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-31 18:49:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sosreport sos pull 3157 0 None open [unpackaged] Print unpackaged symlinks instead of targets 2023-03-06 13:05:22 UTC
Red Hat Issue Tracker RHELPLAN-148569 0 None None None 2023-02-14 10:25:08 UTC

Description Pavel Moravec 2023-02-14 10:22:00 UTC
Description of problem:
unpackaged plugin wrongly claims files like

/usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/jfr

are unpackaged (present under $PATH (following symbolic links), but not woned by a package). While the file is owned by java-11-openjdk-devel .

Curiously, similar javac file is not reported that way.


Version-Release number of selected component (if applicable):
sos-4.3 or any newer (older version not checked)


How reproducible:
100%


Steps to Reproduce:
1. install java-11-openjdk-devel-11.0.18.0.10-2.el9_1.x86_64 (or any other version)
2. sos report -o unpackaged --batch --build
3. check sos_commands/unpackaged/unpackaged


Actual results:
3. shows /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/jfr despite it is "packaged" file (owned and deployed from the devel RPM).


Expected results:
3. shows nothing.


Additional info:

Comment 1 Pavel Moravec 2023-03-06 09:24:18 UTC
This is not a sos bug(*), this is java bug :)

B'cos what sos does: it traverses $PATH and reports any file not owned by a package as "unpackaged".

Why it reported the /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/jfr file when it is "packaged" / owned by java-11-openjdk ? Esp. if that is not inside any $PATH ?

B'cos it found that /usr/bin/jfr (under a $PATH) is symbolic link to /etc/alternatives/jfr, which is symbolic link to /usr/lib/jvm/java-11-openjdk-11.0.18.0.10-2.el9_1.x86_64/bin/jfr . And /usr/bin/jfr is not owned by any package.

Why the plugin reported just jfr binary but not e.g. javac that has the same chain of symbolic links? B'cos /usr/bin/javac is owned by that package.

So java-11-openjdk should chown /usr/bin/jfr to fix this bug.

Checking spec file of java-11-openjdk, I do see there:

%ghost %{_bindir}/javac
%ghost %{_bindir}/jdb

but not:

%ghost %{_bindir}/jfr

which seems to me as the reason.



(*) but there is a room for improvement of sos. It reports "file XY is not packaged", while it *is* packaged. Just a symlink to it from $PATH is not packaged. We should report rather the symlink than its destination. So I will leave this BZ on sos to implement this improvement, and raise a new BZ against java for the missing "%ghost %{_bindir}/jfr"

Comment 2 Pavel Moravec 2023-03-06 14:34:20 UTC
(In reply to Pavel Moravec from comment #1)
> and raise a new BZ against java for the missing "%ghost %{_bindir}/jfr"

https://bugzilla.redhat.com/show_bug.cgi?id=2175760 raised for it.

Comment 3 Adriana Jurkechova 2023-05-17 12:57:58 UTC
Expected results changed based on Pavel's Comment 1. Switched to Tested.

old:
===

Installed:
  java-11-openjdk-devel-1:11.0.19.0.7-1.el9_1.x86_64                                                                  

Complete!
[root@ci-vm-10-0-136-155 ~]# sos report -o unpackaged --batch --build

sosreport (version 4.5.1)

...

[root@ci-vm-10-0-136-155 unpackaged]# cat unpackaged 
/usr/bin/1minutetip-report
/usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el9_1.x86_64/bin/jfr


new:
===

[root@ci-vm-10-0-139-47 ~]# sos report -o unpackaged --batch --build

sosreport (version 4.5.3)

...

[root@ci-vm-10-0-139-47 unpackaged]# cat unpackaged 
/usr/bin/1minutetip-report
/usr/bin/jfr -> /etc/alternatives/jfr -> /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el9_1.x86_64/bin/jfr

Comment 10 errata-xmlrpc 2023-05-31 18:49:38 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 (sos bug fix and enhancement update), 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-2023:3414


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