{"record":{"id":"23649959c81be3a4","repo":"apache/beam","slug":"afterprocessingtime-trigger-set-without-a-delay-or-alignment","errorCode":null,"errorMessage":"AfterProcessingTime trigger set without a delay or alignment.","messagePattern":"AfterProcessingTime trigger set without a delay or alignment\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":1326,"sourceCode":"\tcase *trigger.AfterAnyTrigger:\n\t\treturn &pipepb.Trigger{\n\t\t\tTrigger: &pipepb.Trigger_AfterAny_{\n\t\t\t\tAfterAny: &pipepb.Trigger_AfterAny{\n\t\t\t\t\tSubtriggers: extractSubtriggers(t.SubTriggers()),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\tcase *trigger.AfterAllTrigger:\n\t\treturn &pipepb.Trigger{\n\t\t\tTrigger: &pipepb.Trigger_AfterAll_{\n\t\t\t\tAfterAll: &pipepb.Trigger_AfterAll{\n\t\t\t\t\tSubtriggers: extractSubtriggers(t.SubTriggers()),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\tcase *trigger.AfterProcessingTimeTrigger:\n\t\tif len(t.TimestampTransforms()) == 0 {\n\t\t\tpanic(\"AfterProcessingTime trigger set without a delay or alignment.\")\n\t\t}\n\t\ttts := []*pipepb.TimestampTransform{}\n\t\tfor _, tt := range t.TimestampTransforms() {\n\t\t\tvar ttp *pipepb.TimestampTransform\n\t\t\tswitch tt := tt.(type) {\n\t\t\tcase trigger.DelayTransform:\n\t\t\t\tttp = &pipepb.TimestampTransform{\n\t\t\t\t\tTimestampTransform: &pipepb.TimestampTransform_Delay_{\n\t\t\t\t\t\tDelay: &pipepb.TimestampTransform_Delay{DelayMillis: tt.Delay},\n\t\t\t\t\t}}\n\t\t\tcase trigger.AlignToTransform:\n\t\t\t\tttp = &pipepb.TimestampTransform{\n\t\t\t\t\tTimestampTransform: &pipepb.TimestampTransform_AlignTo_{\n\t\t\t\t\t\tAlignTo: &pipepb.TimestampTransform_AlignTo{\n\t\t\t\t\t\t\tPeriod: tt.Period,\n\t\t\t\t\t\t\tOffset: tt.Offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t}}","sourceCodeStart":1308,"sourceCodeEnd":1344,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L1308-L1344","documentation":"An AfterProcessingTime trigger must be configured with at least one timestamp transform (a delay or a repeat/alignment). A trigger with no transforms has no meaningful firing semantics in the portable representation, so makeTrigger panics.","triggerScenarios":"Constructing trigger.NewAfterProcessingTimeTrigger() with no calls to Delay/AlignTo/RepeatAtIndex-style transforms and marshaling the windowing strategy via MarshalWindowingStrategy/makeTrigger (including nested subtriggers).","commonSituations":"Building triggers programmatically and forgetting the Delay(...) call; constructing an empty trigger then adding subtriggers only; refactor dropping the delay configuration.","solutions":["Configure the trigger with trigger.Delay(...) (e.g. AfterProcessingTime().Delay(10*time.Second)) or an alignment transform","Add at least one TimestampTransform before running the pipeline","Check trigger construction helpers to ensure transforms are appended"],"exampleFix":"// before\nt := trigger.NewAfterProcessingTimeTrigger()\n// after\nt := trigger.NewAfterProcessingTimeTrigger().Delay(10 * time.Second)","handlingStrategy":"validation","validationCode":"t := trigger.NewAfterProcessingTimeTrigger()\nif len(t.TimestampTransforms()) == 0 { return errors.New(\"AfterProcessingTime trigger needs a delay or alignment\") }","typeGuard":null,"tryCatchPattern":"defer func() { if r := recover(); r != nil { err = fmt.Errorf(\"trigger marshaling: %v\", r) } }()","preventionTips":["Always chain .Delay(...) or alignment when creating AfterProcessingTime triggers","Validate triggers before building the pipeline","Centralize trigger construction in helper functions"],"tags":["go","apache-beam","trigger","windowing","panic"],"backgroundTag":"missing-required-argument","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"}