Bug 2124850 - failure to enable async-ssh rex mode with Couldn't enable 'script'
Summary: failure to enable async-ssh rex mode with Couldn't enable 'script'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.12.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.12.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks: 2048547
TreeView+ depends on / blocked
 
Reported: 2022-09-07 09:33 UTC by Peter Ondrejka
Modified: 2022-11-16 13:35 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-smart_proxy_remote_execution_ssh-0.7.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35493 0 Normal Closed failure to enable async-ssh rex mode with Couldn't enable 'script 2022-09-13 12:53:28 UTC
Red Hat Issue Tracker SAT-12779 0 None None None 2022-09-07 09:52:01 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:49 UTC

Description Peter Ondrejka 2022-09-07 09:33:33 UTC
Description of problem:

async ssh rex script mode is not enabled correctly on proxy, script jobs then fail to execute

Version-Release number of selected component (if applicable):
6.12 snap 9

How reproducible:
always

Steps to Reproduce:
1. satellite-installer --foreman-proxy-plugin-remote-execution-script-mode=ssh-async
2. run script rex job

Actual results:
/var/log/foreman-proxy/proxy.log contains:

2022-09-07T04:35:48  [E] Couldn't enable 'script'
2022-09-07T04:35:48  [W] Error details for Couldn't enable 'script': <RuntimeError>: Mode has to be one of ssh, async-ssh, pull, pull-mqtt, given ssh-async
/usr/share/gems/gems/smart_proxy_remote_execution_ssh-0.7.1/lib/smart_proxy_remote_execution_ssh.rb:28:in `validate_mode!'
/usr/share/gems/gems/smart_proxy_remote_execution_ssh-0.7.1/lib/smart_proxy_remote_execution_ssh.rb:10:in `validate!'
/usr/share/gems/gems/smart_proxy_remote_execution_ssh-0.7.1/lib/smart_proxy_remote_execution_ssh/plugin.rb:45:in `block in <class:Plugin>'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:228:in `class_eval'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:228:in `configure_plugin'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:109:in `block in configure'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:109:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:109:in `configure'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:187:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:187:in `initialize_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:177:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'

script rex job then fails with:

Initialization error: RestClient::NotFound - 404 Not FoundError loading data from Capsule: NoMethodError - undefined method `code' for "404 Not Found":String
Did you mean?  encode

Expected results:
async-ssh mode working

Additional info:
Using the info from the proxy log I attempted to enable asnyc-ssh instead:

~]# satellite-installer --foreman-proxy-plugin-remote-execution-script-mode=async-ssh
[ERROR ] [root] Parameter foreman-proxy-plugin-remote-execution-script-mode invalid: async-ssh must be one of ssh, ssh-async, pull-mqtt
Error during configuration, exiting

So it seems there is a mismatch in naming expectations async-ssh vs ssh-async

I can share the setup upon ping.

Comment 1 Adam Ruzicka 2022-09-07 09:45:32 UTC
This is fixed in latest upstream as part of https://github.com/theforeman/smart_proxy_remote_execution_ssh/pull/82 , a subset of that change will need to be cherry-picked.

Comment 2 Bryan Kearney 2022-09-07 12:04:58 UTC
Upstream bug assigned to aruzicka

Comment 3 Bryan Kearney 2022-09-07 12:05:00 UTC
Upstream bug assigned to aruzicka

Comment 4 Adam Ruzicka 2022-09-13 12:53:53 UTC
smart_proxy_remote_execution_ssh-0.7.2 containing the fix for this BZ just went out to rubygems

Comment 5 Peter Ondrejka 2022-09-19 15:18:58 UTC
Checked on Satellite 6.12 snap 11. I was able to turn on async-ssh using "satellite-installer --foreman-proxy-plugin-remote-execution-script-mode=async-ssh", but running the actual job against a host didn't succeed -- the job left hanging, /var/log/foreman-proxy/proxy.log showing:

2022-09-19T11:06:32  [E] <OpenSSL::SSL::SSLError> SSL_accept returned=1 errno=0 state=error: http request
	/usr/share/ruby/webrick/server.rb:299:in `accept'
	/usr/share/ruby/webrick/server.rb:299:in `block (2 levels) in start_thread'
	/usr/share/ruby/webrick/utils.rb:263:in `timeout'
	/usr/share/ruby/webrick/server.rb:297:in `block in start_thread'
	/usr/share/gems/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'

I may have omitted some additional config steps if there are any, I just ran the installer command. Machine is available for inspection.

Comment 6 Adam Ruzicka 2022-09-19 16:12:46 UTC
What's described in #5 is completely unrelated to what is described in #0. Also, I'm able to reproduce it on a 6.11 so that's nothing new.

Comment 7 Peter Ondrejka 2022-09-20 08:36:14 UTC
After discussion with adam, I created https://bugzilla.redhat.com/show_bug.cgi?id=2128209 to track problem from comment #5, it will make things easier if we decide to backport the fix. Closing this one as the original issue was fixed.

Comment 11 errata-xmlrpc 2022-11-16 13:35:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506


Note You need to log in before you can comment on or make changes to this bug.