{"record":{"id":"f23920ca3c304d77","repo":"remotion-dev/remotion","slug":"no-permissions-returned-from-the-testiampermission","errorCode":null,"errorMessage":"No permissions returned from the testIamPermissions call.","messagePattern":"No permissions returned from the testIamPermissions call\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/api/iam-validation/testPermissions.ts","lineNumber":51,"sourceCode":"\t\tfs.readFileSync(\n\t\t\tpath.join(__dirname, '../../shared/sa-permissions.json'),\n\t\t\t'utf-8',\n\t\t),\n\t);\n\n\tconst permissionList: string[] = saPermissions.list.map(\n\t\t(permission: {name: string; reason: string}) => permission.name,\n\t);\n\n\tconst response = await resourceManagerClient.testIamPermissions({\n\t\tresource: `projects/${getProjectId()}`,\n\t\tpermissions: permissionList,\n\t});\n\n\tconst returnedPermissions = response[0].permissions;\n\n\tif (!returnedPermissions) {\n\t\tthrow new Error(\n\t\t\t'No permissions returned from the testIamPermissions call.',\n\t\t);\n\t}\n\n\tconst results: TestResult[] = [];\n\n\tsaPermissions.list.forEach((permission: {name: string; reason: string}) => {\n\t\tif (returnedPermissions.includes(permission.name)) {\n\t\t\tconst thisResult = {decision: true, permissionName: permission.name};\n\t\t\tresults.push(thisResult);\n\t\t\tparams?.onTest(thisResult);\n\t\t} else {\n\t\t\tconst thisResult = {decision: false, permissionName: permission.name};\n\t\t\tresults.push(thisResult);\n\t\t\tparams?.onTest(thisResult);\n\t\t}\n\t});\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/api/iam-validation/testPermissions.ts#L33-L69","documentation":"Thrown by testPermissions() when the Resource Manager testIamPermissions call returns no permissions array. This is an abnormal GCP API response: a successful call should always return a permissions array (possibly empty). A missing array signals an API or auth problem rather than a permissions failure.","triggerScenarios":"Calling testPermissions() where response[0].permissions is undefined/null after resourceManagerClient.testIamPermissions() resolves.","commonSituations":"GCP API version mismatch, expired or misconfigured Application Default Credentials, or an unexpected transient API error returning a malformed response.","solutions":["Re-run gcloud auth application-default login to refresh credentials.","Verify the project ID from getProjectId() is correct.","Retry the call; if persistent, check GCP status and IAM API availability.","Ensure the Resource Manager API is enabled in the project."],"exampleFix":"// no code fix; this is a GCP environment/auth issue\n// run: gcloud auth application-default login\n// then retry testPermissions()","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for (let attempt = 0; attempt < 3; attempt++) {\n  try {\n    return await testPermissions({region, onTest});\n  } catch (e) {\n    if (e.message.includes('No permissions returned') && attempt < 2) continue;\n    throw e;\n  }\n}","preventionTips":["Keep Application Default Credentials fresh: gcloud auth application-default login.","Enable the Resource Manager API in the target project.","Retry transient GCP API anomalies before surfacing the error."],"tags":["cloudrun","gcp","iam","permissions","auth"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}