{"record":{"id":"7ddce30dec0d9759","repo":"ytti/oxidized","slug":"cmd-must-be-a-string","errorCode":null,"errorMessage":"cmd must be a String","messagePattern":"cmd must be a String","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/oxidized/input/ssh.rb","lineNumber":43,"sourceCode":"      @text_debug = DebugText.new(Oxidized.config.input.debug, @node, config_name)\n\n      logger.debug \"Connecting to #{@node.name}\"\n      @ssh = Net::SSH.start(@node.ip, @node.auth[:username], make_ssh_opts)\n      unless @exec\n        shell_open @ssh\n        begin\n          login\n        rescue Timeout::Error\n          raise PromptUndetect, [@output, 'not matching configured prompt', @node.prompt].join(' ')\n        end\n      end\n      connected?\n    end\n\n    def cmd(cmd, expect = node.prompt)\n      unless cmd.is_a?(String)\n        logger.error \"cmd must be a String (#{cmd.class}): #{cmd.inspect} @ #{node.name}\"\n        raise ArgumentError, \"cmd must be a String\"\n      end\n      logger.debug \"Sending '#{cmd.dump}' @ #{node.name} with expect: #{expect.inspect}\"\n      cmd_output = if @exec\n                     @yaml_debug&.send_data(cmd)\n                     @text_debug&.send_data(cmd)\n                     @ssh.exec! cmd\n                   else\n                     cmd_shell(cmd, expect).gsub(\"\\r\\n\", \"\\n\")\n                   end\n\n      # only logging @exec as cmd_shell is handled in the ssh loop\n      @yaml_debug&.receive_data(cmd_output) if @exec\n      @text_debug&.receive_data(cmd_output) if @exec\n\n      # Make sure we return a String\n      cmd_output.to_s\n    end\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/ytti/oxidized/blob/687ed4262d9d21e54662e872e2383386d8498f7b/lib/oxidized/input/ssh.rb#L25-L61","documentation":"Error \"cmd must be a String\" thrown in ytti/oxidized.","triggerScenarios":"Thrown at lib/oxidized/input/ssh.rb:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"687ed4262d9d21e54662e872e2383386d8498f7b","analyzedAt":"2026-08-23T11:19:42.084Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}