{"record":{"id":"b22abaed9b869487","repo":"apache/pulsar","slug":"per-instance-ram-requested-s-for-function-is-le","errorCode":null,"errorMessage":"Per instance RAM requested, %s, for function is less than the minimum required, %s","messagePattern":"Per instance RAM requested, (.+?), for function is less than the minimum required, (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java","lineNumber":466,"sourceCode":"                if (!functionDetails.hasResources()) {\n                    throw new IllegalArgumentException(\n                            String.format(\"Per instance CPU requested is not specified. \"\n                                    + \"Must specify CPU requested for function to be at least %s\", minCpu));\n                } else if (functionDetails.getResources().getCpu() < minCpu) {\n                    throw new IllegalArgumentException(\n                            String.format(\"Per instance CPU requested, %s, \"\n                                            + \"for function is less than the minimum required, %s\",\n                                    functionDetails.getResources().getCpu(), minCpu));\n                }\n            }\n\n            if (minRam != null) {\n                if (!functionDetails.hasResources()) {\n                    throw new IllegalArgumentException(\n                            String.format(\"Per instance RAM requested is not specified. \"\n                                    + \"Must specify RAM requested for function to be at least %s\", minRam));\n                } else if (functionDetails.getResources().getRam() < minRam) {\n                    throw new IllegalArgumentException(\n                            String.format(\"Per instance RAM requested, %s, \"\n                                            + \"for function is less than the minimum required, %s\",\n                                    functionDetails.getResources().getRam(), minRam));\n                }\n            }\n        }\n    }\n\n    void validateMaxResourcesRequired(FunctionDetails functionDetails) {\n        if (functionInstanceMaxResources != null) {\n            Double maxCpu = functionInstanceMaxResources.getCpu();\n            Long maxRam = functionInstanceMaxResources.getRam();\n\n            if (maxCpu != null && functionDetails.getResources().getCpu() > maxCpu) {\n                throw new IllegalArgumentException(\n                        String.format(\n                                \"Per instance CPU requested, %s, for function is greater than the maximum required, %s\",\n                                functionDetails.getResources().getCpu(), maxCpu));","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java#L448-L484","documentation":"validateMinResourcesRequired rejects functions whose requested RAM is below the worker-configured minimum. When functionDetails.resources.ram < functionInstanceMinResources.ram, an IllegalArgumentException reports both values.","triggerScenarios":"Submitting/updating a function with --ram smaller than the cluster's functionInstanceMinResources.ram (doAdmissionChecks -> validateMinResourcesRequired, line 466).","commonSituations":"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.","solutions":["Increase the function's --ram to at least the configured minimum.","Ask the cluster admin to lower functionInstanceMinResources.ram if the minimum is misconfigured.","Update CI/deployment templates to enforce the minimum before submission."],"exampleFix":"// before\n--ram 536870912\n// after\n--ram 1073741824  (assuming min ram is 1Gi)","handlingStrategy":"validation","validationCode":"if (minRam != null && details.getResources().getRam() < minRam) {\n    throw new IllegalArgumentException(\"ram \" + details.getResources().getRam() + \" < required min \" + minRam);\n}","typeGuard":null,"tryCatchPattern":"try { admin.functions().updateFunction(config); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"less than the minimum\")) { /* raise ram or notify admin */ } throw e; }","preventionTips":["Clamp submitted ram values against the worker's configured minimum before calling the admin API","Be careful with byte conversions when setting --ram","Track admin changes to min-resources config that can break existing deploy pipelines"],"tags":["kubernetes","resources","memory","quota","admission"],"backgroundTag":"resource-quota-exceeded","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}