{"record":{"id":"b546ae575d8ca12d","repo":"remotion-dev/remotion","slug":"could-not-parse-service-name-shortservicename","errorCode":null,"errorMessage":"Could not parse service name ${shortServiceName}","messagePattern":"Could not parse service name (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/api/helpers/parse-service-name.ts","lineNumber":21,"sourceCode":"import type {GcpRegion} from '../../pricing/gcp-regions';\n\nexport const getGcpParent = (region: GcpRegion) => {\n\tconst parent = `projects/${getProjectId()}/locations/${region}`;\n\treturn parent;\n};\n\nexport const parseServiceName = (\n\tfullServiceName: string,\n\tregion: GcpRegion,\n) => {\n\tconst parent = getGcpParent(region);\n\tconst shortServiceName = fullServiceName.replace(parent + '/services/', '');\n\tconst deployedRegion = fullServiceName.split('/')[3] as string;\n\n\tconst matched = shortServiceName.match(/remotion-(.*)-mem([0-9])/);\n\n\tif (!matched) {\n\t\tthrow new Error(`Could not parse service name ${shortServiceName}`);\n\t}\n\n\treturn {\n\t\tserviceName: shortServiceName,\n\t\tremotionVersion: matched[1],\n\t\tregion: deployedRegion as GcpRegion,\n\t\tconsoleUrl: makeConsoleUrl(deployedRegion as GcpRegion, shortServiceName),\n\t};\n};\n","sourceCodeStart":3,"sourceCodeEnd":31,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/api/helpers/parse-service-name.ts#L3-L31","documentation":"Thrown by parseServiceName() when the short service name does not match the expected pattern 'remotion-(.*)-mem([0-9])'. Remotion Cloud Run service names encode the Remotion version and memory tier in this exact format; a mismatch means the service was not created by the Remotion deploy flow.","triggerScenarios":"Calling getServiceInfo against a Cloud Run service whose name does not follow the remotion-<version>-mem<n> convention (e.g., a manually created service or one renamed in the console).","commonSituations":"Pointing renderMediaOnCloudRun at a custom service, a service deployed by an older/newer Remotion version with a different naming scheme, or a stale cached serviceName.","solutions":["Redeploy the service using the Remotion deploy command so it gets the canonical name.","Verify the service name matches remotion-<version>-mem<n> via gcloud run services list.","Do not manually rename Remotion-managed Cloud Run services."],"exampleFix":"// before: manually created service 'my-render-svc'\n// after: deploy through Remotion CLI\n// npx remotion cloudrun services deploy --memory=2Gi --region=us-central1","handlingStrategy":"validation","validationCode":"const REMOTION_SERVICE_RE = /remotion-(.*)-mem([0-9])/;\nif (!REMOTION_SERVICE_RE.test(serviceName)) {\n  throw new Error(`${serviceName} is not a valid Remotion Cloud Run service name`);\n}","typeGuard":"const isRemotionServiceName = (name: string): boolean =>\n  /remotion-(.*)-mem([0-9])/.test(name);","tryCatchPattern":null,"preventionTips":["Always obtain serviceName from a deploy result rather than typing it manually.","Do not rename Remotion-managed services in the GCP console."],"tags":["cloudrun","gcp","service","parsing","naming-convention"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}