{"record":{"id":"d0b2a5387e10394a","repo":"ytti/oxidized","slug":"could-not-generate-panos-api-key-msg","errorCode":null,"errorMessage":"Could not generate PanOS API key: #{msg}","messagePattern":"Could not generate PanOS API key: #(.+?)","errorType":"exception","errorClass":"Oxidized::OxidizedError","httpStatus":null,"severity":"error","filePath":"lib/oxidized/model/panos_api.rb","lineNumber":39,"sourceCode":"\n  # Callback function for getting the configuration file.\n  cfg_cb = lambda do\n    url_param = URI.encode_www_form(\n      user:     @node.auth[:username],\n      password: @node.auth[:password],\n      type:     'keygen'\n    )\n\n    kg_r = get_http \"/api?#{url_param}\"\n\n    # Parse the XML API response for the keygen request.\n    kg_x = Nokogiri::XML(kg_r)\n\n    # Check if keygen was successful. If not we'll throw an error.\n    status = kg_x.xpath('//response/@status').first\n    if status.to_s != 'success'\n      msg = kg_x.xpath('//response/result/msg').text\n      raise Oxidized::OxidizedError, \"Could not generate PanOS API key: #{msg}\"\n    end\n\n    # If we reach here, keygen was successful, so get the API key\n    # out of the keygen XML response.\n    apikey = kg_x.xpath('//response/result/key').text.to_s\n\n    # Now that we have the API key, we can request a configuration\n    # export.\n    url_param = URI.encode_www_form(\n      key:      apikey,\n      category: 'configuration',\n      type:     'export'\n    )\n\n    cfg = get_http \"/api?#{url_param}\"\n\n    # The configuration export is in XML format. Unfortunately,\n    # it's just one long line of XML that's not especially human","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/ytti/oxidized/blob/687ed4262d9d21e54662e872e2383386d8498f7b/lib/oxidized/model/panos_api.rb#L21-L57","documentation":"Error \"Could not generate PanOS API key: #{msg}\" thrown in ytti/oxidized.","triggerScenarios":"Thrown at lib/oxidized/model/panos_api.rb:39 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"}