{"record":{"id":"243804947e1fbb2b","repo":"theforeman/foreman","slug":"unable-to-obtain-ip-address-for-subnet-subnet-i","errorCode":null,"errorMessage":"Unable to obtain IP address for subnet %{subnet} in External IPAM.","messagePattern":"Unable to obtain IP address for subnet %(.+?) in External IPAM\\.","errorType":"exception","errorClass":"ProxyException","httpStatus":null,"severity":"error","filePath":"app/services/proxy_api/external_ipam.rb","lineNumber":238,"sourceCode":"    #   Response if subnet not exists:\n    #     {\"error\": \"Subnet not found in External IPAM\"}\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 ip_exists(ip, subnet, group = \"\")\n      raise \"subnet cannot be nil\" if subnet.nil?\n      raise \"ip cannot be nil\" if ip.nil?\n      response = parse get(\"/subnet/#{subnet}/#{ip}\", query: { group: group })\n      raise(response['error']) if response.is_a?(Hash) && response['error'].present?\n      if response.is_a?(Hash)\n        raise(response['error']) if response['error'].present?\n        response['result']\n      else # Foreman Proxy < 3.3 support\n        response\n      end\n    rescue => e\n      raise ProxyException.new(url, e, N_(\"Unable to obtain IP address for subnet %{subnet} in External IPAM.\"), subnet: subnet)\n    end\n\n    # Deletes an IP address from a given subnet in External IPAM.\n    #\n    # Inputs: 1. ip:               IP address to be freed up\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.\n    #\n    # Responses:\n    #   Response if success:\n    #     200\n    #   Response if subnet error:\n    #     {\"error\": \"The specified subnet does not exist in External IPAM.\"}\n    #   Response if IP already deleted:\n    #     {\"error\": \"Unable to delete IP from External IPAM\"}\n    #   Response if groups not supported(only checked if a group is specified):\n    #     {\"error\": \"Groups are not supported\"}","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/services/proxy_api/external_ipam.rb#L220-L256","documentation":"Error \"Unable to obtain IP address for subnet %{subnet} in External IPAM.\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/services/proxy_api/external_ipam.rb:238 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"}