{"record":{"id":"2e03eb6107599579","repo":"apache/druid","slug":"context-param-s-cannot-be-explicitly-set-to-fals","errorCode":null,"errorMessage":"Context param[%s] cannot be explicitly set to false when context param[%s] is set to true. Either remove the context param[%s] or explicitly set it to true.","messagePattern":"Context param\\[(.+?)\\] cannot be explicitly set to false when context param\\[(.+?)\\] is set to true\\. Either remove the context param\\[(.+?)\\] or explicitly set it to true\\.","errorType":"error_code","errorClass":"MSQException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerControllerContext.java","lineNumber":293,"sourceCode":"      final ControllerMemoryParameters memoryParameters\n  )\n  {\n    final QueryContext queryContext = querySpec.getContext();\n    final int maxConcurrentStages =\n        MultiStageQueryContext.getMaxConcurrentStagesWithDefault(queryContext, DEFAULT_MAX_CONCURRENT_STAGES);\n    final boolean isFaultToleranceEnabled = MultiStageQueryContext.isFaultToleranceEnabled(queryContext);\n    final boolean isDurableStorageEnabled;\n\n    if (isFaultToleranceEnabled) {\n      if (!queryContext.containsKey(MultiStageQueryContext.CTX_DURABLE_SHUFFLE_STORAGE)) {\n        // if context key not set, enable durableStorage automatically.\n        isDurableStorageEnabled = true;\n      } else {\n        // if context key is set, and durableStorage is turned on.\n        if (MultiStageQueryContext.isDurableStorageEnabled(queryContext)) {\n          isDurableStorageEnabled = true;\n        } else {\n          throw new MSQException(\n              UnknownFault.forMessage(\n                  StringUtils.format(\n                      \"Context param[%s] cannot be explicitly set to false when context param[%s] is\"\n                      + \" set to true. Either remove the context param[%s] or explicitly set it to true.\",\n                      MultiStageQueryContext.CTX_DURABLE_SHUFFLE_STORAGE,\n                      MultiStageQueryContext.CTX_FAULT_TOLERANCE,\n                      MultiStageQueryContext.CTX_DURABLE_SHUFFLE_STORAGE\n                  )\n              )\n          );\n        }\n      }\n    } else {\n      isDurableStorageEnabled = MultiStageQueryContext.isDurableStorageEnabled(queryContext);\n    }\n\n    return ControllerQueryKernelConfig\n        .builder()","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/IndexerControllerContext.java#L275-L311","documentation":"IndexerControllerContext.makeQueryKernelConfig rejects a query that sets the old context key CTX_DURABLE_SHUFFLE_STORAGE explicitly to false while the newer CTX_FAULT_TOLERANCE is true. The two keys must agree; a contradictory combination would make kernel durability config ambiguous, so it fails fast with UnknownFault carrying the formatted message.","triggerScenarios":"Query context contains {\"faultTolerance\": true, \"durableShuffleStorage\": false}; applications that set durableShuffleStorage=false unconditionally while another layer (BI tool, template) enables faultTolerance.","commonSituations":"Migrating queries from the legacy durableShuffleStorage flag to faultTolerance but leaving stale false values in saved dashboards or JDBC connection contexts; copy-pasted context maps combining new and old flags.","solutions":["Remove the durableShuffleStorage context key when faultTolerance is enabled","Set durableShuffleStorage explicitly to true alongside faultTolerance=true","Update saved queries/templates to use only faultTolerance going forward"],"exampleFix":"// before\nMap<String, Object> ctx = Map.of(\"faultTolerance\", true, \"durableShuffleStorage\", false);\n// after\nMap<String, Object> ctx = Map.of(\"faultTolerance\", true);","handlingStrategy":"validation","validationCode":"Object ft = ctx.get(\"faultTolerance\");\nObject ds = ctx.get(\"durableShuffleStorage\");\nif (Boolean.TRUE.equals(ft) && Boolean.FALSE.equals(ds)) {\n  throw new IllegalArgumentException(\"Remove durableShuffleStorage=false when faultTolerance=true\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on the faultTolerance context key and stop emitting durableShuffleStorage in generated contexts","Audit saved dashboards/templates for stale context flags","Centralize query-context construction in one helper"],"tags":["msq","context-params","fault-tolerance"],"backgroundTag":"conflicting-config-options","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}