{"record":{"id":"21175804950d32b9","repo":"remotion-dev/remotion","slug":"version-mismatch-when-calling-rendermediaoncloudr-211758","errorCode":null,"errorMessage":"Version mismatch: When calling renderMediaOnCloudRun(), you called a service, which has the version ${VERSION}, but the @remotion/cloudrun package you used to invoke the function has version ${body.clientVersion}. Deploy a new service and use it to call renderMediaOnCloudrun().","messagePattern":"Version mismatch: When calling renderMediaOnCloudRun\\(\\), you called a service, which has the version (.+?), but the @remotion/cloudrun package you used to invoke the function has version (.+?)\\. Deploy a new service and use it to call renderMediaOnCloudrun\\(\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/functions/render-media-single-thread.ts","lineNumber":35,"sourceCode":"} from './helpers/payloads';\nimport {writeCloudrunError} from './helpers/write-cloudrun-error';\n\nexport const renderMediaSingleThread = async (\n\tbody: CloudRunPayloadType,\n\tres: ff.Response,\n) => {\n\tif (body.type !== 'media') {\n\t\tthrow new Error('expected type media');\n\t}\n\n\tif (body.clientVersion !== VERSION) {\n\t\tif (!body.clientVersion) {\n\t\t\tthrow new Error(\n\t\t\t\t`Version mismatch: When calling renderMediaOnCloudRun(), you called a service which has the version ${VERSION} but the @remotion/cloudrun package is an older version. Deploy a new service with matchin version and use it to call renderMediaOnCloudRun().`,\n\t\t\t);\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t`Version mismatch: When calling renderMediaOnCloudRun(), you called a service, which has the version ${VERSION}, but the @remotion/cloudrun package you used to invoke the function has version ${body.clientVersion}. Deploy a new service and use it to call renderMediaOnCloudrun().`,\n\t\t);\n\t}\n\n\tconst renderId = body.renderIdOverride ?? randomHash({randomInTests: true});\n\n\ttry {\n\t\tconst composition = await getCompositionFromBody(body);\n\n\t\tconst defaultOutName = `out.${RenderInternals.getFileExtensionFromCodec(\n\t\t\tbody.codec,\n\t\t\tbody.audioCodec,\n\t\t)}`;\n\t\tconst tempFilePath = `/tmp/${defaultOutName}`;\n\n\t\tlet previousProgress = 0.02;\n\t\tlet lastWebhookProgress = 0;\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/functions/render-media-single-thread.ts#L17-L53","documentation":"Thrown server-side by renderMediaSingleThread() when body.clientVersion is present but does not match the deployed service's VERSION. The service and the @remotion/cloudrun client must be on the same version to guarantee API compatibility.","triggerScenarios":"A render request carries body.clientVersion = X but the deployed service runs VERSION = Y (X !== Y).","commonSituations":"Upgrading @remotion/cloudrun in the client without redeploying the Cloud Run service, or deploying a new service while an old client invokes it.","solutions":["Redeploy the Cloud Run service: npx remotion cloudrun services deploy.","Align client and service versions: npm install @remotion/cloudrun@<service-version>.","Run npx remotion cloudrun services ls to inspect deployed versions."],"exampleFix":"// before: client is 5.0.0, service is 4.0.0\n// after: redeploy to match client\nnpx remotion cloudrun services deploy --region=us-central1\n// or pin client to service version\nnpm install @remotion/cloudrun@4.0.0","handlingStrategy":"validation","validationCode":"import {VERSION} from '@remotion/cloudrun';\nconst services = await listServices(region);\nconst matching = services.find(s => parseServiceName(s).remotionVersion === VERSION);\nif (!matching) throw new Error('No service matching client version ' + VERSION);","typeGuard":null,"tryCatchPattern":"try {\n  await renderMediaOnCloudRun({serviceName, region, ...});\n} catch (e) {\n  if (e.message.startsWith('Version mismatch')) {\n    // redeploy service or pin client version\n  }\n  throw e;\n}","preventionTips":["Redeploy the Cloud Run service whenever you bump @remotion/cloudrun.","Pin client and service to the same version in CI.","Use `remotion cloudrun services ls` to audit deployed versions."],"tags":["cloudrun","gcp","version-mismatch","render","compatibility"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}