{"record":{"id":"70be06ac25c6b66a","repo":"apache/beam","slug":"unable-to-get-project-number","errorCode":null,"errorMessage":"Unable to get project number","messagePattern":"Unable to get project number","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/options/GcpOptions.java","lineNumber":543,"sourceCode":"    /**\n     * Returns the project number or throws an error if the project does not exist or has other\n     * access errors.\n     */\n    private static long getProjectNumber(\n        String projectId, CloudResourceManager crmClient, BackOff backoff, Sleeper sleeper)\n        throws IOException {\n      CloudResourceManager.Projects.Get getProject = crmClient.projects().get(projectId);\n      try {\n        Project project =\n            ResilientOperation.retry(\n                getProject::execute,\n                backoff,\n                RetryDeterminer.SOCKET_ERRORS,\n                IOException.class,\n                sleeper);\n        return project.getProjectNumber();\n      } catch (Exception e) {\n        throw new IOException(\"Unable to get project number\", e);\n      }\n    }\n\n    @VisibleForTesting\n    static String getRegionFromZone(String zone) {\n      String[] zoneParts = zone.split(\"-\", -1);\n      checkArgument(zoneParts.length >= 2, \"Invalid zone provided: %s\", zone);\n      return zoneParts[0] + \"-\" + zoneParts[1];\n    }\n\n    /**\n     * Returns a CloudResourceManager client builder using the specified {@link\n     * CloudResourceManagerOptions}.\n     */\n    @VisibleForTesting\n    static CloudResourceManager.Builder newCloudResourceManagerClient(\n        CloudResourceManagerOptions options) {\n      Credentials credentials = options.getGcpCredential();","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/options/GcpOptions.java#L525-L561","documentation":"GcpOptions.getProjectNumber retries a Cloud Resource Manager projects.get call with backoff; any Exception is rethrown as IOException('Unable to get project number'). This is the low-level failure behind error 1032.","triggerScenarios":"getProjectNumber(projectId, crmClient) invoked from getDefaultBucketName; the CRM projects.get RPC fails repeatedly (403 permission denied, 404 not found, API disabled, network errors exhausting the RetryDeterminer.SOCKET_ERRORS backoff).","commonSituations":"Missing resourcemanager.projects.get; disabled Cloud Resource Manager API; wrong project ID; corporate proxy blocking googleapis.com; quota exhaustion.","solutions":["Fix the underlying CRM access: correct project ID, resourcemanager.projects.get permission, API enabled","Test with `gcloud projects describe <id>` from the same environment","Check network/proxy allows googleapis.com; retry after transient outages","Provide an explicit --tempLocation so project-number lookup is never needed"],"exampleFix":"// before\n// implicit default bucket -> getProjectNumber fails\n// after\n--tempLocation=gs://existing-bucket/temp/","handlingStrategy":"retry","validationCode":"// validate project access before pipeline start\ngcloud projects describe $PROJECT_ID  # or call CRM projects.get from the same credentials/network","typeGuard":null,"tryCatchPattern":"try {\n  String bucket = gcpOptions.getDefaultBucketName();\n} catch (IOException | RuntimeException e) {\n  if (e.getMessage() != null && (e.getMessage().contains(\"Unable to get project number\") || e.getCause() instanceof IOException)) {\n    // exponential backoff retry, then fail with guidance\n  }\n  throw e;\n}","preventionTips":["Confirm CRM API is enabled and IAM grants resourcemanager.projects.get","Run `gcloud projects describe` in the same env/network as the pipeline","Check proxy/firewall access to cloudresourcemanager.googleapis.com","Set explicit --tempLocation to bypass the lookup entirely"],"tags":["gcp","api","network","permissions","java"],"backgroundTag":"api-request-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}