theforeman/foreman · error · ProxyException

Unable to obtain subnet %{subnet} from External IPAM.

Error message

Unable to obtain subnet %{subnet} from External IPAM.

What it means

Error "Unable to obtain subnet %{subnet} from External IPAM." thrown in theforeman/foreman.

Source

Thrown at app/services/proxy_api/external_ipam.rb:203

    #                               IPv6 - "2001:db8:abcd:12::/124")
    #          2. group(optional):  The name of the External IPAM group containing the subnet.
    #
    # Responses:
    #   Response if subnet(s) exists:
    #     {"subnet": "44.44.44.0", "description": "", "mask":"29"}
    #   Response if subnet not exists:
    #     {"error": "No subnets found"}
    #   Response if groups not supported(only checked if a group is specified):
    #     {"error": "Groups are not supported"}
    #   Response if can't connect to External IPAM server
    #     {"error": "Unable to connect to External IPAM server"}
    def get_subnet(subnet, group = "")
      raise "subnet cannot be nil" if subnet.nil?
      response = parse get("/subnet/#{subnet}", query: {group: group})
      raise(response['error']) if response['error'].present?
      response
    rescue => e
      raise ProxyException.new(url, e, N_("Unable to obtain subnet %{subnet} from External IPAM."), subnet: subnet)
    end

    # Checks whether an IP address has been reserved in External IPAM.
    #
    # Inputs: 1. ip:               IP address to be checked
    #         2. subnet:           The IPv4 or IPv6 subnet CIDR. (Examples: IPv4 - "100.10.10.0/24",
    #                              IPv6 - "2001:db8:abcd:12::/124")
    #         3. group(optional):  The name of the External IPAM group containing the subnet to pull IP from
    #
    # Responses:
    #   Response if IP is reserved:
    #     {"result": true}
    #   Response if IP address is available
    #     {"result": false}
    #   Response if missing required parameters:
    #     {"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)"]}
    #   Response if subnet not exists:
    #     {"error": "Subnet not found in External IPAM"}

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/proxy_api/external_ipam.rb:203 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/63e364cbc4415654. Report an issue: GitHub.