remotion-dev/remotion · warning

${err.message}

Error message

${err.message}

What it means

This is not a thrown exception to the caller — it is the express webhook middleware's catch-all. Any error raised during webhook signature validation or inside the onSuccess/onError/onTimeout callbacks is caught and returned as HTTP 500 with body {success:false, error:message}. The error surface that callers (the Remotion backend POSTing the webhook) see is a 500 response.

Source

Thrown at packages/lambda-client/src/express-webhook.ts:53

				signatureHeader: req.header('X-Remotion-Signature') as string,
				body: req.body,
				secret,
			});

			//  custom logic
			const payload = req.body;
			if (payload.type === 'success' && onSuccess) {
				await onSuccess(payload);
			} else if (payload.type === 'error' && onError) {
				await onError(payload);
			} else if (payload.type === 'timeout' && onTimeout) {
				await onTimeout(payload);
			}

			// send response
			res.status(200).json({success: true});
		} catch (err) {
			res.status(500).json({
				success: false,
				error: err instanceof Error ? err.message : String(err),
			});
		}
	};
}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure the webhook secret passed to renderMediaOnLambda matches the secret in expressWebhook options
  2. Make onSuccess/onError/onTimeout resilient — never let them throw (wrap their internals in try/catch and still return 200)
  3. Inspect the 500 response body's error field to identify the failing callback or signature mismatch

Example fix

// before - callback can throw
expressWebhook({ secret, onSuccess: async (p) => { await db.insert(p); } });

// after - swallow callback errors so webhook stays reliable
expressWebhook({
  secret,
  onSuccess: async (p) => {
    try { await db.insert(p); } catch (e) { console.error('cb failed', e); }
  },
});
Defensive patterns

Strategy: try-catch

Try / catch

// The middleware already catches; make callbacks resilient so it stays 200
expressWebhook({
  secret,
  onSuccess: async (p) => { try { await handleSuccess(p); } catch (e) { console.error(e); } },
});

Prevention

When it happens

Trigger: The webhook endpoint receives a request whose X-Remotion-Signature does not validate (wrong secret), or one of the user-supplied callbacks throws.

Common situations: Webhook secret in renderMediaOnLambda differs from the one configured in expressWebhook; onSuccess writes to a DB that is down; callback throws on an unexpected payload shape.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/810d62d4077f026e. Report an issue: GitHub.