{"record":{"id":"c8e44e8acf7eaf0f","repo":"micro/go-micro","slug":"run-s-not-found","errorCode":null,"errorMessage":"run %s not found","messagePattern":"run (.+?) not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"flow/steps.go","lineNumber":429,"sourceCode":"\n// Resume continues a persisted run by id, picking up at the step it\n// stopped on. Completed runs are a no-op.\nfunc (f *Flow) Resume(ctx context.Context, runID string) error {\n\tctx, cancel := f.withTimeout(ctx)\n\tdefer cancel()\n\n\tif err := validateSteps(f.opts.Steps); err != nil {\n\t\treturn err\n\t}\n\tif f.checkpoint == nil {\n\t\treturn fmt.Errorf(\"flow %s has no checkpoint configured\", f.name)\n\t}\n\trun, ok, err := f.checkpoint.Load(ctx, runID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\treturn fmt.Errorf(\"run %s not found\", runID)\n\t}\n\tif run.Status == \"done\" {\n\t\treturn nil\n\t}\n\t_, err = f.runFrom(ctx, run)\n\treturn err\n}\n\n// ResumePending resumes every checkpointed run for this flow that has not\n// completed yet, in the same oldest-first order returned by Pending.\n//\n// It is a convenience for service startup and recovery loops: after a process\n// restart, call ResumePending to drain the durable backlog without having to\n// list and resume each run manually. If any run fails again, ResumePending\n// stops and returns that run id with the error so callers can log, alert, or\n// retry later without hiding the failing run.\nfunc (f *Flow) ResumePending(ctx context.Context) (string, error) {\n\tctx, cancel := f.withTimeout(ctx)","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/flow/steps.go#L411-L447","documentation":"Resume loads the run record for the given runID from the checkpoint store. The store returns ok=false when no run with that ID exists; the library translates this into a 'run not found' error rather than silently succeeding. This distinguishes 'checkpoint store reachable but ID unknown' from store errors.","triggerScenarios":"Calling flow.Resume(ctx, runID) with a runID that was never persisted, was already deleted (e.g. DeleteOnSuccess removed it after completion), or belongs to a different checkpoint store/prefix than the one this Flow uses.","commonSituations":"Restarting a service pointed at a different or emptied store (in-memory store lost on restart); typo'd or stale runID from an old log; run already finished and cleaned up due to DeleteOnSuccess; resuming a run created by a flow with a different name so the key doesn't match.","solutions":["Verify the runID exists: list runs via ResumePending or query the checkpoint store directly before resuming.","Point the flow's Checkpoint at the same persistent store the run was originally saved to (check store address/bucket/prefix).","Use a durable store (file/db backed) instead of an in-memory one if runs must survive process restarts.","Confirm the run wasn't deleted by DeleteOnSuccess after it completed; if status was 'done', Resume would have been a no-op anyway."],"exampleFix":"// before\nerr := f.Resume(ctx, runIDFromMemory)\n\n// after\nrun, ok, err := store.Read(ctx, runID) // or check ResumePending output\nif !ok {\n  return fmt.Errorf(\"run %s is not in this checkpoint store\", runID)\n}\nerr = f.Resume(ctx, runID)","handlingStrategy":"validation","validationCode":"runs, err := f.ResumePending(ctx) // or query the store\n// verify runID appears in the pending set before resuming\nfound := slices.ContainsFunc(runs, func(r flow.Run) bool { return r.ID == runID })\nif !found {\n    return fmt.Errorf(\"run %s not present in checkpoint store\", runID)\n}","typeGuard":null,"tryCatchPattern":"if err := f.Resume(ctx, runID); err != nil {\n    var nfErr *notFoundError // or match on message\n    if strings.Contains(err.Error(), \"not found\") {\n        // look up correct runID or skip\n        return nil\n    }\n    return err\n}","preventionTips":["Persist runIDs durably (db/queue) rather than copying from logs","Use a persistent checkpoint store across restarts, not in-memory","Remember DeleteOnSuccess removes completed runs — don't resume deleted runs","Ensure all services resuming runs use the same store and key prefix"],"tags":["go","flow","checkpoint","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}