remotion-dev/remotion · error · Exception

Could not read progress for render {$renderId}: {$exception-

Error message

Could not read progress for render {$renderId}: {$exception->getMessage()}

What it means

PHP client error from cancelRenderOnLambda: reading and decoding renders/<renderId>/progress.json threw — the catch wraps both readProgressFromS3 (S3 get) and json_decode (JSON_THROW_ON_ERROR). So either the progress object is missing/unreadable, or its body is not valid JSON. The original exception message and chain are preserved, and the subsequent cancellationEnabled check mirrors the TS/Go clients.

Source

Thrown at packages/lambda-php/src/PHPClient.php:307

    public function getRenderProgress(string $renderId, string $bucketName, string $logLevel = "info", $forcePathStyle = false): GetRenderProgressResponse
    {
        $payload = $this->makeRenderProgressPayload($renderId, $bucketName, $logLevel, $forcePathStyle);
        $result = $this->invokeLambdaFunction($payload);
        return $this->handleLambdaResponseProgress($result);
    }

    public function cancelRenderOnLambda(string $renderId, string $bucketName): void
    {
        try {
            $progress = json_decode(
                $this->readProgressFromS3($bucketName, "renders/{$renderId}/progress.json"),
                true,
                512,
                JSON_THROW_ON_ERROR
            );
        } catch (\Throwable $exception) {
            throw new Exception("Could not read progress for render {$renderId}: {$exception->getMessage()}", 0, $exception);
        }

        if (($progress['cancellationEnabled'] ?? false) !== true) {
            throw new InvalidArgumentException(
                "Cannot cancel render {$renderId}: The render was not started with enableCancellation: true."
            );
        }

        try {
            $this->writeCancellationToS3(
                $bucketName,
                "renders/{$renderId}/cancel.json",
                json_encode(
                    ['cancelledAt' => (int) floor(microtime(true) * 1000)],
                    JSON_THROW_ON_ERROR
                )
            );
        } catch (\Throwable $exception) {

View on GitHub (pinned to 10db9de073)

Solutions

  1. Inspect the chained exception (getMessage of the previous Throwable) to separate 'object not found / access denied' from 'malformed JSON'.
  2. Confirm $renderId and bucket match the values used in startRenderOnLambda / renderMediaOnLambda.
  3. For not-found renders, treat cancellation as a no-op; for malformed JSON, verify client and deployed @remotion/lambda versions match, then re-render.

Example fix

// before
$renderId = $storedRenderId; // possibly stale
$client->cancelRenderOnLambda($renderId, $bucket);

// after: guard with getRenderProgress first, catch specific
try {
    $client->cancelRenderOnLambda($renderId, $bucket);
} catch (\Throwable $e) {
    if (str_contains($e->getMessage(), 'Could not read progress')) {
        // render already gone: nothing to cancel
        return;
    }
    throw $e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the render is still present before cancelling
try {
    $progress = $client->getRenderProgress($renderId, $bucket);
} catch (\Throwable $e) {
    // render gone: skip cancel
}

Try / catch

try {
    $client->cancelRenderOnLambda($renderId, $bucket);
} catch (Exception $e) {
    if (str_contains($e->getMessage(), 'Could not read progress')) {
        // missing/corrupt progress: treat render as finished or investigate $e->getPrevious()
        return;
    }
    throw $e;
}

Prevention

When it happens

Trigger: cancelRenderOnLambda($renderId) with an unknown render ID, wrong bucket, missing s3:GetObject permission, or a corrupt/non-JSON progress.json (the chained exception tells you which).

Common situations: Persisting render IDs across environments and cancelling against the wrong bucket; the render finished and cleanup removed progress.json; version skew between the PHP client and the deployed Lambda writing a different progress schema.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/da3aab6daead8a9f. Report an issue: GitHub.