Skip to content

Conversation

@adamruzicka
Copy link

(cherry picked from commit 5985511)

@Odilhao Odilhao merged commit 34c380c into theforeman:deb/3.1 Nov 29, 2021
@adamruzicka adamruzicka deleted the deb/3.1-sp-rex-ssh branch November 29, 2021 13:39
@shr-project
Copy link

Shouldn't this depend on ruby-mqtt as in rpm packaging?

it was added there with #7349, but ruby-mqtt isn't packaged for debian only for rpm as in:
#7327

On Ubuntu 20.04 with foreman 3.1 I'm seeing:

Message
Couldn't enable 'ssh'
Backtrace
cannot load such file -- mqtt: /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/vendor_ruby/smart_proxy_remote_execution_ssh/actions/pull_script.rb:1:in `<top (required)>'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/vendor_ruby/smart_proxy_remote_execution_ssh/actions.rb:4:in `<module:Actions>'
/usr/lib/ruby/vendor_ruby/smart_proxy_remote_execution_ssh/actions.rb:2:in `<module:Ssh>'
/usr/lib/ruby/vendor_ruby/smart_proxy_remote_execution_ssh/actions.rb:1:in `<top (required)>'

@adamruzicka
Copy link
Author

Shouldn't this depend on ruby-mqtt as in rpm packaging?

Yes, it should. Thank you for pointing that out

@evgeni
Copy link
Member

evgeni commented Dec 10, 2021

This should only fail when using the MQTT backend, right?

Because our tests call hammer job-invocation create --job-template 'Run Command - SSH Default' --inputs 'command=uptime' --search-query "name = $HOSTNAME" and that seems to still work fine?

@adamruzicka
Copy link
Author

This is interesting. It attempts to load to load mqtt on startup without any failsafes, however if an exception is raised doing loading, smart proxy merrily ignores it and still marks the feature as available. I think this is not the first time we're running into this (cc @ekohl). Although it seems to be up and apparently working in our tests, I wouldn't vouch for it being 100% ready

$ bundle exec ruby bin/smart-proxy | grep mqtt &
2021-12-10T17:23:30  [W] Error details for Couldn't enable 'ssh': <LoadError>: cannot load such file -- mqtt

$ curl http://localhost:8000/features
["ansible","dynflow","logs","probing","salt","shellhooks","ssh"]

@evgeni
Copy link
Member

evgeni commented Dec 13, 2021

@adamruzicka packaging fixes in #7416 -- mind having a quick look?

the smart-proxy behavior is disturbing :(

@ekohl
Copy link
Member

ekohl commented Dec 13, 2021

I think theforeman/smart_proxy_remote_execution_ssh#57 would have caught that. Right now it's loading the plugin in after_activation (which is deprecated). The load_classes method is ran before the plugin is marked as :running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants