apache/pulsar · error · RestException

{e.getMessage()}

Error message

{e.getMessage()}

What it means

SinkConfigUtils.validateUpdate compares the existing sink config with the submitted update and throws when the update is invalid (e.g. disallowed field change). SinksImpl catches any exception and rethrows it as HTTP 400 BAD_REQUEST with the underlying message, so the text you see is the validation failure from SinkConfigUtils.

Source

Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:323

            log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sinkName)

                    .attr("componentType", ComponentTypeUtils.toString(componentType)).log("/ / is not a");
            throw new RestException(Response.Status.NOT_FOUND,
                    String.format("%s %s doesn't exist", ComponentTypeUtils.toString(componentType), sinkName));
        }


        SinkConfig existingSinkConfig = SinkConfigUtils.convertFromDetails(existingComponent.getFunctionDetails());
        // The rest end points take precedence over whatever is there in functionconfig
        sinkConfig.setTenant(tenant);
        sinkConfig.setNamespace(namespace);
        sinkConfig.setName(sinkName);

        SinkConfig mergedConfig;
        try {
            mergedConfig = SinkConfigUtils.validateUpdate(existingSinkConfig, sinkConfig);
        } catch (Exception e) {
            throw new RestException(Response.Status.BAD_REQUEST, e.getMessage());
        }

        if (existingSinkConfig.equals(mergedConfig) && isBlank(sinkPkgUrl) && uploadedInputStream == null
                && (updateOptions == null || !updateOptions.isUpdateAuthData())) {
            log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sinkName)

                    .log("/ / Update contains no changes");
            throw new RestException(Response.Status.BAD_REQUEST, "Update contains no change");
        }

        FunctionDetails functionDetails;
        File componentPackageFile = null;
        try {

            // validate parameters
            try {
                componentPackageFile = getPackageFile(
                        componentType,

View on GitHub (pinned to 820761864e)

Solutions

  1. Read the returned message to identify which config field failed validation.
  2. Resend only fields that SinkConfigUtils allows to change; keep immutable fields identical to the existing config.
  3. Fetch the current config (GET sink) and diff it against your payload before submitting.
  4. If a fundamentally different config is needed, delete and recreate the sink.

Example fix

// before: changing subscriptionPosition in an update
sinkConfig.setSubscriptionPosition(SubscriptionInitialPosition.Earliest);
// after: leave immutable fields untouched
// sinkConfig keeps existingSinkConfig.getSubscriptionPosition()
Defensive patterns

Strategy: validation

Validate before calling

SinkConfig current = admin.sinks().getSinkConfig(tenant, ns, name);
if (!Objects.equals(current.getSubscriptionName(), cfg.getSubscriptionName())) {
    throw new IllegalArgumentException("subscriptionName is immutable in update");
}

Try / catch

try {
    admin.sinks().updateSink(tenant, ns, name, cfg, null, null);
} catch (PulsarAdminException e) {
    if (e.getStatusCode() == 400) log.error("Validation rejected: " + e.getMessage());
}

Prevention

When it happens

Trigger: PUT /admin/v3/sinks/{tenant}/{namespace}/{name} with a SinkConfig that attempts an illegal update, such as changing immutable fields (subscription type/position, processing guarantees, tenant/namespace/name mismatches) relative to the existing sink.

Common situations: Changing subscriptionName or subscriptionPosition on an existing sink; trying to rename a sink via update; CI pipelines that regenerate the full config from scratch and drift immutable fields.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


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