{"record":{"id":"63e364cbc4415654","repo":"theforeman/foreman","slug":"unable-to-obtain-subnet-subnet-from-external-ip","errorCode":null,"errorMessage":"Unable to obtain subnet %{subnet} from External IPAM.","messagePattern":"Unable to obtain subnet %(.+?) from External IPAM\\.","errorType":"exception","errorClass":"ProxyException","httpStatus":null,"severity":"error","filePath":"app/services/proxy_api/external_ipam.rb","lineNumber":203,"sourceCode":"    #                               IPv6 - \"2001:db8:abcd:12::/124\")\n    #          2. group(optional):  The name of the External IPAM group containing the subnet.\n    #\n    # Responses:\n    #   Response if subnet(s) exists:\n    #     {\"subnet\": \"44.44.44.0\", \"description\": \"\", \"mask\":\"29\"}\n    #   Response if subnet not exists:\n    #     {\"error\": \"No subnets found\"}\n    #   Response if groups not supported(only checked if a group is specified):\n    #     {\"error\": \"Groups are not supported\"}\n    #   Response if can't connect to External IPAM server\n    #     {\"error\": \"Unable to connect to External IPAM server\"}\n    def get_subnet(subnet, group = \"\")\n      raise \"subnet cannot be nil\" if subnet.nil?\n      response = parse get(\"/subnet/#{subnet}\", query: {group: group})\n      raise(response['error']) if response['error'].present?\n      response\n    rescue => e\n      raise ProxyException.new(url, e, N_(\"Unable to obtain subnet %{subnet} from External IPAM.\"), subnet: subnet)\n    end\n\n    # Checks whether an IP address has been reserved in External IPAM.\n    #\n    # Inputs: 1. ip:               IP address to be checked\n    #         2. subnet:           The IPv4 or IPv6 subnet CIDR. (Examples: IPv4 - \"100.10.10.0/24\",\n    #                              IPv6 - \"2001:db8:abcd:12::/124\")\n    #         3. group(optional):  The name of the External IPAM group containing the subnet to pull IP from\n    #\n    # Responses:\n    #   Response if IP is reserved:\n    #     {\"result\": true}\n    #   Response if IP address is available\n    #     {\"result\": false}\n    #   Response if missing required parameters:\n    #     {\"error\": [\"A 'cidr' parameter for the subnet must be provided(e.g. 100.10.10.0/24)\", \"Missing 'ip' parameter. An IPv4 address must be provided(e.g. 100.10.10.22)\"]}\n    #   Response if subnet not exists:\n    #     {\"error\": \"Subnet not found in External IPAM\"}","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/proxy_api/external_ipam.rb#L185-L221","documentation":"Error \"Unable to obtain subnet %{subnet} from External IPAM.\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/proxy_api/external_ipam.rb:203 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"}