Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1621004

Summary: sepolicy.gen_port_dict() RuntimeError: Protocol not supported
Product: Red Hat Enterprise Linux 7 Reporter: Nikhil Dehadrai <ndehadra>
Component: policycoreutilsAssignee: Vit Mojzis <vmojzis>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: dwalsh, lmiksik, lvrabec, mgrepl, mhonek, mmalik, mthacker, ndehadra, nkinder, plautrba, rmeggins, spichugi, ssekidde, tbordaz, vashirov, vmojzis
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://faf.lab.eng.brq.redhat.com/faf/reports/bthash/3b43896893975a3f7896f5007b0c0ee4f0c8dd40/
Whiteboard:
Fixed In Version: policycoreutils-2.5-28.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:46:43 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:

Description Nikhil Dehadrai 2018-08-23 12:52:30 UTC
Crash noticed for IPA server upgrade from RHEL 7.5z > RHEL 7.6 


This bug has been created based on an anonymous crash report requested by the package maintainer.


time:           Thu 23 Aug 2018 02:46:48 PM IST
package:        389-ds-base-1.3.7.5-26.el7_5
reason:         __init__.py:54:info:RuntimeError: Protocol not supported
cmdline:        /usr/bin/python2 /usr/sbin/ds_selinux_port_query 389 ldap_port_t
executable:     /usr/sbin/ds_selinux_port_query
component:      389-ds-base
uid:            0
username:       root
hostname:       vm-idm-019.ndbz23aug1.test
os_release:     Red Hat Enterprise Linux Server release 7.5 (Maipo)
architecture:   x86_64
kernel:         3.10.0-862.11.6.el7.x86_64
abrt_version:   2.1.11

Reports:
uReport: BTHASH=3b43896893975a3f7896f5007b0c0ee4f0c8dd40
ABRT Server: 


Full Backtrace:
__init__.py:54:info:RuntimeError: Protocol not supported

Traceback (most recent call last):
  File "/usr/sbin/ds_selinux_port_query", line 38, in <module>
    portrecs, portrecsbynum = sepolicy.gen_port_dict()
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 649, in gen_port_dict
    for i in info(PORT):
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 54, in info
    dict_list = _policy.info(setype, name)
RuntimeError: Protocol not supported

Local variables in innermost frame:
setype: 4
name: None

Comment 2 Viktor Ashirov 2018-08-23 13:02:39 UTC
This looks like a problem with libselinux-python.

Please provide the output of
$ rpm -qa | grep selinux

Thanks.

Comment 3 Nikhil Dehadrai 2018-08-23 13:06:42 UTC
rpm -qa | grep selinux(In reply to Viktor Ashirov from comment #2)
> This looks like a problem with libselinux-python.
> 
> Please provide the output of
> $ rpm -qa | grep selinux
> 
> Thanks.

[root@vm-idm-019 ~]# rpm -qa | grep selinux
selinux-policy-3.13.1-219.el7.noarch
libselinux-python-2.5-14.1.el7.x86_64
libselinux-2.5-14.1.el7.x86_64
libselinux-utils-2.5-14.1.el7.x86_64
selinux-policy-targeted-3.13.1-219.el7.noarch
[root@vm-idm-019 ~]#

Comment 5 Viktor Ashirov 2018-08-23 13:41:25 UTC
I can reproduce the problem after upgrade of selinux-policy to selinux-policy-3.13.1-208.el7.noarch and selinux-policy-targeted-3.13.1-208.el7.noarch


Reproducer:
python -c 'import sepolicy; print(sepolicy.gen_port_dict())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "sepolicy/__init__.py", line 649, in gen_port_dict
    for i in info(PORT):
  File "sepolicy/__init__.py", line 54, in info
    dict_list = _policy.info(setype, name)
RuntimeError: Protocol not supported

With -207 it prints the dict.

Moving bugzilla to selinux-policy.

Comment 8 Vit Mojzis 2018-08-23 14:50:43 UTC
Hi,
the root cause seems to be old version of setools (provider of _policy.info()), which does not support SCTP portcon definitions. 

Which version of setools are you using and could you please try to update it (the issue is fixed in setools-3.3.8-4)?

Comment 9 Viktor Ashirov 2018-08-23 15:37:24 UTC
I can confirm that upgrading setools-libs from 3.3.8-2.el7 to 3.3.8-4.el7 solves the problem.

Question: shouldn't selinux-policy explicitly depend on a particular version of setools since it provides the necessary functionality?

Comment 17 errata-xmlrpc 2018-10-30 09:46:43 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://access.redhat.com/errata/RHBA-2018:3098