Inspec::Plugin::V2::InstallError Errors with Version Mismatch and Plugin Install

I am starting to doubt this is a problem with this plugin.

What can I be doing wrong?

$ which inspec
/Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec
$ inspec version
4.23.11
$ inspec plugin list
┌───────────────────────────┬─────────┬──────────────┬─────────┐
│        Plugin Name        │ Version │     Via      │ ApiVer  │
├───────────────────────────┼─────────┼──────────────┼─────────┤
│ inspec-artifact           │ 4.23.11 │ core         │ 2       │
│ inspec-compliance         │ 4.23.11 │ core         │ 2       │
│ inspec-habitat            │ 4.23.11 │ core         │ 2       │
│ inspec-init               │ 4.23.11 │ core         │ 2       │
│ inspec-plugin-manager-cli │ 4.23.11 │ core         │ 2       │
│ inspec-reporter-html2     │ 4.23.11 │ core         │ 2       │
│ inspec-reporter-json-min  │ 4.23.11 │ core         │ 2       │
│ inspec-reporter-junit     │ 4.23.11 │ core         │ 2       │
│ inspec-supermarket        │ 4.23.11 │ core         │ 0       │
│ train-aws                 │ 0.1.18  │ gem (system) │ train-1 │
│ train-habitat             │ 0.2.13  │ gem (system) │ train-1 │
│ train-winrm               │ 0.2.6   │ gem (system) │ train-1 │
└───────────────────────────┴─────────┴──────────────┴─────────┘
 12 plugin(s) total
$ inspec plugin install --log-level=debug  inspec-resource-pack
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-supermarket': an existing plugin with that name was loaded via bundle-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/bundles/inspec-supermarket.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-reporter-junit': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-reporter-junit/lib/inspec-reporter-junit.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-plugin-manager-cli': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-reporter-html2': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-reporter-html2/lib/inspec-reporter-html2.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-artifact': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-artifact/lib/inspec-artifact.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-reporter-json-min': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-habitat': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-habitat/lib/inspec-habitat.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-init': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-init/lib/inspec-init.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-compliance': an existing plugin with that name was loaded via core-loading from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-compliance/lib/inspec-compliance.rb
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-habitat': an existing plugin with that name was loaded via system_gem-loading from train-habitat
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-aws': an existing plugin with that name was loaded via system_gem-loading from train-aws
[2020-09-29T23:57:14-04:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-winrm': an existing plugin with that name was loaded via system_gem-loading from train-winrm
Traceback (most recent call last):
        24: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:24:in `<main>'
        23: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:24:in `eval'
        22: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec:23:in `<main>'
        21: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec:23:in `load'
        20: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-bin-4.23.10/bin/inspec:11:in `<top (required)>'
        19: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/base_cli.rb:35:in `start'
        18: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
        17: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        16: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        15: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        14: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:243:in `block in subcommand'
        13: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:116:in `invoke'
        12: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        11: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        10: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
         9: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:123:in `install'
         8: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:364:in `install_from_remote_gem'
         7: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:412:in `install_attempt_install'
         6: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:72:in `install'
         5: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:303:in `install_from_remote_gems'
         4: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:345:in `install_gem_to_plugins_dir'
         3: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:345:in `each'
         2: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:347:in `block in install_gem_to_plugins_dir'
         1: from /Users/myuser/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/specification.rb:1367:in `activate'
/Users/myuser/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems/specification.rb:2233:in `check_version_conflict': can't activate net-ssh-5.2.0, already activated net-ssh-6.1.0 (Gem::LoadError)
        21: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:24:in `<main>'
        20: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:24:in `eval'
        19: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec:23:in `<main>'
        18: from /Users/myuser/.rvm/gems/ruby-2.7.1/bin/inspec:23:in `load'
        17: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-bin-4.23.10/bin/inspec:11:in `<top (required)>'
        16: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/base_cli.rb:35:in `start'
        15: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
        14: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        13: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        12: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        11: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:243:in `block in subcommand'
        10: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:116:in `invoke'
         9: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
         8: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
         7: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
         6: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:123:in `install'
         5: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:364:in `install_from_remote_gem'
         4: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:412:in `install_attempt_install'
         3: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:72:in `install'
         2: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:303:in `install_from_remote_gems'
         1: from /Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:344:in `install_gem_to_plugins_dir'
/Users/myuser/.rvm/gems/ruby-2.7.1/gems/inspec-core-4.23.10/lib/inspec/plugin/v2/installer.rb:353:in `rescue in install_gem_to_plugins_dir': can't activate net-ssh-5.2.0, already activated net-ssh-6.1.0 (Inspec::Plugin::V2::InstallError)

Hi -

It's difficult to say what's happening there, but the stacktrace does mention InSpec 4.23.10 when you are using 4.23.11 - is the ruby and gem setup clean?

Sorry, I must have missed that. Let me clean up my gem setup and try again.

I was having trouble doing this in docker as well and thought it was container related, and boy did I seem wrong! Ha.

I'll report back.

If you need further help (e.g. posting stacktraces and debug info) please give us a shout in the #inspec channel of Chef Community Slack

Alright I guess will come reach out. To avoid version conflicts, deleted the same official docker image, no local rvm build, and a more clear net-ssh-x.y.z error resurfaces.

$ docker system prune --all --force
$ docker pull chef/inspec:latest
$ docker run chef/inspec:latest version --chef-license=accept

4.21.3

$ docker run -it chef/inspec:latest plugin install inspec-resource-pack --chef-license=accept --log-level=debug
+---------------------------------------------+
✔ 1 product license accepted.
+---------------------------------------------+
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-supermarket': an existing plugin with that name was loaded via bundle-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/bundles/inspec-supermarket.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-habitat': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-habitat/lib/inspec-habitat.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-reporter-json-min': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-artifact': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-artifact/lib/inspec-artifact.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-plugin-manager-cli': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-reporter-html2': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-reporter-html2/lib/inspec-reporter-html2.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-compliance': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-compliance/lib/inspec-compliance.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'inspec-init': an existing plugin with that name was loaded via core-loading from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-init/lib/inspec-init.rb
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-habitat': an existing plugin with that name was loaded via system_gem-loading from train-habitat
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-aws': an existing plugin with that name was loaded via system_gem-loading from train-aws
[2020-10-01T05:08:18+00:00] DEBUG: PluginLoader: refusing to re-register plugin 'train-winrm': an existing plugin with that name was loaded via system_gem-loading from train-winrm
Traceback (most recent call last):
        22: from /usr/local/bundle/bin/inspec:23:in `<main>'
        21: from /usr/local/bundle/bin/inspec:23:in `load'
        20: from /usr/local/bundle/gems/inspec-bin-4.21.3/bin/inspec:11:in `<top (required)>'
        19: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/base_cli.rb:35:in `start'
        18: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
        17: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        16: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        15: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        14: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:243:in `block in subcommand'
        13: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:116:in `invoke'
        12: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        11: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        10: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
         9: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:123:in `install'
         8: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:364:in `install_from_remote_gem'
         7: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:412:in `install_attempt_install'
         6: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:72:in `install'
         5: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:303:in `install_from_remote_gems'
         4: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:345:in `install_gem_to_plugins_dir'
         3: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:345:in `each'
         2: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:347:in `block in install_gem_to_plugins_dir'
         1: from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:1367:in `activate'
/usr/local/lib/ruby/2.7.0/rubygems/specification.rb:2233:in `check_version_conflict': can't activate net-ssh-5.2.0, already activated net-ssh-6.1.0 (Gem::LoadError)
        19: from /usr/local/bundle/bin/inspec:23:in `<main>'
        18: from /usr/local/bundle/bin/inspec:23:in `load'
        17: from /usr/local/bundle/gems/inspec-bin-4.21.3/bin/inspec:11:in `<top (required)>'
        16: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/base_cli.rb:35:in `start'
        15: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
        14: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        13: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        12: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        11: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:243:in `block in subcommand'
        10: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:116:in `invoke'
         9: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
         8: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
         7: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
         6: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:123:in `install'
         5: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:364:in `install_from_remote_gem'
         4: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb:412:in `install_attempt_install'
         3: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:72:in `install'
         2: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:303:in `install_from_remote_gems'
         1: from /usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:344:in `install_gem_to_plugins_dir'
/usr/local/bundle/gems/inspec-core-4.21.3/lib/inspec/plugin/v2/installer.rb:353:in `rescue in install_gem_to_plugins_dir': can't activate net-ssh-5.2.0, already activated net-ssh-6.1.0 (Inspec::Plugin::V2::InstallError)