From bcdb0b6186a2979a173096e8a050cfe6c34ea27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Fri, 3 Jul 2026 15:47:02 +0200 Subject: [PATCH] fix(runner): don't set contentType on Actor.setValue with object payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The RUNNER-STARTED-AT KVS write in actors/runner/src/main.ts:238 crashes at boot with: ArgumentError: The "value" parameter must be a String, Buffer or Stream when "options.contentType" is specified. Apify SDK requires: when contentType is set, value must be a String/Buffer/Stream (pre-serialized). buildRunnerStartedPayload returns an object. Fix: drop the {contentType: 'application/json'} options argument entirely. Without options, Apify SDK auto-JSON-stringifies objects and defaults contentType to application/json — same result, no serialization mismatch. The bug was cherry-picked from PR #17 in PR #23 (EF2 v2 recovery) and only surfaced when the runner was rebuilt off main and ran an actual scenario. Co-Authored-By: Claude Opus 4.7 --- actors/runner/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actors/runner/src/main.ts b/actors/runner/src/main.ts index 294ab87..cb29032 100644 --- a/actors/runner/src/main.ts +++ b/actors/runner/src/main.ts @@ -235,7 +235,7 @@ if (apifyToken && actorRunId) { // /run-eval-scenario skill) can read the anchor without entering // the runner container. Reuse buildRunnerStartedPayload so the // KVS payload and the on-disk file cannot drift on the `source` string. - await Actor.setValue('RUNNER-STARTED-AT', buildRunnerStartedPayload(runnerStartedAt), { contentType: 'application/json' }); + await Actor.setValue('RUNNER-STARTED-AT', buildRunnerStartedPayload(runnerStartedAt)); log.info(`[runner-started] ${runnerStartedAt} (single-clock anchor for checkpoint scripts)`); } } else if (!apifyToken) {