Bug 2150908

Summary: ValueError: SELinux policy is not managed or store cannot be accessed.
Product: Red Hat Enterprise Linux 8 Reporter: Jan Stodola <jstodola>
Component: insights-clientAssignee: Link Dupont <link>
Status: CLOSED ERRATA QA Contact: Nobody <nobody>
Severity: high Docs Contact:
Priority: unspecified    
Version: ---CC: ahitacat, cmarinea, fdiprete, fjansen, link, mmalik, nobody, pakotvan, stomsa
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: SCRUB_20230105
Fixed In Version: insights-client-3.1.7-12.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2164602 2196844 (view as bug list) Environment:
Last Closed: 2023-05-16 08:30:42 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: 2164602, 2196844    
Attachments:
Description Flags
yum install --installroot=/root/installroot/ insights-client
none
kickstart none

Description Jan Stodola 2022-12-05 15:49:20 UTC
Description of problem:
There is an error when installing insights-client as part of a system installation process:

...
23:37:38,752 INFO anaconda:packaging: Installed: python3-policycoreutils-2.9-20.el8.noarch 1657901842 71676aca45858e9e25878e4153d08e31beef91a916b85547105c8f911e4c29ca
23:37:39,404 INFO anaconda:packaging: Installed: policycoreutils-python-utils-2.9-20.el8.noarch 1657901842 685dd552b73037e654323714b550d5c532dcbe80ac1c704b19d46b971a5dd921
23:37:39,471 INFO anaconda:packaging: Installed: insights-client-3.1.7-11.el8.noarch 1668185030 bc7487b118579b150c445d9d531abf569b2f16a68e302c96c2cc423d20d897db
23:37:39,665 INFO anaconda:packaging: Configuring (running scriptlet for): insights-client-3.1.7-11.el8.noarch 1668185030 bc7487b118579b150c445d9d531abf569b2f16a68e302c96c2cc423d20d897db
23:37:40,376 INFO anaconda:dnf: ValueError: SELinux policy is not managed or store cannot be accessed.#012warning: %post(insights-client-0:3.1.7-11.el8.noarch) scriptlet failed, exit status 1
23:37:40,379 ERR anaconda:dnf: Error in POSTIN scriptlet in rpm package insights-client


Unfortunately there is no reliable reproducer, most probably due to the order of the packages being installed in the transaction.
However the same problem can be reproduced when installing insights-client into a clean install root:


# mkdir /root/installroot
# yum install --installroot=/root/installroot/ insights-client
...
  Installing       : pciutils-3.7.0-3.el8.x86_64                                                            190/191 
  Installing       : insights-client-3.1.7-11.el8.noarch                                                    191/191 
  Running scriptlet: insights-client-3.1.7-11.el8.noarch                                                    191/191 
ValueError: SELinux policy is not managed or store cannot be accessed.
warning: %post(insights-client-0:3.1.7-11.el8.noarch) scriptlet failed, exit status 1

Error in POSTIN scriptlet in rpm package insights-client
  Running scriptlet: filesystem-3.8-6.el8.x86_64                                                            191/191 
  Running scriptlet: glibc-all-langpacks-2.28-223.el8.x86_64                                                191/191

Version-Release number of selected component (if applicable):
insights-client-3.1.7-11.el8

How reproducible:
Always when installing to a clean install root

Steps to Reproduce:
1. # mkdir /root/installroot
2. # yum install --installroot=/root/installroot/ insights-client

Actual results:
Error in POSTIN scriptlet

Expected results:
No errors

Additional info:
Perhaps related to the change in bug 2141444.

Comment 2 Jan Stodola 2022-12-05 15:54:33 UTC
Created attachment 1930134 [details]
yum install --installroot=/root/installroot/ insights-client

Installing insights-client to a clean installroot.

Comment 3 Jan Stodola 2022-12-06 11:09:28 UTC
Created attachment 1930450 [details]
kickstart

The bug can be reproduced on the latest RHEL-8.8 development compose when running a kickstart installation and excluding packages with weak dependencies:

%packages --excludeWeakdeps
%end

The whole kickstart is attached. In this case the installation stops and it's not possible to continue.

Proposing as a blocker.

Comment 13 Link Dupont 2023-03-06 17:58:17 UTC
*** Bug 2168259 has been marked as a duplicate of this bug. ***

Comment 15 errata-xmlrpc 2023-05-16 08:30:42 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 (insights-client 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:2803