Skip to content

ArgumentError: invalid option(s): known_hosts with net-ssh 3.0.2 #357

Closed

Description

@mattbrictson

I saw this reported on Stack Overflow, and it seems like a legitimate bug introduced in sshkit 1.11.0.

https://stackoverflow.com/questions/37865299/capistrano-error-invalid-optionss-known-hosts

To summarize: starting with sshkit 1.11.0, we now pass a :known_hosts option to net-ssh by default (see #339). Unfortunately it seems that not all versions of net-ssh allow this. And instead of ignoring the option, net-ssh raises this error, at least in net-ssh 3.0.2:

ArgumentError: invalid option(s): known_hosts

The solution seems to be to upgrade to net-ssh 3.1.1.

@byroot Does this bug report seem legitimate? What can we do to fix this issue (other than change our gemspec to require newer net-ssh, which seems drastic)?

Activity

  1. casperisfine commented on Jun 17, 2016

    @casperisfine
    Contributor

    Hum, good point. I think we could check Net::SSH::VALID_OPTIONS, I'll PR something. https://github.com/net-ssh/net-ssh/blob/e884efe99fefe66eaddbd17b42b16c8112c6b9c5/lib/net/ssh.rb#L63

  2. added a commit that references this issue on Oct 17, 2016
  3. added a commit that references this issue on May 11, 2026
  4. added a commit that references this issue on May 13, 2026
  5. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions