theforeman/foreman · error · ProxyException

Unable to add IP %{ip} to the subnet %{subnet} in External I

Error message

Unable to add IP %{ip} to the subnet %{subnet} in External IPAM.

What it means

Error "Unable to add IP %{ip} to the subnet %{subnet} in External IPAM." thrown in theforeman/foreman.

Source

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

    # Responses:"
    #   Response if success:
    #     201
    #   Response if IP already reserved:
    #     {"error": "IP address already exists"}
    #   Response if subnet error:
    #     {"error": "Subnet not found in External IPAM"}
    #   Response if missing required params:
    #     {"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 can't connect to External IPAM server
    #     {"error": "Unable to connect to External IPAM server"}
    def add_ip_to_subnet(ip, subnet, group = "")
      raise "subnet cannot be nil" if subnet.nil?
      raise "ip cannot be nil" if ip.nil?
      response = parse post({}, "/subnet/#{subnet}/#{ip}?group=#{CGI.escape(group.to_s)}")
      raise(response['error']) if response.is_a?(Hash) && response['error'].present?
      response
    rescue => e
      raise ProxyException.new(url, e, N_("Unable to add IP %{ip} to the subnet %{subnet} in External IPAM."), ip: ip, subnet: subnet)
    end

    # Get a list of groups from External IPAM. A group is a logical grouping of subnets/ips.
    #
    # Params:  None
    #
    # Returns: An array of groups on success, or a hash with a "error" key
    #          containing error on failure.
    #
    # Responses:
    #   Response if success:
    #     {[
    #       {name":"Test Group","description": "A Test Group"},
    #       {name":"Awesome Group","description": "A totally awesome Group"}
    #     ]}
    #   Response if no groups exist:
    #     []
    #   Response if groups are not supported:

View on GitHub (pinned to 6b05625475)

When it happens

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