Satellite installer fails with 'Errno::EACCES: Permission denied @ dir_initialize - /usr/share/foreman/lib/satellite' error

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.16

Issue

  • Satellite installer fails with the following error:

      # satellite-installer
      2025-12-24 22:24:05 [NOTICE] [root] Loading installer configuration. This will take some time.
      2025-12-24 22:24:10 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
      2025-12-24 22:24:10 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
      2025-12-24 22:24:11 [NOTICE] [checks] System checks passed
      Package versions are locked. Continuing with unlock.
      2025-12-24 22:25:19 [NOTICE] [configure] Starting system configuration.
      2025-12-24 22:25:29 [NOTICE] [configure] 250 configuration steps out of 1997 steps complete.
      2025-12-24 22:25:31 [NOTICE] [configure] 500 configuration steps out of 1997 steps complete.
      2025-12-24 22:25:35 [NOTICE] [configure] 750 configuration steps out of 2001 steps complete.
      2025-12-24 22:25:36 [NOTICE] [configure] 1000 configuration steps out of 2006 steps complete.
      2025-12-24 22:25:36 [NOTICE] [configure] 1250 configuration steps out of 2008 steps complete.
      2025-12-24 22:25:36 [NOTICE] [configure] 1500 configuration steps out of 2008 steps complete.
      2025-12-24 22:25:37 [NOTICE] [configure] 1750 configuration steps out of 2008 steps complete.
      2025-12-24 22:26:17 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
      2025-12-24 22:26:17 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
      2025-12-24 22:26:32 [NOTICE] [configure] 2000 configuration steps out of 2008 steps complete.
      2025-12-24 22:26:35 [NOTICE] [configure] System configuration has finished.
    
      Error 1: Puppet Exec resource 'foreman-rake-db:migrate' failed. Logs:
        /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]
          Adding autorequire relationship with User[foreman]
          Starting to evaluate the resource (1832 of 2008)
          Evaluated in 30.61 seconds
        Exec[foreman-rake-db:migrate](provider=posix)
          Executing check '/usr/sbin/foreman-rake db:abort_if_pending_migrations'
          Executing '/usr/sbin/foreman-rake db:migrate'
        /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/unless
          rake aborted!
          Errno::EACCES: Permission denied @ dir_initialize - /usr/share/foreman/lib/satellite
          <internal:dir>:15:in `open'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:60:in `children'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:60:in `has_at_least_one_ruby_file?'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:34:in `block in ls'
          .
          .
          .
          /usr/share/gems/gems/railties-7.0.8.7/lib/rails/application.rb:506:in `block in run_tasks_blocks'
          /usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
          Tasks: TOP => db:abort_if_pending_migrations => db:load_config => environment
          (See full trace by running task with --trace)
        /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns
          rake aborted!
          Errno::EACCES: Permission denied @ dir_initialize - /usr/share/foreman/lib/satellite
          <internal:dir>:15:in `open'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:60:in `children'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:60:in `has_at_least_one_ruby_file?'
          /usr/share/gems/gems/zeitwerk-2.6.18/lib/zeitwerk/loader/helpers.rb:34:in `block in ls'
          .
          .
          .
          /usr/share/gems/gems/railties-7.0.8.7/lib/rails/application.rb:348:in `require_environment!'
          /usr/share/gems/gems/railties-7.0.8.7/lib/rails/application.rb:506:in `block in run_tasks_blocks'
          /usr/share/gems/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
          Tasks: TOP => db:migrate => db:load_config => environment
          (See full trace by running task with --trace)
          change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
    
      1 error was detected during installation.
      Please address the errors and re-run the installer to ensure the system is properly configured.
      Failing to do so is likely to result in broken functionality.
    
      The full log is at /var/log/foreman-installer/satellite.log
      Package versions are being locked.
    

Resolution

  1. Run the following commands to fix the permission on /usr/share/foreman/lib/satellite:
# ls -ldZ /usr/share/foreman/lib/satellite
# chmod -R 755 /usr/share/foreman/lib/satellite
# ls -ldZ /usr/share/foreman/lib/satellite
  1. Run the following script to test:
# cat <<SCRIPT | foreman-rake console
  p "testing"
SCRIPT
  1. If the script doesn't complain about Errno::EACCES: Permission denied @ dir_initialize - /usr/share/foreman/lib/satellite error, run the satellite-installer command:
# satellite-installer

For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.

SBR
Product(s)
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.