Upgrading RHV-H is failing with error "Exception! libsepol.context_from_record: type ovirt_vmconsole_host_port_t is not defined"

Solution Verified - Updated -

Issue

  • Upgrading RHV-H from 4.1 to 4.2 is failing with error below.
imgbased.log

2018-08-23 20:10:54,972 [DEBUG] (migrate_etc) Calling: (['semanage', 'permissive', '-a', 'setfiles_t'],) {'close_fds': True, 'stderr': -2}
2018-08-23 20:11:13,791 [DEBUG] (migrate_etc) Exception! libsepol.context_from_record: type ovirt_vmconsole_host_port_t is not defined (No such file or directory).
libsepol.context_from_record: could not create context structure (Invalid argument).
libsepol.port_from_record: could not create port structure for range 2223:2223 (tcp) (Invalid argument).
libsepol.sepol_port_modify: could not load port range 2223 - 2223 (tcp) (Invalid argument).
libsemanage.dbase_policydb_modify: could not modify record value (Invalid argument).
libsemanage.semanage_base_merge_components: could not merge local modifications into policy (Invalid argument).
OSError: Invalid argument

2018-08-23 20:11:14,050 [DEBUG] (MainThread) Traceback (most recent call last):
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/utils.py", line 1491, in run
    self._function(*self._args, **self._kwargs)
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/plugins/osupdater.py", line 523, in migrate_etc
    relabel_selinux(new_fs)
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/plugins/osupdater.py", line 603, in relabel_selinux
    with SELinuxDomain("setfiles_t") as dom:
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/utils.py", line 503, in __enter__
    self._semanage(["permissive", "-a", self._domain])
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/utils.py", line 445, in semanage
    return self.call(["semanage"] + args, **kwargs)
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/utils.py", line 378, in call
    stdout = call(*args, **kwargs)
  File "/tmp/tmp.Zcpaf50qE4/usr/lib/python2.7/site-packages/imgbased/utils.py", line 153, in call
    return subprocess.check_output(*args, **kwargs).strip()
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['semanage', 'permissive', '-a', 'setfiles_t']' returned non-zero exit status 1

Environment

  • Red Hat Virtualization 4.1.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.