Bug 1327000 - semanage failed with policydb version 30
Summary: semanage failed with policydb version 30
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-14 03:17 UTC by Wayne Sun
Modified: 2021-05-12 07:03 UTC (History)
12 users (show)

Fixed In Version: policycoreutils-2.5-2.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 02:14:27 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:2279 0 normal SHIPPED_LIVE policycoreutils bug fix and enhancement update 2016-11-03 13:35:48 UTC

Description Wayne Sun 2016-04-14 03:17:20 UTC
Description of problem:
semanage command failed with updated selinux-policy-targeted

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-68.el7.noarch
policycoreutils-python-2.5-2.el7.x86_64
policycoreutils-2.5-2.el7.x86_64
selinux-policy-targeted-3.13.1-68.el7.noarch
libselinux-2.5-2.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1.
# semanage fcontext --add -t virt_image_t -r s0 "/usr/share/avocado/data/avocado-vt/images(/.*)?"
ERROR: policydb version 30 does not match my version range 15-29
ERROR: Unable to open policy //etc/selinux/targeted/policy/policy.30.
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 32, in <module>
    import seobject
  File "/usr/lib/python2.7/site-packages/seobject/__init__.py", line 35, in <module>
    import sepolicy
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 907, in <module>
    raise e
ValueError: Failed to read //etc/selinux/targeted/policy/policy.30 policy file


2.
3.

Actual results:
failed

Expected results:
succeed

Additional info:
works fine when with policy.29

Comment 2 Petr Lautrbach 2016-04-14 12:04:39 UTC
Generally, it should work:


# rpm -qf /etc/selinux/targeted/policy/policy.30 
selinux-policy-targeted-3.13.1-68.el7.noarch

# semanage fcontext --add -t virt_image_t -r s0 "/usr/share/avocado/data/avocado-vt/images(/.*)?"

#


We either have a missing dependency or need to make another rebuild.

Please provide an output of:

$ rpm -q checkpolicy setools policycoreutils libsemanage libselinux libsepol

Comment 3 Wayne Sun 2016-04-15 02:17:31 UTC
# rpm -q checkpolicy setools policycoreutils libsemanage libselinux libsepol
checkpolicy-2.5-2.el7.x86_64
package setools is not installed
policycoreutils-2.5-2.el7.x86_64
libsemanage-2.5-2.1.el7.x86_64
libselinux-2.5-2.el7.x86_64
libsepol-2.5-2.1.el7.x86_64

Comment 14 errata-xmlrpc 2016-11-04 02:14:27 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://rhn.redhat.com/errata/RHEA-2016-2279.html

Comment 15 heard.wish 2017-09-05 08:10:08 UTC
hello,
I worked on yocto with meta-selinux, and have same issue.
Could you let me know which patch work on this issue?

Comment 16 Dalibor Pospíšil 2017-12-08 09:29:53 UTC
This is not about patch, it is about process of releasing correctly build and published matching versions of policy and userspace in the available repositories. This might occur during some transitional period when there's new policy package but not yet update userspace libraries and/or tools. Normally, this should not happen while using official supported repositories.

Comment 18 Pat Riehecky 2018-05-25 14:05:58 UTC
For folks googling:

You may need to rebuild libselinux as well as libsepol if the policy version fails to match.


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