Bug 1128074 - [oVirt-node] TypeError: in method 'matchpathcon', argument 1 of type 'char const *'
Summary: [oVirt-node] TypeError: in method 'matchpathcon', argument 1 of type 'char co...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: vdsm
Version: 3.5
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.5.0
Assignee: Dan Kenigsberg
QA Contact: Gil Klein
URL:
Whiteboard: network
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-08 08:57 UTC by Martin Pavlik
Modified: 2016-02-10 19:36 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:26:25 UTC
oVirt Team: Network


Attachments (Terms of Use)
node logs (112.97 KB, application/x-compressed-tar)
2014-08-08 08:57 UTC, Martin Pavlik
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 31388 master MERGED selinux.restorecon: encode filename to utf-8 string Never
oVirt gerrit 31438 ovirt-3.5 MERGED selinux.restorecon: encode filename to utf-8 string Never

Description Martin Pavlik 2014-08-08 08:57:44 UTC
Created attachment 925127 [details]
node logs

Description of problem:
after approval of node in engine following traceback appears in logs

MainThread::DEBUG::2014-08-08 08:21:11,212::ifcfg::549::root::(writeConfFile) ignoring restorecon error in case SElinux is disabled
Traceback (most recent call last):
  File "/usr/share/vdsm/network/configurators/ifcfg.py", line 546, in writeConfFile
    selinux.restorecon(fileName)
  File "/usr/lib64/python2.6/site-packages/selinux/__init__.py", line 76, in restorecon
TypeError: in method 'matchpathcon', argument 1 of type 'char const *'



Version-Release number of selected component (if applicable):
oVirt Node Hypervisor release 3.1.0_master (20140805.0) (Edited, Unsigned)[root@localhost admin]# 

oVirt Engine Version: 3.5.0-0.0.master.20140804172041.git23b558e.el6 

How reproducible:
100%

Steps to Reproduce:
1. install ovirt node (PXE used) 
2. register node form TUI to GUI
3. approve node in GUI

Actual results:
TypeError: in method 'matchpathcon', argument 1 of type 'char const *'

Expected results:
no erorro

Additional info:

Comment 1 Dan Kenigsberg 2014-08-09 23:33:22 UTC
Which version of libselinux libselinux-python do you have?

Does running

 python -c 'import selinux;selinux.restorecon("/etc/sysconfig/network-scripts/ifcfg-eth0")'

as root produce similar noises?

Comment 2 Martin Pavlik 2014-08-11 07:35:00 UTC
[root@localhost ~]# cat /etc/redhat-release 
oVirt Node Hypervisor release 3.1.0_master (20140805.0) (Edited, Unsigned

[root@localhost ~]# python -c 'import selinux;selinux.restorecon("/etc/sysconfig/network-scripts/ifcfg-eth0")'

does not return anything




[root@localhost ~]# rpm -qa | grep selinux
libselinux-2.0.94-5.3.el6_4.1.x86_64
selinux-policy-targeted-3.7.19-231.el6_5.3.noarch
ovirt-node-selinux-3.1.0-0.0.master.20140805.git67e6b92.el6.noarch
selinux-policy-3.7.19-231.el6_5.3.noarch
libselinux-utils-2.0.94-5.3.el6_4.1.x86_64
libselinux-python-2.0.94-5.3.el6_4.1.x86_64

Comment 3 Dan Kenigsberg 2014-08-11 09:00:48 UTC
A quick search reveals bug 908916 (restorecon() does not handle unicode strings), but I don't understand how unicode() got into the filename, or why this has not been visible out of the node. Any guess, Toni?

Martin, does this have a noticeable functional effect? What is your

 ls -Z /etc/sysconfig/network-scripts/ifcfg-eth0

Comment 4 Martin Pavlik 2014-08-11 09:56:21 UTC
no, no functional effect that I am aware of, I just noticed it when investigating other bug

[root@localhost admin]#  ls -Z /etc/sysconfig/network-scripts/ifcfg-eth0
-rw-rw-r--. root root system_u:object_r:net_conf_t:s0  /etc/sysconfig/network-scripts/ifcfg-eth0

Comment 5 Sandro Bonazzola 2014-10-17 12:26:25 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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