{"record":{"id":"3ab7b62ff3da71d8","repo":"theforeman/foreman","slug":"unable-to-retrieve-dhcp-entry-for-s","errorCode":null,"errorMessage":"Unable to retrieve DHCP entry for %s","messagePattern":"Unable to retrieve DHCP entry for (.+?)","errorType":"exception","errorClass":"ProxyAPI::ProxyException","httpStatus":null,"severity":"error","filePath":"app/services/proxy_api/dhcp.rb","lineNumber":56,"sourceCode":"      raise ProxyException.new(url, e, N_(\"Unable to retrieve unused IP\"))\n    end\n\n    # Retrieves a DHCP entry for a mac\n    # [+subnet+] : String in dotted decimal format\n    # [+mac+]    : String in coloned sextuplet format\n    # Returns    : Hash or false\n    def record(subnet, mac)\n      response = parse(get(\"#{subnet}/mac/#{mac}\"))\n      attrs = response.merge(:network => subnet, :proxy => self)\n      if response.keys.grep(/Sun/i).empty?\n        Net::DHCP::Record.new attrs\n      else\n        Net::DHCP::SparcRecord.new attrs\n      end\n    rescue RestClient::ResourceNotFound\n      nil\n    rescue => e\n      raise ProxyException.new(url, e, N_(\"Unable to retrieve DHCP entry for %s\"), mac)\n    end\n\n    # Retrieves an array of DHCP entries\n    # [+subnet+] : String in dotted decimal format\n    # [+ip+]    : ip address\n    # Returns    : Hash or false\n    def records_by_ip(subnet, ip)\n      response = parse(get(\"#{subnet}/ip/#{ip}\"))\n      response.map do |entry|\n        attrs = entry.merge(:network => subnet, :proxy => self)\n        if entry.keys.grep(/Sun/i).empty?\n          Net::DHCP::Record.new attrs\n        else\n          Net::DHCP::SparcRecord.new attrs\n        end\n      end\n    rescue RestClient::ResourceNotFound\n      nil","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/proxy_api/dhcp.rb#L38-L74","documentation":"Error \"Unable to retrieve DHCP entry for %s\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/proxy_api/dhcp.rb:56 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"}