apache/pulsar · error · IllegalArgumentException

Per instance RAM requested, %s, for function is less than th

Error message

Per instance RAM requested, %s, for function is less than the minimum required, %s

What it means

validateMinResourcesRequired rejects functions whose requested RAM is below the worker-configured minimum. When functionDetails.resources.ram < functionInstanceMinResources.ram, an IllegalArgumentException reports both values.

Source

Thrown at pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:466

                if (!functionDetails.hasResources()) {
                    throw new IllegalArgumentException(
                            String.format("Per instance CPU requested is not specified. "
                                    + "Must specify CPU requested for function to be at least %s", minCpu));
                } else if (functionDetails.getResources().getCpu() < minCpu) {
                    throw new IllegalArgumentException(
                            String.format("Per instance CPU requested, %s, "
                                            + "for function is less than the minimum required, %s",
                                    functionDetails.getResources().getCpu(), minCpu));
                }
            }

            if (minRam != null) {
                if (!functionDetails.hasResources()) {
                    throw new IllegalArgumentException(
                            String.format("Per instance RAM requested is not specified. "
                                    + "Must specify RAM requested for function to be at least %s", minRam));
                } else if (functionDetails.getResources().getRam() < minRam) {
                    throw new IllegalArgumentException(
                            String.format("Per instance RAM requested, %s, "
                                            + "for function is less than the minimum required, %s",
                                    functionDetails.getResources().getRam(), minRam));
                }
            }
        }
    }

    void validateMaxResourcesRequired(FunctionDetails functionDetails) {
        if (functionInstanceMaxResources != null) {
            Double maxCpu = functionInstanceMaxResources.getCpu();
            Long maxRam = functionInstanceMaxResources.getRam();

            if (maxCpu != null && functionDetails.getResources().getCpu() > maxCpu) {
                throw new IllegalArgumentException(
                        String.format(
                                "Per instance CPU requested, %s, for function is greater than the maximum required, %s",
                                functionDetails.getResources().getCpu(), maxCpu));

View on GitHub (pinned to 820761864e)

Solutions

  1. Increase the function's --ram to at least the configured minimum.
  2. Ask the cluster admin to lower functionInstanceMinResources.ram if the minimum is misconfigured.
  3. Update CI/deployment templates to enforce the minimum before submission.

Example fix

// before
--ram 536870912
// after
--ram 1073741824  (assuming min ram is 1Gi)
Defensive patterns

Strategy: validation

Validate before calling

if (minRam != null && details.getResources().getRam() < minRam) {
    throw new IllegalArgumentException("ram " + details.getResources().getRam() + " < required min " + minRam);
}

Try / catch

try { admin.functions().updateFunction(config); } catch (IllegalArgumentException e) { if (e.getMessage().contains("less than the minimum")) { /* raise ram or notify admin */ } throw e; }

Prevention

When it happens

Trigger: Submitting/updating a function with --ram smaller than the cluster's functionInstanceMinResources.ram (doAdmissionChecks -> validateMinResourcesRequired, line 466).

Common situations: Lowering memory to save cost after a policy change; reusing configs from clusters with smaller minimums; Kubernetes namespace limits dictating different values than the worker admission config.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/b22abaed9b869487. Report an issue: GitHub.