{"record":{"id":"b81a0d5c2be61053","repo":"theforeman/foreman","slug":"unable-to-perform-power-bmc-operation","errorCode":null,"errorMessage":"Unable to perform power BMC operation","messagePattern":"Unable to perform power BMC operation","errorType":"exception","errorClass":"ProxyAPI::ProxyException","httpStatus":null,"severity":"error","filePath":"app/services/proxy_api/bmc.rb","lineNumber":65,"sourceCode":"    def power(args)\n      # get \"/bmc/:host/chassis/power/:action\"\n      # put \"/bmc/:host/chassis/power/:action\"\n      case args[:action]\n      when \"on?\", \"off?\", \"status\"\n        args[:action].chop! if args[:action].include?('?')\n        full_path_as_hash = bmc_url_for_get('power', args[:action])\n        response = parse(get(full_path_as_hash[:path], query: full_path_as_hash[:query]))\n        response.is_a?(Hash) ? response['result'] : response\n      when \"on\", \"off\", \"cycle\", \"soft\", \"reboot\", \"reset\"\n        res = parse put(with_provider(args), bmc_url_for('power', args[:action]))\n        res && (res['result'] == true || res['result'] == \"#{@target}: ok\\n\")\n      else\n        raise NoMethodError\n      end\n    rescue NoMethodError => e\n      raise e\n    rescue => e\n      raise ProxyException.new(url, e, N_(\"Unable to perform power BMC operation\"))\n    end\n\n    # perform an identify operation on the bmc device\n    def identify(args)\n      # get \"/bmc/:host/chassis/identify/:action\"\n      # put \"/bmc/:host/chassis/identify/:action\"\n      case args[:action]\n      when \"status\"\n        full_path_as_hash = bmc_url_for_get('identify', args[:action])\n        parse get(full_path_as_hash[:path], query: full_path_as_hash[:query])\n      when \"on\", \"off\"\n        parse put(with_provider(args), bmc_url_for('identify', args[:action]))\n      else\n        raise NoMethodError\n      end\n    rescue NoMethodError => e\n      raise e\n    rescue => e","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/proxy_api/bmc.rb#L47-L83","documentation":"Error \"Unable to perform power BMC operation\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/proxy_api/bmc.rb:65 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":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}