koala73/worldmonitor · error · Error
[_markPickComplete] no run ${args.runId}
Error message
[_markPickComplete] no run ${args.runId} What it means
Thrown by _markPickComplete when no waveRuns row matches the provided runId. Like _recordPoolFilterStats, this indicates the run row is missing — the caller (pickWaveAction) should only call this after a successful pick phase on a run it already claimed. The row is created by _claimWaveRunLease at the start of the pipeline.
Source
Thrown at convex/broadcast/waveRuns.ts:602
});
/**
* Transition a `picking`-status run to `segment-created` after pickWaveAction
* has finished sampling, persisting, and creating the Resend segment.
*/
export const _markPickComplete = internalMutation({
args: {
runId: v.string(),
segmentId: v.string(),
totalCount: v.number(),
underfilled: v.boolean(),
},
handler: async (ctx, args) => {
const run = await ctx.db
.query("waveRuns")
.withIndex("by_runId", (q) => q.eq("runId", args.runId))
.unique();
if (!run) throw new Error(`[_markPickComplete] no run ${args.runId}`);
if (run.status !== "picking") {
throw new Error(
`[_markPickComplete] run ${args.runId} is ${run.status}, expected picking`,
);
}
const now = Date.now();
await ctx.db.patch(run._id, {
status: "segment-created",
segmentId: args.segmentId,
totalCount: args.totalCount,
underfilled: args.underfilled,
updatedAt: now,
});
return { ok: true };
},
});
/**View on GitHub (pinned to ffec79ac33)
Solutions
- Verify the runId passed to _markPickComplete matches the runId from _claimWaveRunLease in the same pickWaveAction invocation.
- Check whether discardWaveRun removed the row — if so, treat the run as cancelled and stop the pipeline.
- In tests, insert a waveRuns row with status 'picking' before calling _markPickComplete.
Defensive patterns
Strategy: validation
Prevention
- In pickWaveAction, pass the exact runId from _claimWaveRunLease to _markPickComplete.
- Do not discard the wave run while pickWaveAction is still executing.
- In tests, insert a waveRuns row with status 'picking' before calling _markPickComplete.
When it happens
Trigger: pickWaveAction calls _markPickComplete with a runId whose row was deleted mid-flight (discardWaveRun or manual DB delete). The runId passed does not match the one returned by _claimWaveRunLease. A test calls _markPickComplete without first creating the run row.
Common situations: The operator discarded the wave run while pickWaveAction was still executing. A developer refactored pickWaveAction and introduced a runId mismatch. Parallel or replayed scheduled actions reference a stale runId.
Related errors
- [_recordPoolFilterStats] no run ${args.runId}
- [_markPickComplete] run ${args.runId} is ${run.status}, expe
- [_persistPickedBatch] chunk too large: ${contacts.length} >
- REMOVED_COMPANY_IS_TERMINAL
- PRO_REQUIRED
AI-assisted analysis of koala73/worldmonitor@ffec79ac33 (2026-08-12).
Data as JSON: /api/errors/16a2cf93adbb2493.
Report an issue: GitHub.