{"record":{"id":"8610702971a9c5a2","repo":"apache/beam","slug":"timerid-unsupported-in-s","errorCode":null,"errorMessage":"TimerId unsupported in %s","messagePattern":"TimerId unsupported in (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java","lineNumber":384,"sourceCode":"      throw new UnsupportedOperationException(\n          String.format(\"CausedByDrain unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public ValueKind valueKind(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"ValueKind unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public String timerId(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"TimerId unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public TimeDomain timeDomain(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"TimeDomain unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public OutputReceiver<OutputT> outputReceiver(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"OutputReceiver unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public OutputReceiver<Row> outputRowReceiver(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"Row OutputReceiver unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public MultiOutputReceiver taggedOutputReceiver(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java#L366-L402","documentation":"DoFnInvoker's context-parameter base implementation throws UnsupportedOperationException for any context accessor the invoker does not support. Calling timerId() on an invoker that was not built with timer support raises \"TimerId unsupported in %s\" with an error context describing the invoker. It signals that the runner/decoration in use does not supply TimerId access, not a bug in user code per se.","triggerScenarios":"A DelegatingDoFnInvoker (or generated invoker without a TimerId factory) whose timerId(DoFn) is invoked — typically when DoFn.ProcessElement/OnTimer code calls context.timerId() but the invoker was constructed without timer context support.","commonSituations":"Running a DoFn with timers on a runner or test harness that does not populate timer context; using a hand-built invoker (e.g. DoFnInvokers.newInvoker) without binding timerId; calling timerId() outside an @OnTimer callback.","solutions":["Ensure the DoFn method accessing timerId() runs in a real timer callback context supplied by the runner","When constructing the invoker manually, pass a timerIdFactory / use an invoker implementation that supports timers","Wrap the timerId() call in a capability check or guard so it is only reached when the context actually supports timers","Check runner documentation for timer support; use a runner/DoFnTester version that supports timers"],"exampleFix":"// before\nString id = context.timerId();\n// after\nString id = (context instanceof DoFn.OnTimerContext) ? ((DoFn.OnTimerContext) context).timerId() : null;","handlingStrategy":"try-catch","validationCode":"if (context instanceof DoFn.OnTimerContext) { /* safe to use timerId */ }","typeGuard":"boolean hasTimerSupport = context instanceof DoFn.OnTimerContext;","tryCatchPattern":"try { String id = context.timerId(); } catch (UnsupportedOperationException e) { /* fall back / log unsupported */ }","preventionTips":["Only access timerId() inside @OnTimer callbacks","Use runners documented to support timers","When hand-building invokers, bind all required context factories"],"tags":["apache-beam","java","unsupported-operation","timers"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}