Description of problem: While investigating https://bugzilla.redhat.com/show_bug.cgi?id=2122461 and after installing the `foreman-redis` package, trying to configure `redis` as the rails cache store with: `satellite-installer --foreman-rails-cache-store type:redis` the installer will fail because it'll try to configure port 8479 instead of 6379. Version-Release number of selected component (if applicable): Satellite 6.13 Snap 8 How reproducible: Always. Steps to Reproduce: 1. Install `foreman-redis` package from brew 2. Run: `satellite-installer --foreman-rails-cache-store type:redis` 3. Actual results: ~~~ # satellite-installer --foreman-rails-cache-store type:redis 2023-01-27 14:34:07 [NOTICE] [root] Loading installer configuration. This will take some time. 2023-01-27 14:34:10 [NOTICE] [root] Running installer with log based terminal output at level NOTICE. 2023-01-27 14:34:10 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions. Package versions are locked. Continuing with unlock. 2023-01-27 14:34:16 [NOTICE] [configure] Starting system configuration. 2023-01-27 14:34:30 [NOTICE] [configure] 250 configuration steps out of 1564 steps complete. 2023-01-27 14:34:36 [NOTICE] [configure] 500 configuration steps out of 1565 steps complete. 2023-01-27 14:34:38 [NOTICE] [configure] 750 configuration steps out of 1569 steps complete. 2023-01-27 14:34:39 [NOTICE] [configure] 1000 configuration steps out of 1575 steps complete. 2023-01-27 14:34:40 [NOTICE] [configure] 1250 configuration steps out of 1575 steps complete. 2023-01-27 14:35:34 [ERROR ] [configure] Systemd start for foreman failed! 2023-01-27 14:35:34 [ERROR ] [configure] journalctl log for foreman: 2023-01-27 14:35:34 [ERROR ] [configure] -- Logs begin at Fri 2023-01-27 14:12:08 UTC, end at Fri 2023-01-27 14:35:34 UTC. -- 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:27 satellite.blue.ddns.perf.redhat.com systemd[1]: Starting Foreman... 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:45 satellite.blue.ddns.perf.redhat.com foreman[5966]: => Booting Puma 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:45 satellite.blue.ddns.perf.redhat.com foreman[5966]: => Rails 6.1.7 application starting in production 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:45 satellite.blue.ddns.perf.redhat.com foreman[5966]: => Run `bin/rails server --help` for more startup options 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:52 satellite.blue.ddns.perf.redhat.com foreman[5966]: /usr/share/gems/gems/foreman_theme_satellite-11.0.0.2/app/models/concerns/distributor_version.rb:5: warning: already initialized constant Katello::Glue::Provider::DISTRIBUTOR_VERSION 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:52 satellite.blue.ddns.perf.redhat.com foreman[5966]: /usr/share/gems/gems/katello-4.7.0.5/app/models/katello/glue/provider.rb:3: warning: previous definition of DISTRIBUTOR_VERSION was here 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:52 satellite.blue.ddns.perf.redhat.com foreman[5966]: Exiting 2023-01-27 14:35:34 [ERROR ] [configure] Jan 27 14:32:52 satellite.blue.ddns.perf.redhat.com foreman[5966]: /usr/share/ruby/socket.rb:1214:in `__connect_nonblock': Permission denied - connect(2) for 127.0.0.1:8479 (Errno::EACCES) . . . ~~~ Expected results: Success. Additional info: This configuration works: ~~~ # grep redis /etc/foreman/settings.yaml :redis_url: redis://localhost:6379/6 :type: redis - redis://localhost:6379/0 ~~~
Modifying the template like this before running `satellite-installer` makes the installation succeed: ~~~ sed -i.orig \ 's#^\( - redis://localhost:\)\(8479\)\(/0\)$#\16379\3#' \ /usr/share/foreman-installer/modules/foreman/templates/settings.yaml.erb ~~~ In a diff format: ~~~ diff -u /usr/share/foreman-installer/modules/foreman/templates/settings.yaml.erb.orig /usr/share/foreman-installer/modules/foreman/templates/settings.yaml.erb --- /usr/share/foreman-installer/modules/foreman/templates/settings.yaml.erb.orig 2023-01-17 16:36:05.000000000 +0000 +++ /usr/share/foreman-installer/modules/foreman/templates/settings.yaml.erb 2023-01-30 10:40:43.873993118 +0000 @@ -106,7 +106,7 @@ - redis://<%= url %> <% end -%> <% else -%> - - redis://localhost:8479/0 + - redis://localhost:6379/0 <% end -%> :options: <% if scope["foreman::rails_cache_store"].key?("options") -%> ~~~
Upstream bug assigned to ekohlvan
The code in https://github.com/theforeman/puppet-foreman/pull/1109 fixes the issue for me as well.
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36037 has been resolved.
Verified: Verified with: - Satellite 6.14.0 snap 4 - foreman-redis-3.7.0-0.5.rc3.el8sat.noarch Test steps: - Run "satellite-installer --foreman-rails-cache-store type:redis" Observations: - Satellite-installer completed successfully.
It should be noted that by default it uses db 0. Dynflow defaults to db 6 while Pulp defaults to db 8. Satellite doesn't support other services on the same host, but it still may have been better to avoid db 0 just to be sure. I opened https://github.com/theforeman/puppet-foreman/pull/1122 to do that.