apache/pulsar · error · IllegalArgumentException

The supplied go file does not exist

Error message

The supplied go file does not exist

What it means

For built-in Go functions (go starts with 'builtin://' and is not a supported package URL), the validator requires that a file with the supplied name exists locally; otherwise it throws IllegalArgumentException('The supplied go file does not exist'). Built-ins resolve from the worker's functions directory, so a name that is not deployed fails validation.

Source

Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:911

            String filename = functionConfig.getPy();
            if (filename.contains("..")) {
                throw new IllegalArgumentException("Invalid filename: " + filename);
            }

            if (!new File(filename).exists()) {
                throw new IllegalArgumentException("The supplied python file does not exist");
            }
        }
        if (!isEmpty(functionConfig.getGo()) && !org.apache.pulsar.common.functions.Utils
                .isFunctionPackageUrlSupported(functionConfig.getGo())
                && functionConfig.getGo().startsWith(BUILTIN)) {
            String filename = functionConfig.getGo();
            if (filename.contains("..")) {
                throw new IllegalArgumentException("Invalid filename: " + filename);
            }

            if (!new File(filename).exists()) {
                throw new IllegalArgumentException("The supplied go file does not exist");
            }
        }

        if (functionConfig.getInputSpecs() != null) {
            functionConfig.getInputSpecs().forEach((topicName, conf) -> {
                // receiver queue size should be >= 0
                if (conf.getReceiverQueueSize() != null && conf.getReceiverQueueSize() < 0) {
                    throw new IllegalArgumentException(
                        "Receiver queue size should be >= zero");
                }

                if (conf.getCryptoConfig() != null && isBlank(conf.getCryptoConfig().getCryptoKeyReaderClassName())) {
                    throw new IllegalArgumentException(
                            "CryptoKeyReader class name required");
                }
                if (conf.getMessagePayloadProcessorConfig() != null && isBlank(
                        conf.getMessagePayloadProcessorConfig().getClassName())) {
                    throw new IllegalArgumentException(

View on GitHub (pinned to 820761864e)

Solutions

  1. List installed built-ins (`pulsar-admin functions builtins list`) and use an exact existing name
  2. Deploy the Go built-in functions archive to the brokers/workers
  3. Submit the Go function via a package URL (http(s):// or file://) pointing to your own compiled artifact instead of builtin://
  4. Verify which cluster/host performs validation and that its filesystem contains the file

Example fix

// before
conf.setGo("builtin://my_go_fn"); // not installed
// after
conf.setGo("builtin://api_examples_native"); // shipped with the distribution
Defensive patterns

Strategy: validation

Validate before calling

String go = conf.getGo();
if (go != null && go.startsWith("builtin://")) {
    String name = go.substring("builtin://".length());
    if (!new java.io.File("/pulsar/functions/" + name).exists()) { // adjust path
        throw new IllegalStateException("Built-in go function not found: " + name);
    }
}

Type guard

boolean builtinGoExists(String s) {
    return s != null && s.startsWith("builtin://")
        && new java.io.File(s.substring("builtin://".length())).exists();
}

Try / catch

try {
    admin.functions().createFunction(conf);
} catch (IllegalArgumentException e) {
    if (e.getMessage().equals("The supplied go file does not exist")) {
        conf.setGo("https://example.com/functions/mygo"); // fall back to package URL
        admin.functions().createFunction(conf);
    } else throw e;
}

Prevention

When it happens

Trigger: Calling createFunction/updateFunction with setGo("builtin://name") where no matching file exists on the validating/broker host; the Go built-ins were never installed on the cluster workers.

Common situations: Missing native built-ins distribution on workers; name mismatch between registered built-in and config (case or suffix errors); cluster where only Java/Python built-ins were installed; validating on a machine different from the cluster.

Related errors


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