{"record":{"id":"1aaf3553e7a9efb7","repo":"temporalio/temporal","slug":"reset-point-for-v-points-to-previous-run-and-curr","errorCode":null,"errorMessage":"Reset point for %v points to previous run and CurrentRunOnly is set","messagePattern":"Reset point for (.+?) points to previous run and CurrentRunOnly is set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/worker/batcher/activities.go","lineNumber":1177,"sourceCode":"\tbuildId string,\n\tcurrentRunOnly bool,\n) (workflowTaskEventID int64, err error) {\n\tres, err := frontendClient.DescribeWorkflowExecution(ctx, &workflowservice.DescribeWorkflowExecutionRequest{\n\t\tNamespace: namespaceStr,\n\t\tExecution: execution,\n\t})\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tresetPoints := res.GetWorkflowExecutionInfo().GetAutoResetPoints().GetPoints()\n\tfor _, point := range resetPoints {\n\t\tif point.BuildId == buildId {\n\t\t\tif !point.Resettable {\n\t\t\t\treturn 0, fmt.Errorf(\"Reset point for %v is not resettable\", buildId)\n\t\t\t} else if point.ExpireTime != nil && point.ExpireTime.AsTime().Before(time.Now()) {\n\t\t\t\treturn 0, fmt.Errorf(\"Reset point for %v is expired\", buildId)\n\t\t\t} else if execution.RunId != point.RunId && currentRunOnly {\n\t\t\t\treturn 0, fmt.Errorf(\"Reset point for %v points to previous run and CurrentRunOnly is set\", buildId)\n\t\t\t}\n\t\t\texecution.RunId = point.RunId\n\t\t\treturn point.FirstWorkflowTaskCompletedId, nil\n\t\t}\n\t}\n\treturn 0, fmt.Errorf(\"Can't find reset point for %v\", buildId)\n}\n","sourceCodeStart":1159,"sourceCodeEnd":1185,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/worker/batcher/activities.go#L1159-L1185","documentation":"getResetPoint found the reset point for the given BuildId, but the point's RunId differs from the target execution's RunId while the currentRunOnly option is set. The library refuses to reset across runs when the caller restricted the operation to the current run.","triggerScenarios":"Invoking getResetEventIDByOptions/getResetPoint with CurrentRunOnly=true for a buildId whose auto-reset point was recorded on a previous run of the same workflow (execution.RunId != point.RunId).","commonSituations":"Workflows that continued-as-new after the bad deployment: the reset point belongs to an older run, and tooling that passes CurrentRunOnly fails; mismatched RunId because callers cache the original execution's RunId after the workflow has continued on a new run.","solutions":["Set CurrentRunOnly=false in the reset options to allow resetting to a point in a previous run.","Pass the RunId of the run that actually recorded the reset point (the point's RunId) as the target execution.","Use the ResetWorkflow API's ability to reset across runs (it creates a new run continuing from the old point) instead of run-restricted batch reset.","If run restriction is required, first find a reset point recorded within the current run."],"exampleFix":"// before\nid, err := getResetEventIDByOptions(ctx, exec, &ResetOptions{BuildId: buildId, CurrentRunOnly: true})\n// after\nid, err := getResetEventIDByOptions(ctx, exec, &ResetOptions{BuildId: buildId, CurrentRunOnly: false})","handlingStrategy":"validation","validationCode":"// ensure the point belongs to the current run when CurrentRunOnly is set\nif opts.CurrentRunOnly {\n  for _, p := range info.GetAutoResetPoints().GetPoints() {\n    if p.GetBuildId() == buildId && p.GetRunId() != currentRunID {\n      return fmt.Errorf(\"point for %s is on run %s; unset CurrentRunOnly\", buildId, p.GetRunId())\n    }\n  }\n}","typeGuard":"func pointInCurrentRun(p *deploymentpb.ResetPoint, runID string) bool {\n  return p.GetRunId() == runID\n}","tryCatchPattern":"if err := doReset(ctx, exec, buildId); err != nil {\n  if strings.Contains(err.Error(), \"points to previous run\") {\n    return doReset(ctx, exec, buildId) // retry without CurrentRunOnly\n  }\n  return err\n}","preventionTips":["Only set CurrentRunOnly when you know the bad deployment ran within the current run.","Fetch the point's RunId and target that run explicitly if cross-run reset is acceptable.","Be aware continue-as-new moves reset points to previous runs.","Refresh execution RunId from DescribeWorkflowExecution rather than caching it."],"tags":["go","reset","run-id","worker-versioning"],"backgroundTag":"reset-point-run-mismatch","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}