{"record":{"id":"f47c015c79d716fb","repo":"apache/pulsar","slug":"window-configs-cannot-be-found","errorCode":null,"errorMessage":"Window Configs cannot be found","messagePattern":"Window Configs cannot be found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java","lineNumber":93,"sourceCode":"        if (userClassObject instanceof java.util.function.Function) {\n            Class<?>[] typeArgs = TypeResolver.resolveRawArguments(\n                    java.util.function.Function.class, userClassObject.getClass());\n            if (typeArgs[0].equals(Collection.class)) {\n                bareWindowFunction = (java.util.function.Function<Collection<T>, X>) userClassObject;\n            } else {\n                throw new IllegalArgumentException(\"Window function must take a collection as input\");\n            }\n        } else if (userClassObject instanceof WindowFunction) {\n            windowFunction = (WindowFunction<T, X>) userClassObject;\n        } else {\n            throw new IllegalArgumentException(\"Window function does not implement the correct interface\");\n        }\n    }\n\n    private WindowConfig getWindowConfigs(Context context) {\n\n        if (!context.getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY).isPresent()) {\n            throw new IllegalArgumentException(\"Window Configs cannot be found\");\n        }\n        WindowConfig windowConfig = new Gson().fromJson(\n                (new Gson().toJson(context.getUserConfigValue(WindowConfig.WINDOW_CONFIG_KEY).get())),\n                WindowConfig.class);\n\n        return windowConfig;\n    }\n\n    private WindowManager<Record<T>> getWindowManager(WindowConfig windowConfig, Context context) {\n\n        WindowLifecycleListener<Event<Record<T>>> lifecycleListener = newWindowLifecycleListener(context);\n        WindowManager<Record<T>> manager = new WindowManager<>(lifecycleListener, new ConcurrentLinkedQueue<>());\n\n        if (this.windowConfig.getTimestampExtractorClassName() != null) {\n            this.timestampExtractor = getTimeStampExtractor(windowConfig);\n\n            waterMarkEventGenerator = new WaterMarkEventGenerator<>(manager, this.windowConfig\n                    .getWatermarkEmitIntervalMs(),","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/windowing/WindowFunctionExecutor.java#L75-L111","documentation":"The WindowFunctionExecutor requires window configuration (WindowConfig) to be supplied under the user config key WINDOW_CONFIG_KEY. getWindowConfigs throws this IllegalArgumentException when the function's user config map does not contain that key. Without window parameters (window length, sliding interval, etc.) the executor cannot construct a WindowManager, so initialization fails immediately.","triggerScenarios":"Deploying a windowed function whose userConfig omits the WINDOW_CONFIG_KEY entry (JSON key \"windowConfig\" / WindowConfig.WINDOW_CONFIG_KEY), or supplying an empty/incorrectly named user config map.","commonSituations":"Deploying a normal (non-windowed) function definition against the windowing executor; typos in the config key; CLI/REST deployment that drops userConfig; serializing window config under the wrong field.","solutions":["Add the window config to the function's user config, e.g. userConfig: { \"windowConfig\": { \"windowLengthDurationMs\": 60000, \"slidingIntervalDurationMs\": 30000 } }","Verify with `pulsar-admin functions get` that userConfig contains the windowConfig key","If the function should not be windowed, redeploy it as a regular function instead of a windowed one","Recreate the function with the full config if a CLI update silently dropped userConfig"],"exampleFix":"// before\npulsar-admin functions create --name wf --inputs in --functionConfig '{\"inputTopics\":[\"in\"]}'\n// after\npulsar-admin functions create --name wf --inputs in \\\n  --customSerDeInputs ... \\\n  --userConfig '{\"windowConfig\":{\"windowLengthDurationMs\":60000,\"slidingIntervalDurationMs\":30000}}'","handlingStrategy":"validation","validationCode":"Map<String, Object> uc = config.getUserConfig();\nif (uc == null || !uc.containsKey(\"windowConfig\")) {\n    throw new IllegalArgumentException(\"userConfig must contain windowConfig with windowLengthDurationMs etc.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    executor.initialize();\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"missing window config in userConfig: \" + e.getMessage(), e);\n}","preventionTips":["Always include the windowConfig block when deploying windowed functions","Validate the deployment with `pulsar-admin functions get` before starting","Keep a deployment template with the required windowConfig fields"],"tags":["pulsar-functions","windowing","missing-config"],"backgroundTag":"missing-required-config","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}