theforeman/foreman · error · ProxyException

Unable to retrieve the next available IP for subnet %{subnet

Error message

Unable to retrieve the next available IP for subnet %{subnet} External IPAM.

What it means

Error "Unable to retrieve the next available IP for subnet %{subnet} External IPAM." thrown in theforeman/foreman.

Source

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

    # Responses:
    #   Responses if success:
    #     IPv4: {"data": "100.55.55.3"}
    #     IPv6: {"data": "2001:db8:abcd:12::1"}
    #   Response if missing required params:
    #     {"error": ["A 'cidr' parameter for the subnet must be provided(e.g. 100.10.10.0/24)","A 'mac' address must be provided(e.g. 00:0a:95:9d:68:10)"]}
    #   Response if subnet does not exist:
    #     {"error": "Subnet not found in External IPAM."}
    #   Response if there are no free addresses:
    #     {"error": "No free addresses found"}
    #   Response if can't connect to External IPAM server
    #     {"error": "Unable to connect to External IPAM server"}
    def next_ip(subnet, mac, group = "")
      raise "subnet cannot be nil" if subnet.nil?
      response = parse get("/subnet/#{subnet}/next_ip", query: { mac: mac, group: group })
      raise(response['error']) if response['error'].present?
      response['data']
    rescue => e
      raise ProxyException.new(url, e, N_("Unable to retrieve the next available IP for subnet %{subnet} External IPAM."), subnet: subnet)
    end

    # Adds an IP address to the specified subnet in External IPAM. This will reserve the IP in the
    # External IPAM database. If group is specified, the IP will be added to the subnet within the
    # given group.
    #
    # Params: 1. ip:               IP address to be added
    #         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.
    #
    # Returns: true if IP was added successfully to External IPAM, otherwise false
    #
    # Responses:"
    #   Response if success:
    #     201
    #   Response if IP already reserved:
    #     {"error": "IP address already exists"}

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/proxy_api/external_ipam.rb:70 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/26deb109bf41df89. Report an issue: GitHub.