{"record":{"id":"4607c67305775cfa","repo":"remotion-dev/remotion","slug":"either-cloudrunurl-or-servicename-must-be-provided-4607c6","errorCode":null,"errorMessage":"Either cloudRunUrl or serviceName must be provided, not both","messagePattern":"Either cloudRunUrl or serviceName must be provided, not both","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/api/helpers/get-cloudrun-endpoint.ts","lineNumber":20,"sourceCode":"import {validateRegion} from '../../shared/validate-region';\nimport {validateServiceName} from '../../shared/validate-service-name';\nimport {getServiceInfo} from '../get-service-info';\n\nexport type getCloudrunEndpointInput = {\n\tcloudRunUrl?: string | null;\n\tserviceName?: string | null;\n\tregion?: string;\n};\n\nexport const getCloudrunEndpoint = async ({\n\tcloudRunUrl,\n\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;","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/api/helpers/get-cloudrun-endpoint.ts#L2-L38","documentation":"Thrown by getCloudrunEndpoint() when both cloudRunUrl and serviceName are provided simultaneously. The function requires exactly one identifier; providing both is ambiguous and rejected.","triggerScenarios":"Calling getCloudrunEndpoint({cloudRunUrl: 'https://...', serviceName: 'remotion-...'}) where both are truthy.","commonSituations":"A config object that carries both a cached URL and the service name, or merging two option sources without deduplication.","solutions":["Pass only one of cloudRunUrl or serviceName.","If you have both, prefer cloudRunUrl (it skips the extra getServiceInfo lookup) and drop serviceName.","Add a runtime XOR check at the call site."],"exampleFix":"// before\nawait getCloudrunEndpoint({cloudRunUrl: url, serviceName: name, region});\n// after\nawait getCloudrunEndpoint({cloudRunUrl: url, region});","handlingStrategy":"validation","validationCode":"if (opts.cloudRunUrl && opts.serviceName) {\n  throw new Error('Pass only one of cloudRunUrl or serviceName');\n}\nawait getCloudrunEndpoint(opts);","typeGuard":"const isMutuallyExclusive = (i) =>\n  !(i.cloudRunUrl && i.serviceName);","tryCatchPattern":null,"preventionTips":["Prefer passing cloudRunUrl from a cached deploy result and drop serviceName from the same object.","Use a builder that sets one field and nulls the other."],"tags":["cloudrun","gcp","validation","endpoint"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}