{"record":{"id":"8bf62859db4c3b0c","repo":"remotion-dev/remotion","slug":"serveurl-error-file-filename-not-found-in-bu","errorCode":null,"errorMessage":"serveURL ERROR. File \"${fileName}\" not found in bucket \"${bucketName}\". Is your site name correct - \"${siteName}\"?","messagePattern":"serveURL ERROR\\. File \"(.+?)\" not found in bucket \"(.+?)\"\\. Is your site name correct - \"(.+?)\"\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-serveurl.ts","lineNumber":26,"sourceCode":"\t\t\t)}`,\n\t\t);\n\t}\n\n\t// if GCP Storage URL, validate that file exists\n\tif (serveUrl.startsWith('https://storage.googleapis.com')) {\n\t\tconst cloudStorageClient = getCloudStorageClient();\n\n\t\tconst bucketName = serveUrl.split('/')[3];\n\t\tconst fileName = serveUrl.split('/').slice(4).join('/');\n\t\tconst siteName = serveUrl.split('/')[5];\n\n\t\tconst [exists] = await cloudStorageClient\n\t\t\t.bucket(bucketName)\n\t\t\t.file(fileName)\n\t\t\t.exists();\n\n\t\tif (!exists) {\n\t\t\tthrow new Error(\n\t\t\t\t`serveURL ERROR. File \"${fileName}\" not found in bucket \"${bucketName}\". Is your site name correct - \"${siteName}\"?`,\n\t\t\t);\n\t\t}\n\t}\n};\n","sourceCodeStart":8,"sourceCodeEnd":32,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-serveurl.ts#L8-L32","documentation":"Thrown by validateServeUrl() when the serveUrl points into a Google Cloud Storage bucket (starts with https://storage.googleapis.com) but the referenced file does not exist. The validator splits the URL into bucket / file / siteName segments and calls the Cloud Storage client to check existence; on a miss it reports the parsed bucketName, fileName, and siteName so you can see which segment is wrong.","triggerScenarios":"Passing a GCS serveUrl whose bucket or object path is wrong, the bundle was never deployed, was deployed under a different site name, or the authenticated account lacks permission to list the object (which can also report not-exists).","commonSituations":"Site name mismatch between deploy and render; the serve bundle was deleted or deployed to a different bucket; a copy/paste error in the URL; GCS permissions making the object invisible to the caller.","solutions":["Re-deploy the serve bundle to the GCS site and confirm the URL with `gsutil ls`.","Compare the bucket and object path in the error against what `deploySite` / `deployService` reported.","Verify the authenticated credentials have storage.objects.get / list on that bucket.","If the site name is wrong, redeploy with the correct siteName and use the returned URL."],"exampleFix":"// before\nrenderMediaOnCloudRun({\n  serveUrl: 'https://storage.googleapis.com/my-bucket/wrong-site/index.html',\n  ...,\n});\n\n// after\n// redeploy with correct site name, then use the returned URL\nconst {url} = await deploySite({ ... });\nrenderMediaOnCloudRun({ serveUrl: url, ... });","handlingStrategy":"try-catch","validationCode":"const parsed = new URL(serveUrl);\nif (parsed.protocol !== 'https:') throw new Error('serveUrl must be https');\n// Optionally pre-check existence with your own GCS client before rendering.","typeGuard":"const isGcsUrl = (v: unknown): v is string =>\n  typeof v === 'string' &&\n  v.startsWith('https://storage.googleapis.com/');","tryCatchPattern":"try {\n  await renderMediaOnCloudRun({ serveUrl, ... });\n} catch (err) {\n  if (err instanceof Error && /serveURL ERROR\\. File .* not found/.test(err.message)) {\n    // redeploy the serve bundle, then retry with the new URL\n  } else throw err;\n}","preventionTips":["Use the exact URL returned by deploySite()/deployService().","Verify the object with `gsutil ls <url>` before rendering.","Ensure the render credentials have storage.objects.get on the bucket."],"tags":["cloudrun","gcs","network","deployment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}