Looks like the proxy refresh call fails after upgrade to 2.6.0:
[2021-06-12T01:11:35.168Z] e[0;31m 2021-06-12 01:11:13 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[pipe-up-katello-nightly-centos7.n42.example.com]: Failed to call refresh: Error making PUT request to https://pipe-up-katello-nightly-centos7.n42.example.com/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on Foreman server for detailed informatione[0m
[2021-06-12T01:11:35.168Z] e[0;31m 2021-06-12 01:11:13 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[pipe-up-katello-nightly-centos7.n42.example.com]: Error making PUT request to https://pipe-up-katello-nightly-centos7.n42.example.com/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on Foreman server for detailed informatione[0m
and production.log:
2021-06-12T01:11:10 [I|app|c7bd9843] Started PUT "/api/v2/smart_proxies/1/refresh" for 192.168.121.219 at 2021-06-12 01:11:10 +0000
2021-06-12T01:11:10 [I|app|c7bd9843] Processing by Api::V2::SmartProxiesController#refresh as JSON
2021-06-12T01:11:10 [I|app|c7bd9843] Parameters: {"apiv"=>"v2", "id"=>"1", "smart_proxy"=>{}}
2021-06-12T01:11:10 [I|app|c7bd9843] Authorized user foreman_api_admin(API Admin)
2021-06-12T01:11:13 [W|app|c7bd9843] Action failed
2021-06-12T01:11:13 [I|app|c7bd9843] Backtrace for 'Action failed' error (ProxyAPI::ProxyException): ERF12-9411 [ProxyAPI::ProxyException]: Unable to fetch public key ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy https://pipe-up-katello-nightly-centos7.n42.example.com:9090/ssh
c7bd9843 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.6.0/app/lib/proxy_api/remote_execution_ssh.rb:11:in `rescue in pubkey'
c7bd9843 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.6.0/app/lib/proxy_api/remote_execution_ssh.rb:8:in `pubkey'
c7bd9843 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.6.0/app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb:10:in `update_pubkey'
c7bd9843 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-4.6.0/app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb:21:in `refresh'
c7bd9843 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.2.0.pre.master/app/models/katello/concerns/smart_proxy_extensions.rb:12:in `refresh'
c7bd9843 | /usr/share/foreman/app/controllers/api/v2/smart_proxies_controller.rb:60:in `refresh'
I know you are doing a lot of re-factoring work to drop the need for _core gems across the ecosystem @aruzicka, could you suggest how we should proceed to get nightly flowing again?
Remote execution < 4.6.0 used to depend on rex core so it got pulled in before the upgrade. Then after the upgrade it is not really needed, but remains installed and brings in additional deps which cause this mess.
IMHO it should not fail with an internal server error at all. Can’t we make it deal with a proxy without a public key? Or if it’s always needed, make the Smart Proxy plugin fail to start up.
I think this would give more guarantees.
That also gave me a thought: should it generate a private key on startup if it’s missing? Perhaps that would even allow us to remove the code from the installer at some point.