{"record":{"id":"e197aa2cd14c96cb","repo":"remotion-dev/remotion","slug":"if-determining-cloudrun-url-from-servicename-regi","errorCode":null,"errorMessage":"If determining Cloudrun Url from serviceName, region must be provided","messagePattern":"If determining Cloudrun Url from serviceName, region must be provided","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/api/helpers/get-cloudrun-endpoint.ts","lineNumber":32,"sourceCode":"\tserviceName,\n\tregion,\n}: getCloudrunEndpointInput): Promise<string> => {\n\tif (!cloudRunUrl && !serviceName)\n\t\tthrow new Error('Either cloudRunUrl or serviceName must be provided');\n\tif (cloudRunUrl && serviceName)\n\t\tthrow new Error(\n\t\t\t'Either cloudRunUrl or serviceName must be provided, not both',\n\t\t);\n\n\tlet cloudRunEndpoint = '';\n\tif (cloudRunUrl) {\n\t\tvalidateCloudRunUrl(cloudRunUrl);\n\t\tcloudRunEndpoint = cloudRunUrl;\n\t}\n\n\tif (serviceName) {\n\t\tif (!region)\n\t\t\tthrow new Error(\n\t\t\t\t'If determining Cloudrun Url from serviceName, region must be provided',\n\t\t\t);\n\t\tvalidateServiceName(serviceName);\n\t\tconst validatedRegion = validateRegion(region);\n\t\tconst {uri} = await getServiceInfo({serviceName, region: validatedRegion});\n\t\tcloudRunEndpoint = uri;\n\t}\n\n\treturn cloudRunEndpoint;\n};\n","sourceCodeStart":14,"sourceCodeEnd":43,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/api/helpers/get-cloudrun-endpoint.ts#L14-L43","documentation":"Thrown by getCloudrunEndpoint() when serviceName is provided (and cloudRunUrl is not) but region is missing. The function must call getServiceInfo to resolve the URL, which requires a region to construct the fully-qualified service path.","triggerScenarios":"Calling getCloudrunEndpoint({serviceName: 'remotion-...'}) without a region field.","commonSituations":"Assuming the region can be inferred from the service name alone, or forgetting to forward region from the parent render call.","solutions":["Pass region alongside serviceName.","Validate region with validateRegion() before calling."],"exampleFix":"// before\nawait getCloudrunEndpoint({serviceName: 'remotion-4.0.0-mem2'});\n// after\nawait getCloudrunEndpoint({serviceName: 'remotion-4.0.0-mem2', region: 'us-central1'});","handlingStrategy":"validation","validationCode":"if (opts.serviceName && !opts.region) {\n  throw new Error('region required when using serviceName');\n}\nconst validated = opts.region ? validateRegion(opts.region) : undefined;\nawait getCloudrunEndpoint({...opts, region: validated});","typeGuard":"const hasRegionForServiceName = (i) =>\n  !i.serviceName || (typeof i.region === 'string' && i.region.length > 0);","tryCatchPattern":null,"preventionTips":["Always forward region from the parent render call down to endpoint resolution."],"tags":["cloudrun","gcp","region","validation","endpoint"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}