Join our community of builders on Discord!

Stuck Jobs

Normally, deregister reverting with ActiveJobsExist just means you need to wait — the release scheduler settles your completed jobs and the count ticks down on its own. That flow is covered in Drain & Graceful Exit. This page is for the case where waiting doesn't work. If your active job count has been frozen at the same number for days, you have jobs stuck in an earlier state that the release scheduler cannot touch, and your stake stays locked until you clear them by hand.
Clearing a stuck job applies the protocol's timeout penalty to your stake. Read What it costs before running anything — for some workers this is a few percent, for others it's the whole stake.

Why waiting doesn't help

A job moves SubmittedAcknowledgedCompleted, and only a Completed job can be settled with releaseJob. That's all the release scheduler does. If your worker went offline (or crashed, or lost its keys) part-way through a job, that job is frozen in Submitted or Acknowledged and will never reach Completed — the deadline to finish it has already passed. The scheduler skips it forever, the registry keeps counting it as active, and deregister keeps reverting. The only way to clear a frozen job is claimTimeout, which marks it timed out. Anyone can call it, but the penalty always applies to the worker that held the job.

Am I affected?

CodeBASH
  • 0 — nothing is stuck. You can deregister right now, no penalty.
  • Above 0 and dropping over time — normal settlement. Use Drain & Graceful Exit instead.
  • Above 0 and unchanged for days — you're in the right place. Continue below.

What it costs

The penalty is a fixed amount per stuck job, set by governance on AIConfig and calculated from the minimum worker stake:
Job statePenalty per job
Submitted — assigned, never started1,000 LCAI
Acknowledged — started, never finished2,500 LCAI
Three things that matter when you're deciding:
  • You can never lose more than your stake. Each penalty is capped at whatever you have left, so once your stake reaches zero, further clears cost nothing.
  • The order doesn't matter. Every job's penalty is a fixed amount, so your total is the same regardless of which you clear first.
  • Your earnings are safe. Penalties only ever touch staked funds — never the balance you've earned from completed jobs.
To confirm the current values for your network:
CodeBASH
The penalty is minWorkerStake × bps ÷ 10000.

Find your stuck jobs and your total cost

There's no "list my jobs" call on-chain, so this walks every job in the registry and reports only the ones that belong to you. It reads the job count from the chain, so it always covers the full range. It takes a few minutes and only reads — it changes nothing.
CodeBASH
Compare that total against your stake:
CodeBASH

Decide before you clear

If the cost is a small share of your stake — go ahead, the steps below take a few minutes. If the cost would take most or all of your stakestop and contact the team before running anything. Many of these stuck jobs come from earlier infrastructure problems that were not the operator's fault, and burning your whole stake to exit is rarely the right trade. Reach out first and describe your situation.

Clearing and exiting

1. Withdraw your earnings first

Penalties can't reach your earnings, but bank them now so nothing is left behind.
CodeBASH
Skip the second command if the balance is 0.

2. Clear each stuck job

Use the job IDs from the scan above:
CodeBASH

3. Confirm your count reached zero

CodeBASH
If it still isn't 0, the remainder are ordinary completed jobs waiting out the dispute window. Those are free to settle — see Drain & Graceful Exit, or clear them directly once their window has passed:
CodeBASH

4. Deregister

CodeBASH
Your remaining stake is returned to your worker address in the same transaction.

Things to know

  • Your worker will show as suspended after clearing jobs, and that's fine. Timeout penalties count as offenses, so clearing several will suspend you. Suspension does not block deregistration — step 4 works regardless.
  • claimTimeout is permissionless. Anyone can call it on any timed-out job, and the penalty still lands on the worker that held it. You don't have to call it from your worker key, though it's simplest to.
  • Failed calls cost nothing but gas. If claimTimeout reverts with NotTimedOut, that job's deadline hasn't passed yet — wait and retry. No state changes on a revert.
  • Clearing is one-way. A timed-out job can't be un-timed-out, and the penalty isn't refundable. This is why the cost check comes first.

Preventing it next time

Stuck jobs happen when a worker disappears mid-job. To avoid repeating this:
  • Follow Drain & Graceful Exit when retiring a worker — draining stops new jobs from being routed to you before you stop the process, so nothing is left half-finished.
  • Don't docker rm a worker that still has obligations on-chain.
  • If your worker crashes, bring it back up promptly. A job only freezes once its deadline passes.