{"record":{"id":"8a43dd86c49b5cf2","repo":"provectus/kafka-ui","slug":"schema-registry-is-not-set-for-cluster-clusterna","errorCode":null,"errorMessage":"Schema Registry is not set for cluster ${clusterName}","messagePattern":"Schema Registry is not set for cluster (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":400,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java","lineNumber":43,"sourceCode":"import reactor.core.publisher.Flux;\nimport reactor.core.publisher.Mono;\n\n@RestController\n@RequiredArgsConstructor\n@Slf4j\npublic class SchemasController extends AbstractController implements SchemasApi {\n\n  private static final Integer DEFAULT_PAGE_SIZE = 25;\n\n  private final KafkaSrMapper kafkaSrMapper = new KafkaSrMapperImpl();\n\n  private final SchemaRegistryService schemaRegistryService;\n\n  @Override\n  protected KafkaCluster getCluster(String clusterName) {\n    var c = super.getCluster(clusterName);\n    if (c.getSchemaRegistryClient() == null) {\n      throw new ValidationException(\"Schema Registry is not set for cluster \" + clusterName);\n    }\n    return c;\n  }\n\n  @Override\n  public Mono<ResponseEntity<CompatibilityCheckResponseDTO>> checkSchemaCompatibility(\n      String clusterName, String subject, @Valid Mono<NewSchemaSubjectDTO> newSchemaSubjectMono,\n      ServerWebExchange exchange) {\n    var context = AccessContext.builder()\n        .cluster(clusterName)\n        .schema(subject)\n        .schemaActions(SchemaAction.VIEW)\n        .operationName(\"checkSchemaCompatibility\")\n        .build();\n\n    return validateAccess(context).then(\n        newSchemaSubjectMono.flatMap(subjectDTO ->\n                schemaRegistryService.checksSchemaCompatibility(","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/SchemasController.java#L25-L61","documentation":"SchemasController.getCluster wraps the base cluster lookup and requires the cluster to have a Schema Registry client configured. If the cluster config lacks schemaRegistry, every schema-related endpoint (compatibility check, create/delete schema, list schemas) throws ValidationException.","triggerScenarios":"Calling any /api/clusters/{c}/schemas endpoint for a cluster whose config has no `schemaRegistry` entry (URL omitted or blank).","commonSituations":"Connecting to a plain Kafka cluster without Schema Registry installed; adding schemaRegistry under the wrong YAML level so it isn't picked up; Schema Registry host unreachable at startup so the client is not created.","solutions":["Add a schemaRegistry URL to the cluster config, e.g. schemaRegistry: http://schema-registry:8081","Verify the YAML nesting puts schemaRegistry inside the correct cluster entry","Deploy/run a Schema Registry service and confirm it's reachable from kafka-ui"],"exampleFix":"// before\nkafka:\n  clusters:\n    - name: dev\n      bootstrapServers: broker1:9092\n// after\nkafka:\n  clusters:\n    - name: dev\n      bootstrapServers: broker1:9092\n      schemaRegistry: http://schema-registry:8081","handlingStrategy":"try-catch","validationCode":"cluster_cfg = get_cluster_config(name)\nif not cluster_cfg.get('schemaRegistry'):\n    raise ValueError(f'Schema Registry not configured for {name}')","typeGuard":null,"tryCatchPattern":"try {\n  schemas = schemasApi.listSchemas(clusterName);\n} catch (ValidationException e) {\n  if (e.getMessage().contains(\"Schema Registry is not set\")) {\n    showClusterSetupHint(); // guide user to add schemaRegistry config\n  }\n}","preventionTips":["Include schemaRegistry URL whenever the cluster uses Schema Registry subjects","Disable/hide schema features in the UI for clusters without one","Health-check the schema registry endpoint at startup"],"tags":["schema-registry","configuration","rest-api","kafka"],"backgroundTag":"missing-required-config-field","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}