{"record":{"id":"796bb2195651245a","repo":"apache/beam","slug":"firetimestamp-unsupported-in-s","errorCode":null,"errorMessage":"FireTimestamp unsupported in %s","messagePattern":"FireTimestamp 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":366,"sourceCode":"      throw new UnsupportedOperationException(\n          String.format(\"RecordId unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public @Nullable Long currentRecordOffset(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"RecordOffset unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public Instant fireTimestamp(DoFn<InputT, OutputT> doFn) {\n      throw new UnsupportedOperationException(\n          String.format(\"FireTimestamp unsupported in %s\", getErrorContext()));\n    }\n\n    @Override\n    public CausedByDrain causedByDrain(DoFn<InputT, OutputT> doFn) {\n      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(","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java#L348-L384","documentation":"DoFnInvoker's UnsupportedInvocationBehavior throws this when a DoFn callback calls fireTimestamp() where the invocation context does not support it. Fire timestamps are available for @OnTimer and certain windowing contexts, not for arbitrary bundle/element processing callbacks; the default behavior refuses to fabricate a timestamp. The formatted context identifies the offending DoFn and callback.","triggerScenarios":"Calling context.fireTimestamp() from a @ProcessElement (non-timer) callback or bundle lifecycle callback when the DoFn is invoked with UnsupportedInvocationBehavior — e.g. direct invocation via DoFnInvokers.invokerFor(...), or a runner that has not plumbed fire timestamps.","commonSituations":"Adding fireTimestamp() to a ProcessElement method and running it in a unit test that invokes the DoFn directly; migrating timer-based logic into process-element code; a custom runner lacking fire-timestamp support in its DoFnRunner.","solutions":["Call fireTimestamp() only from @OnTimer (or other supported) callbacks; move the logic there","Use context.timestamp() on the element in @ProcessElement if you meant the element's event timestamp instead of a timer fire time","Test with TestPipeline or a runner-backed harness rather than DoFnInvokers.invokerFor(...) directly","Guard with try-catch for UnsupportedOperationException if the timestamp is optional in your pipeline"],"exampleFix":"// before\n@ProcessElement\npublic void process(ProcessContext c) {\n  Instant t = c.fireTimestamp();\n}\n// after\n@ProcessElement\npublic void process(ProcessContext c) {\n  Instant t = c.timestamp();\n}","handlingStrategy":"try-catch","validationCode":"// Call fireTimestamp() only from @OnTimer callbacks; verify callback type before use:\n// in @ProcessElement use context.timestamp(); reserve fireTimestamp() for timer callbacks only.","typeGuard":"Instant safeFireTimestamp(DoFn.OnTimerContext ctx) {\n  try { return ctx.fireTimestamp(); }\n  catch (UnsupportedOperationException e) { return null; }\n}","tryCatchPattern":"try {\n  Instant fireTs = context.fireTimestamp();\n} catch (UnsupportedOperationException e) {\n  Instant fireTs = context.timestamp(); // fall back to element timestamp where legal\n}","preventionTips":["Only call fireTimestamp() inside @OnTimer methods","Use context.timestamp() for the element/event timestamp in @ProcessElement","Test timer logic through TestPipeline so a real timer-aware runner path executes it"],"tags":["java","apache-beam","dofn","timers","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}