apache/pulsar · error · RestException

Can not enable for all producers but denies for replicators,

Error message

Can not enable for all producers but denies for replicators, which is meaningless

What it means

Validation in the Namespaces admin endpoint that sets isAllowAutoUpdateSchema. If auto-update-schema is being enabled for all producers (true) while the optional replicator-specific flag is explicitly set to false (deny for replicators), the combination is contradictory and rejected with HTTP 400 BAD_REQUEST.

Source

Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3082

    @Path("/{tenant}/{namespace}/isAllowAutoUpdateSchema")
    @Operation(summary = "Update flag of whether to allow auto update schema")
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "Operation successful"),
            @ApiResponse(responseCode = "403", description = "Don't have admin permission"),
            @ApiResponse(responseCode = "404", description = "Namespace doesn't exist"),
            @ApiResponse(responseCode = "409", description = "Concurrent modification")})
    public void setIsAllowAutoUpdateSchema(
            @PathParam("tenant") String tenant,
            @PathParam("namespace") String namespace,
            @QueryParam("allowAutoUpdateSchemaWithReplicator")
            @Parameter(description = "Allow replicator to auto update schema")
                    Boolean allowAutoUpdateSchemaWithReplicator,
            @RequestBody(description = "Flag of whether to allow auto update schema", required = true)
                    boolean isAllowAutoUpdateSchema) {
        validateNamespaceName(tenant, namespace);
        if (isAllowAutoUpdateSchema && allowAutoUpdateSchemaWithReplicator != null
                && !allowAutoUpdateSchemaWithReplicator) {
            throw new RestException(Response.Status.BAD_REQUEST, "Can not enable for all producers but denies for"
                    + " replicators, which is meaningless");
        }
        internalSetIsAllowAutoUpdateSchema(isAllowAutoUpdateSchema, allowAutoUpdateSchemaWithReplicator);
    }

    @GET
    @Path("/{tenant}/{namespace}/subscriptionTypesEnabled")
    @Operation(summary = "The set of enabled subscription types")
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "The set of enabled subscription types",
                    content = @Content(array = @ArraySchema(schema = @Schema(implementation = SubscriptionType.class),
                            uniqueItems = true))),
            @ApiResponse(responseCode = "403", description = "Don't have admin permission"),
            @ApiResponse(responseCode = "404", description = "Namespace doesn't exist"),
            @ApiResponse(responseCode = "409", description = "Concurrent modification") })
    public void getSubscriptionTypesEnabled(
            @Suspended final AsyncResponse asyncResponse,
            @PathParam("tenant") String tenant,

View on GitHub (pinned to 820761864e)

Solutions

  1. Either set allowAutoUpdateSchemaWithReplicator to true, or omit it (leave null) when isAllowAutoUpdateSchema=true.
  2. If replicators must be excluded while producers can update, that combination is unsupported — instead control replicator schema updates at the policy level or use a different namespace policy.
  3. Fix automation/templates so the replicator flag is only sent when it has an explicit intended value.

Example fix

// before
nsAction.setSchemaAutoUpdateStrategy(true, false);

// after
nsAction.setSchemaAutoUpdateStrategy(true, true); // or (true, null) to leave replicator flag unset
Defensive patterns

Strategy: validation

Validate before calling

if (allowAutoUpdate && Boolean.FALSE.equals(allowAutoUpdateWithReplicator)) {
    throw new IllegalArgumentException(
        "Cannot set isAllowAutoUpdateSchema=true while allowAutoUpdateSchemaWithReplicator=false");
}

Prevention

When it happens

Trigger: POST /admin/v2/namespaces/{tenant}/{namespace}/schemaAutoUpdate with body isAllowAutoUpdateSchema=true and allowAutoUpdateSchemaWithReplicator=false (query/body param) — enabling schema auto-update globally while explicitly forbidding it for replicators.

Common situations: Scripts that always send both fields with hardcoded booleans; partial config merge where a null (unset) replicator flag was accidentally materialized as false; operators wanting 'only replicators may update schema' who invert the flags.

Related errors


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