apache/pulsar · error · ParameterException

Invalid sink type '%s' -- Available sinks are: %s

Error message

Invalid sink type '%s' -- Available sinks are: %s

What it means

CmdSinks.validateSinkType checked the requested sink type against the built-in connectors returned by the broker/functions worker and found no match; the CLI lists the available sink types in the error.

Source

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

                    && !sinkConfig.getArchive().startsWith(Utils.BUILTIN)) {
                if (!new File(sinkConfig.getArchive()).exists()) {
                    throw new IllegalArgumentException(String.format("Sink Archive file %s does not exist",
                            sinkConfig.getArchive()));
                }
            }
        }

        protected String validateSinkType(String sinkType) throws IOException {
            Set<String> availableSinks;
            try {
                availableSinks = getAdmin().sinks().getBuiltInSinks().stream()
                        .map(ConnectorDefinition::getName).collect(Collectors.toSet());
            } catch (PulsarAdminException e) {
                throw new IOException(e);
            }

            if (!availableSinks.contains(sinkType)) {
                throw new ParameterException(
                        "Invalid sink type '" + sinkType + "' -- Available sinks are: " + availableSinks);
            }

            // Source type is a valid built-in connector type
            return "builtin://" + sinkType;
        }
    }

    /**
     * Sink level command.
     */
    @Getter
    abstract class SinkCommand extends BaseCommand {
        @Option(names = "--tenant", description = "The sink's tenant")
        protected String tenant;

        @Option(names = "--namespace", description = "The sink's namespace")
        protected String namespace;

View on GitHub (pinned to 820761864e)

Solutions

  1. Pick a sink type from the listed available sinks
  2. Provide a --archive (NAR) instead of relying on a builtin type

Example fix

// before
--sink-type cassandra-sink
// after
--sink-type cassandra
Defensive patterns

Strategy: validation

Validate before calling

const available = execSync('pulsar-admin sinks available-sinks').toString().split('\n');
if (!available.includes(sinkType)) throw new Error(`Unknown sink type: ${sinkType}. Available: ${available}`);

Type guard

const isValidSinkType = (t, available) => available.includes(t);

Try / catch

try {
  // run sinks create --sink-type X
} catch (e) {
  if (e.message.includes('Invalid sink type')) { /* list available-sinks and correct */ }
  throw e;
}

Prevention

When it happens

Trigger: Running `pulsar-admin sinks create --sink-type xyz` where 'xyz' is not in the connector registry returned by the admin API (GET /connectors) on the broker.

Common situations: Connector NAR not deployed to the broker's connectors directory; connector name casing mismatch; using a source connector name for a sink; broker deployed without bundled connectors.

Related errors


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