Fiber Not Started Error

Fatal error: Uncaught FiberError: Cannot resume a fiber that is not suspended

Quick Answer

You are trying to resume a Fiber that has not been started, has already finished, or is currently running. Call start() first and only resume() after the Fiber has suspended itself.

Why This Happens

PHP 8.1 Fibers must follow a specific lifecycle: create, start, and then resume only when suspended. Calling resume() on a Fiber that has not been started yet, is already running, or has completed throws this error.

The Problem

$fiber = new Fiber(function (): void {
    echo 'Hello';
    Fiber::suspend();
    echo 'World';
});
$fiber->resume(); // Error: fiber not started

The Fix

$fiber = new Fiber(function (): void {
    echo 'Hello';
    Fiber::suspend();
    echo 'World';
});
$fiber->start();  // Runs until suspend
$fiber->resume(); // Resumes from suspend

Step-by-Step Fix

  1. 1

    Check the Fiber state

    Use $fiber->isStarted(), $fiber->isSuspended(), and $fiber->isTerminated() to check the Fiber's current state before operating on it.

  2. 2

    Call start() first

    A new Fiber must be started with start() before it can be resumed. Only call resume() after the Fiber has suspended itself.

  3. 3

    Handle Fiber completion

    Check isTerminated() before resuming to avoid trying to resume a Fiber that has already finished execution.

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free