{"record":{"id":"4deeb55c27c69d6e","repo":"provectus/kafka-ui","slug":"dynamic-config-change-is-not-allowed-set-dynamic","errorCode":null,"errorMessage":"Dynamic config change is not allowed. Set dynamic.config.enabled property to 'true' to enabled it.","messagePattern":"Dynamic config change is not allowed\\. Set dynamic\\.config\\.enabled property to 'true' to enabled it\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":400,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/DynamicConfigOperations.java","lineNumber":165,"sourceCode":"    }\n\n    return file.transferTo(targetFilePath)\n        .thenReturn(targetFilePath)\n        .doOnError(th -> log.error(\"Error uploading file {}\", targetFilePath, th))\n        .onErrorMap(th -> new FileUploadException(targetFilePath, th));\n  }\n\n  public void checkIfFilteringGroovyEnabled() {\n    if (!filteringGroovyEnabled()) {\n      throw new ValidationException(\n              \"Groovy filters is not allowed. \"\n                      + \"Set filtering.groovy.enabled property to 'true' to enabled it.\");\n    }\n  }\n\n  private void checkIfDynamicConfigEnabled() {\n    if (!dynamicConfigEnabled()) {\n      throw new ValidationException(\n          \"Dynamic config change is not allowed. \"\n              + \"Set dynamic.config.enabled property to 'true' to enabled it.\");\n    }\n  }\n\n  @SneakyThrows\n  private void writeYamlToFile(String yaml, Path path) {\n    if (Files.isDirectory(path)) {\n      throw new ValidationException(\"Dynamic file path is a directory, but should be a file path\");\n    }\n    if (!Files.exists(path.getParent())) {\n      Files.createDirectories(path.getParent());\n    }\n    if (Files.exists(path) && !Files.isWritable(path)) {\n      throw new ValidationException(\"File already exists and is not writable\");\n    }\n    try {\n      Files.writeString(","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/DynamicConfigOperations.java#L147-L183","documentation":"checkIfDynamicConfigEnabled() gates the entire dynamic-config feature (viewing and persisting runtime properties). The feature is opt-in via `dynamic.config.enabled=true`; when it is off, any dynamic config read/write call throws this ValidationException before doing any work.","triggerScenarios":"Calling dynamic config endpoints (getCurrentProperties, persist, uploadConfigRelatedFile) when the application was started without `dynamic.config.enabled: true` / env var DYNAMIC_CONFIG_ENABLED=true.","commonSituations":"Default deployment without the flag, then an admin tries to change config from the UI; container image where the env var was dropped during a config refactor.","solutions":["Set `dynamic.config.enabled: true` in application.yml (or DYNAMIC_CONFIG_ENABLED=true env var) and restart kafka-ui","If runtime config changes are intentionally disabled, make the change in the application config file and restart instead","Verify the property is under the top-level kafka-ui config, not nested incorrectly"],"exampleFix":"// before\n# dynamic config not mentioned\n// after\ndynamic:\n  config:\n    enabled: true","handlingStrategy":"validation","validationCode":"if (!dynamicConfigEnabled) {\n  throw new IllegalStateException(\"Set dynamic.config.enabled=true to use dynamic config endpoints\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  dynamicConfigOperations.persist(props);\n} catch (ValidationException e) {\n  if (e.getMessage().contains(\"Dynamic config\")) {\n    // guide user to enable the flag or apply config via file + restart\n  }\n}","preventionTips":["Enable the flag in the values file if operators expect runtime config changes","Otherwise remove UI links to dynamic config to avoid user confusion","Check the flag in smoke tests before releasing the UI"],"tags":["configuration","feature-flag","dynamic-config"],"backgroundTag":"feature-not-enabled","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"}