koala73/worldmonitor · error · Error

[resumeRamp] no ramp configured

Error message

[resumeRamp] no ramp configured

What it means

resumeRamp is a Convex internalMutation that sets broadcastRampConfig.active=true. Like the other admin mutations it reads the singleton row via loadConfig(ctx) and throws if it is absent, so resuming a non-existent ramp fails loudly instead of implying success.

Source

Thrown at convex/broadcast/rampRunner.ts:233

    return { ok: true };
  },
});

export const pauseRamp = internalMutation({
  args: {},
  handler: async (ctx) => {
    const row = await loadConfig(ctx);
    if (!row) throw new Error("[pauseRamp] no ramp configured");
    await ctx.db.patch(row._id, { active: false });
    return { ok: true, prevActive: row.active };
  },
});

export const resumeRamp = internalMutation({
  args: {},
  handler: async (ctx) => {
    const row = await loadConfig(ctx);
    if (!row) throw new Error("[resumeRamp] no ramp configured");
    if (row.killGateTripped) {
      throw new Error(
        "[resumeRamp] kill-gate is tripped; clearKillGate first after investigating.",
      );
    }
    await ctx.db.patch(row._id, { active: true });
    return { ok: true };
  },
});

export const clearKillGate = internalMutation({
  args: { reason: v.string() },
  handler: async (ctx, { reason }) => {
    const row = await loadConfig(ctx);
    if (!row) throw new Error("[clearKillGate] no ramp configured");
    if (!row.killGateTripped) {
      return { ok: true, noop: true };
    }

View on GitHub (pinned to ffec79ac33)

Solutions

  1. Preflight with getRampStatus; if {configured:false}, run initRamp before resumeRamp.
  2. If abortRamp was used, re-create the config via initRamp with the intended rampCurve and seed fields, then resume.
  3. Verify the caller targets the Convex deployment that actually holds the config row.

Example fix

// before
await ctx.runMutation(internal.broadcast.rampRunner.resumeRamp, {});

// after
const status = await ctx.runQuery(internal.broadcast.rampRunner.getRampStatus, {});
if (!status.configured) throw new Error('Cannot resume: ramp not configured. Run initRamp first.');
await ctx.runMutation(internal.broadcast.rampRunner.resumeRamp, {});
Defensive patterns

Strategy: validation

Validate before calling

// Preflight before resumeRamp
const status = await ctx.runQuery(internal.broadcast.rampRunner.getRampStatus, {});
if (!status.configured) {
  throw new Error('Ramp not configured — run initRamp before resumeRamp.');
}

Type guard

function isConfigured(s: { configured: boolean }): s is { configured: true; active: boolean; killGateTripped: boolean } {
  return s.configured === true;
}

Prevention

When it happens

Trigger: Calling resumeRamp before initRamp, after abortRamp deleted the row, or in an unseeded Convex deployment/preview.

Common situations: Staging/preview deployment never seeded; operator aborted the ramp and an automation later tries to resume it; client connected to the wrong Convex project.

Related errors


AI-assisted analysis of koala73/worldmonitor@ffec79ac33 (2026-08-12). Data as JSON: /api/errors/ef94463eba61cbb8. Report an issue: GitHub.