Skip to content

Conversation

@hedrok
Copy link

@hedrok hedrok commented Dec 9, 2025

In case sshd -T | grep key returns some lines without spaces Hash creation in communicator.rb failed with ArgumentError "odd number of arguments for Hash".

As only "pubkeyacceptedalgorithms", "pubkeyacceptedkeytypes", "hostkeyalgorithms" are needed, change to ignore lines that have no space.

This fixes error:

/home/vyos/tasks/VD-2244-thread-starvation/vagrant/plugins/communicators/ssh/communicator.rb:879:in `[]': odd number of arguments for Has
h (ArgumentError)

        opts = Hash[*list.split("\n").map{|line| line.split(" ", 2)}.flatten]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        from /home/vyos/tasks/VD-2244-thread-starvation/vagrant/plugins/communicators/ssh/communicator.rb:879:in `supported_key_types'
        from /home/vyos/tasks/VD-2244-thread-starvation/vagrant/plugins/communicators/ssh/communicator.rb:215:in `ready?'
        from /home/vyos/tasks/VD-2244-thread-starvation/vagrant/plugins/communicators/ssh/communicator.rb:91:in `block in wait_for_ready'
        from /home/vyos/.local/share/gem/ruby/3.3.0/gems/timeout-0.5.0/lib/timeout.rb:222:in `block in timeout'
        from /home/vyos/.local/share/gem/ruby/3.3.0/gems/timeout-0.5.0/lib/timeout.rb:38:in `handle_timeout'
        from /home/vyos/.local/share/gem/ruby/3.3.0/gems/timeout-0.5.0/lib/timeout.rb:231:in `timeout'
        from /home/vyos/tasks/VD-2244-thread-starvation/vagrant/plugins/communicators/ssh/communicator.rb:66:in `wait_for_ready'
        from /home/vyos/tasks/VD-2244-thread-starvation/vagrant/lib/vagrant/action/builtin/wait_for_communicator.rb:19:in `block in call'

I got it while trying to launch NixOS under Vagrant with https://github.com/nix-community/nixbox.git.

list in line 872 of communicator.rb ends with

"rekeylimit 0 0\npubkeyauthoptions none\n\e]0;\a"

I don't know yet where \e]0;\a came from, but anyway I think ignoring lines without spaces here is good idea.

In case `sshd -T | grep key` returns some lines without spaces
Hash creation in communicator.rb failed with ArgumentError
"odd number of arguments for Hash".

As only "pubkeyacceptedalgorithms", "pubkeyacceptedkeytypes",
"hostkeyalgorithms" are needed, change to ignore lines that have
no space.
@hedrok hedrok requested a review from a team as a code owner December 9, 2025 08:03
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Dec 9, 2025

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant