{"record":{"id":"f76516c4fd76d69c","repo":"remotion-dev/remotion","slug":"should-not-download-a-browser-in-cloud-run-f76516","errorCode":null,"errorMessage":"Should not download a browser in Cloud Run","messagePattern":"Should not download a browser in Cloud Run","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/cloudrun/src/functions/render-still-single-thread.ts","lineNumber":109,"sourceCode":"\t\t\tenvVariables: body.envVariables,\n\t\t\tchromiumOptions: actualChromiumOptions,\n\t\t\tframe: body.frame,\n\t\t\tlogLevel: body.logLevel,\n\t\t\tbrowserExecutable: null,\n\t\t\tcancelSignal: null,\n\t\t\tindent: false,\n\t\t\ttimeoutInMilliseconds: body.delayRenderTimeoutInMilliseconds,\n\t\t\tonBrowserLog: null,\n\t\t\tonDownload: null,\n\t\t\toverwrite: true,\n\t\t\tport: null,\n\t\t\tpuppeteerInstance: null,\n\t\t\tserver: undefined,\n\t\t\toffthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,\n\t\t\toffthreadVideoThreads: body.offthreadVideoThreads,\n\t\t\tbinariesDirectory: null,\n\t\t\tonBrowserDownload: () => {\n\t\t\t\tthrow new Error('Should not download a browser in Cloud Run');\n\t\t\t},\n\t\t\tonArtifact: () => {\n\t\t\t\tthrow new Error('Emitting artifacts is not supported in Cloud Run');\n\t\t\t},\n\t\t\tchromeMode: 'headless-shell',\n\t\t\tmediaCacheSizeInBytes: body.mediaCacheSizeInBytes,\n\t\t\tonLog: RenderInternals.defaultOnLog,\n\t\t\tlicenseKey: null,\n\t\t\tisProduction: null,\n\t\t});\n\t\tLog.info({indent: false, logLevel: body.logLevel}, 'Still rendered');\n\n\t\tconst storage = new Storage();\n\n\t\tconst publicUpload = body.privacy === 'public' || !body.privacy;\n\n\t\tconst uploadedResponse = await storage\n\t\t\t.bucket(body.outputBucket)","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/functions/render-still-single-thread.ts#L91-L127","documentation":"Thrown by the renderStillOnCloudRun() server code path inside the Cloud Run service. The onBrowserDownload callback is hard-coded to throw because the deployed service image is expected to ship with a pre-installed headless Chrome shell; reaching the download path means the bundled browser is missing, misconfigured, or the render internals unexpectedly tried to fetch one. This is a fail-fast guard to prevent a slow, blocked network call inside Cloud Run.","triggerScenarios":"The Cloud Run service container's bundled Chrome/headless-shell binary is absent, has wrong permissions, or its lookup path resolves to nothing, causing @remotion/renderer to fall back to onBrowserDownload. Only reached during a still render (renderStillOnCloudRun).","commonSituations":"Using a custom or outdated service image that lacks the bundled browser; an image build step that pruned browser binaries to save space; a Chrome for Testing version mismatch in the image; running the service with a service account or filesystem layout that cannot read the bundled binary.","solutions":["Redeploy the Cloud Run service from the official @remotion/cloudrun image for your package version so the bundled headless-shell is present.","If using a custom image, ensure the headless Chrome binary is installed and the binariesDirectory path inside the container resolves correctly.","Pin the @remotion/cloudrun version so the image's bundled browser matches the renderer's expectations.","Report the issue if it reproduces on a freshly deployed official image — the bundled browser should never need downloading."],"exampleFix":"// before: custom Dockerfile strips browser binaries to shrink image\n// RUN rm -rf /root/.cache/remotion  # <-- removes bundled Chrome\n// after: keep the bundled browser layer; do not delete browser cache","handlingStrategy":"fallback","validationCode":"// Server-side guard; pre-check on the client cannot fully prevent it. Validate the image is official before deploying.\nimport pkg from '@remotion/cloudrun/package.json';\nconsole.assert(typeof pkg.version === 'string', 'cloudrun package version missing');","typeGuard":"function isOfficialImage(imageUrl: string): boolean {\n  // Official images live under the remotion-dev Artifact Registry\n  return imageUrl.includes('projects/remotion-dev/') || imageUrl.includes('regions/gcr.io/remotion-dev');\n}","tryCatchPattern":"// Unrecoverable inside a single render; signal the user to redeploy.\ntry {\n  await renderStillOnCloudRun(opts);\n} catch (err) {\n  if (err instanceof Error && err.message === 'Should not download a browser in Cloud Run') {\n    throw new Error('Service image missing bundled browser. Redeploy from the official @remotion/cloudrun image.');\n  }\n  throw err;\n}","preventionTips":["Deploy only the official Remotion Cloud Run image for your package version.","Never strip browser binaries from the service Docker image.","Pin the @remotion/cloudrun version to match the deployed service."],"tags":["cloudrun","browser","server-side","deployment","fail-fast"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}