Bug 1902720

Summary: HOME=/root osinfo-query os fails with Error loading OS data: Unexpected file type
Product: Red Hat Enterprise Linux 8 Reporter: Richard W.M. Jones <rjones>
Component: libosinfoAssignee: Victor Toso <victortoso>
Status: CLOSED ERRATA QA Contact: Radek Duda <rduda>
Severity: unspecified Docs Contact:
Priority: medium    
Version: ---CC: cfergeau, chhu, juzhou, mxie, rduda, tzheng, xiaodwan
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libosinfo-1.9.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1942431 1989971 (view as bug list) Environment:
Last Closed: 2022-05-10 14:17:40 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:    
Bug Blocks: 1942431, 1989971    

Description Richard W.M. Jones 2020-11-30 13:53:07 UTC
Description of problem:

Quite simply if you run libosinfo / osinfo utility with a bogus
or unreadable $HOME environment variable then it fails like this:

$ HOME=/root osinfo-query os
Error loading OS data: Unexpected file type

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

This happens upstream, eg:
libosinfo-1.8.0-3.fc33.x86_64

and also in RHEL 8 with eg:
libosinfo-1.8.0-1.el8.x86_64

How reproducible:

100%

Steps to Reproduce:

See above.

Comment 1 Richard W.M. Jones 2021-03-22 11:11:37 UTC
For a bit of background see comments on this bug
https://bugzilla.redhat.com/show_bug.cgi?id=1901423
especially
https://bugzilla.redhat.com/show_bug.cgi?id=1901423#c18

Comment 4 John Ferlan 2021-10-18 15:24:17 UTC
Reassign Fabiano's bugs to Victor for libosinfo & osinfo-db

Comment 6 Radek Duda 2022-01-10 17:58:17 UTC
I reproduced the bug with ibosinfo-1.9.0-1.el8:
 HOME=/root osinfo-query os
Error loading OS data: Unexpected file type

Installed  ibosinfo-1.9.0-2.el8:
HOME=/root osinfo-query os
Error loading OS data: Can't read path /root/.config/osinfo

Just to be sure I've launched:
#osinfo-query os
which gives then a list of OSes.

As per https://bugzilla.redhat.com/show_bug.cgi?id=1942431#c7 I believe this solves the bug.

Comment 12 errata-xmlrpc 2022-05-10 14:17:40 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 (libosinfo 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-2022:1914