Bug 1398882

Summary: audit2allow crashes on run
Product: [Fedora] Fedora Reporter: bystones92
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 24CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, ssekidde, vmojzis
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-02 15:31:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description bystones92 2016-11-27 00:32:39 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build Identifier: 

Trying to run audit2allow results in an error:

[root@nas ~]# audit2allow
Traceback (most recent call last):
  File "/usr/bin/audit2allow", line 25, in <module>
    import sepolgen.audit as audit
  File "/usr/lib64/python3.5/site-packages/sepolgen/audit.py", line 23, in <module>
    from . import refpolicy
  File "/usr/lib64/python3.5/site-packages/sepolgen/refpolicy.py", line 21, in <module>
    import selinux
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 1441, in <module>
    selinux_snapperd_contexts_path = _selinux.selinux_snapperd_contexts_path
AttributeError: module '_selinux' has no attribute 'selinux_snapperd_contexts_path'


Reproducible: Always

Steps to Reproduce:
1. Run audit2allow

Actual Results:  
Traceback (most recent call last):
  File "/usr/bin/audit2allow", line 25, in <module>
    import sepolgen.audit as audit
  File "/usr/lib64/python3.5/site-packages/sepolgen/audit.py", line 23, in <module>
    from . import refpolicy
  File "/usr/lib64/python3.5/site-packages/sepolgen/refpolicy.py", line 21, in <module>
    import selinux
  File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 1441, in <module>
    selinux_snapperd_contexts_path = _selinux.selinux_snapperd_contexts_path
AttributeError: module '_selinux' has no attribute 'selinux_snapperd_contexts_path'



Running Fedora Server 24 all packages up to date.

Comment 1 Vit Mojzis 2016-12-02 15:31:25 UTC
So far it seems that the issue is caused by having multiple versions of libselinux-python in your system, or by incomplete dnf transaction.
eg. both: 
    libselinux-python-2.5-9.fc24.x86_64
    libselinux-python-2.5-3.fc24.x86_64

Removing older versions or reinstallining libselinux package (in case only 1 version is present) should fix the issue.

*** This bug has been marked as a duplicate of bug 1358487 ***