Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not prefetch selinux_fcontext provider 'semanage': uninitialized constant Selinux #367

Open
sohooo opened this issue Jun 19, 2023 · 3 comments

Comments

@sohooo
Copy link

sohooo commented Jun 19, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.25.0
  • Ruby: 2.7
  • Distribution: RHEL9
  • Module version: -

How to reproduce (e.g Puppet code you use)

This seems to be a problem with Puppet Agent, not this module. Related:

What are you seeing

Error: Could not prefetch selinux_fcontext provider 'semanage': uninitialized constant Selinux

rhel8 7.25 working ✔️

% /opt/puppetlabs/puppet/bin/irb
irb(main):001:0> require "puppet"
=> true
irb(main):002:0> require "selinux"
=> true
irb(main):003:0> Puppet.version
=> "7.25.0"
irb(main):004:0> Puppet.features.selinux?
=> true
irb(main):005:0>  File.read "/etc/redhat-release"
=> "Red Hat Enterprise Linux release 8.7 (Ootpa)\n"
irb(main):006:0>

rhel9 7.24 working ✔️

% /opt/puppetlabs/puppet/bin/irb
irb(main):001:0> require "puppet"
=> true
irb(main):002:0> require "selinux"
=> true
irb(main):003:0> Puppet.version
=> "7.24.0"
irb(main):004:0> Puppet.features.selinux?
=> true
irb(main):005:0> File.read "/etc/redhat-release"
=> "Red Hat Enterprise Linux release 9.1 (Plow)\n"

rhel9 7.25 fail ❌

% /opt/puppetlabs/puppet/bin/irb
irb(main):001:0> require "puppet"
=> true
irb(main):002:0> require "selinux"
Traceback (most recent call last):
        6: from /opt/puppetlabs/puppet/bin/irb:23:in `<main>'
        5: from /opt/puppetlabs/puppet/bin/irb:23:in `load'
        4: from /opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
        3: from (irb):2
        2: from /opt/puppetlabs/puppet/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
        1: from /opt/puppetlabs/puppet/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
LoadError (/lib64/libselinux.so.1: version `LIBSELINUX_3.5' not found (required by /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/selinux.so)
- /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/selinux.so)
irb(main):003:0> Puppet.version
=> "7.25.0"
irb(main):004:0> Puppet.features.selinux?
=> false
irb(main):005:0> File.read "/etc/redhat-release"
=> "Red Hat Enterprise Linux release 9.1 (Plow)\n"
@sohooo
Copy link
Author

sohooo commented Jun 19, 2023

Registered to also post issue @ ticket.puppetlabs.com: https://tickets.puppetlabs.com/browse/PA-5632 :)

@cmd-ntrf
Copy link

I experienced the same issue with Rocky Linux release 9.1. The fix was to upgrade libselinux i.e: sudo yum upgrade libselinux.

Puppet expects version libselinux 3.5 and RHEL9 originally shipped with libselinux 3.4 hence the error message LIBSELINUX_3.5' not found.

@ekohl
Copy link
Member

ekohl commented Sep 27, 2023

Sounds like missing/incorrect requirement in the Puppet RPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants