apache/pulsar · error · ParameterException

Function Name not provided

Error message

Function Name not provided

What it means

Thrown when a FunctionConfig still has no function name after inference. The CLI first tries Utils.inferMissingFunctionName (deriving a name from the artifact file name); if the name is still empty it raises this ParameterException because tenant/namespace/name are mandatory to address a function.

Source

Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:1025

        void runCmd() throws Exception {
            getAdmin().functions().deleteFunction(tenant, namespace, functionName);
            print("Deleted successfully");
        }
    }

    @Command(description = "Update a Pulsar Function that has been deployed to a Pulsar cluster")
    class UpdateFunction extends FunctionDetailsCommand {

        @Option(names = "--update-auth-data", description = "Whether or not to update the auth data #Java, Python")
        protected boolean updateAuthData;

        @Override
        protected void validateFunctionConfigs(FunctionConfig functionConfig) {
            if (StringUtils.isEmpty(functionConfig.getName())) {
                org.apache.pulsar.common.functions.Utils.inferMissingFunctionName(functionConfig);
            }
            if (StringUtils.isEmpty(functionConfig.getName())) {
                throw new ParameterException("Function Name not provided");
            }
            if (StringUtils.isEmpty(functionConfig.getTenant())) {
                org.apache.pulsar.common.functions.Utils.inferMissingTenant(functionConfig);
            }
            if (StringUtils.isEmpty(functionConfig.getNamespace())) {
                org.apache.pulsar.common.functions.Utils.inferMissingNamespace(functionConfig);
            }
        }

        @Override
        void runCmd() throws Exception {

            UpdateOptionsImpl updateOptions = new UpdateOptionsImpl();
            updateOptions.setUpdateAuthData(updateAuthData);
            if (Utils.isFunctionPackageUrlSupported(functionConfig.getJar())) {
                getAdmin().functions().updateFunctionWithUrl(functionConfig, functionConfig.getJar(), updateOptions);
            } else if (Utils.isFunctionPackageUrlSupported(functionConfig.getPy())) {
                getAdmin().functions().updateFunctionWithUrl(functionConfig, functionConfig.getPy(), updateOptions);

View on GitHub (pinned to 820761864e)

Solutions

  1. Pass --name <functionName> explicitly on the command line
  2. Ensure your function config YAML/JSON includes a `name` field
  3. If relying on inference, use a local file artifact whose filename can supply the name

Example fix

// before
pulsar-admin functions create --tenant t --namespace n --jar http://host/f.jar
// after
pulsar-admin functions create --tenant t --namespace n --name myfunc --jar http://host/f.jar
Defensive patterns

Strategy: validation

Validate before calling

if (config.getName() == null || config.getName().isBlank()) {
    throw new IllegalArgumentException("Function name must be provided via --name");
}

Try / catch

try { admin.functions().createFunction(...); }
catch (ParameterException e) { if (e.getMessage().equals("Function Name not provided")) { log.error("Pass --name or use a file artifact so a name can be inferred"); } throw e; }

Prevention

When it happens

Trigger: `pulsar-admin functions create/update` with neither --name set nor an artifact from which a name can be inferred, hitting the check at CmdFunctions.java:1025 (OverrideConfigCommand path).

Common situations: Using a package URL (e.g. http://...) as the artifact so no filename-based name can be inferred and --name omitted; config YAML missing the `name` field; scripts that pass tenant/namespace but forget the function name.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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