ytti/oxidized · error · ArgumentError

cmd must be a String

Error message

cmd must be a String

What it means

Error "cmd must be a String" thrown in ytti/oxidized.

Source

Thrown at lib/oxidized/input/ssh.rb:43

      @text_debug = DebugText.new(Oxidized.config.input.debug, @node, config_name)

      logger.debug "Connecting to #{@node.name}"
      @ssh = Net::SSH.start(@node.ip, @node.auth[:username], make_ssh_opts)
      unless @exec
        shell_open @ssh
        begin
          login
        rescue Timeout::Error
          raise PromptUndetect, [@output, 'not matching configured prompt', @node.prompt].join(' ')
        end
      end
      connected?
    end

    def cmd(cmd, expect = node.prompt)
      unless cmd.is_a?(String)
        logger.error "cmd must be a String (#{cmd.class}): #{cmd.inspect} @ #{node.name}"
        raise ArgumentError, "cmd must be a String"
      end
      logger.debug "Sending '#{cmd.dump}' @ #{node.name} with expect: #{expect.inspect}"
      cmd_output = if @exec
                     @yaml_debug&.send_data(cmd)
                     @text_debug&.send_data(cmd)
                     @ssh.exec! cmd
                   else
                     cmd_shell(cmd, expect).gsub("\r\n", "\n")
                   end

      # only logging @exec as cmd_shell is handled in the ssh loop
      @yaml_debug&.receive_data(cmd_output) if @exec
      @text_debug&.receive_data(cmd_output) if @exec

      # Make sure we return a String
      cmd_output.to_s
    end

View on GitHub (pinned to 687ed4262d)

When it happens

Trigger: Thrown at lib/oxidized/input/ssh.rb:43 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ytti/oxidized@687ed4262d (2026-08-23). Data as JSON: /api/errors/7ddce30dec0d9759. Report an issue: GitHub.