{"record":{"id":"a9f1f105358d3615","repo":"apache/beam","slug":"unable-to-verify-project-with-id-projectid","errorCode":null,"errorMessage":"Unable to verify project with ID ${projectId}","messagePattern":"Unable to verify project with ID (.+?)","errorType":"exception","errorClass":"RuntimeException","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":441,"sourceCode":"      } catch (Exception e) {\n        LOG.warn(\"Failed to access bucket for gcpTempLocation: {}\", tempLocation, e);\n      }\n      return false;\n    }\n\n    @VisibleForTesting\n    static ImmutableList<String> getDefaultBucketNameStubs(\n        PipelineOptions options, CloudResourceManager crmClient, String bucketNamePrefix) {\n      GcsOptions gcsOptions = options.as(GcsOptions.class);\n\n      final String projectId = gcsOptions.getProject();\n      checkArgument(!isNullOrEmpty(projectId), \"--project is a required option.\");\n\n      long projectNumber = 0L;\n      try {\n        projectNumber = getProjectNumber(projectId, crmClient);\n      } catch (IOException e) {\n        throw new RuntimeException(\"Unable to verify project with ID \" + projectId, e);\n      }\n\n      String region = DEFAULT_REGION;\n      if (!isNullOrEmpty(gcsOptions.getZone())) {\n        region = getRegionFromZone(gcsOptions.getZone());\n      }\n\n      return ImmutableList.of(bucketNamePrefix, region, String.valueOf(projectNumber));\n    }\n\n    /**\n     * Creates a default bucket or verifies the existence and proper access control of an existing\n     * default bucket. Returns the location if successful.\n     */\n    @VisibleForTesting\n    static String tryCreateDefaultBucket(PipelineOptions options, CloudResourceManager crmClient) {\n      return tryCreateDefaultBucketWithPrefix(options, crmClient, \"dataflow-staging\");\n    }","sourceCodeStart":423,"sourceCodeEnd":459,"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#L423-L459","documentation":"GcpOptions.getDefaultBucketName() verifies the project by looking up its project number via the Cloud Resource Manager API; an IOException there is wrapped as RuntimeException 'Unable to verify project with ID <projectId>'. The project ID was non-empty but could not be confirmed to exist/be accessible.","triggerScenarios":"Calling GcpOptions.getDefaultBucketName() (via bucketNameStubs) with a --project value for which getProjectNumber() throws IOException: nonexistent project ID, no CRM API permission, API not enabled, or network/auth failure.","commonSituations":"Typo in project ID; using project name instead of ID; service account lacking resourcemanager.projects.get; cloudresourcemanager.googleapis.com disabled; running off-GCP without credentials.","solutions":["Verify the project ID with `gcloud projects describe <projectId>`","Enable the Cloud Resource Manager API in the project","Grant the caller resourcemanager.projects.get (e.g. roles/viewer)","Check credentials/network so the CRM request can succeed"],"exampleFix":"// before\n--project=my-projct // typo\n// after\n--project=my-project // verified via gcloud projects describe","handlingStrategy":"validation","validationCode":"// ensure the project is resolvable before building default bucket\nString projectId = options.as(GcpOptions.class).getProject();\nif (projectId == null || projectId.isEmpty()) throw new IllegalArgumentException(\"--project required\");\n// optionally verify via gcloud or CRM API call before launching","typeGuard":null,"tryCatchPattern":"try {\n  String bucket = options.as(GcpOptions.class).getDefaultBucketName();\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Unable to verify project\")) {\n    throw new IllegalStateException(\"Check project ID, CRM API, and resourcemanager.projects.get permission\", e);\n  }\n  throw e;\n}","preventionTips":["Use exact project ID (not name/number) from `gcloud projects list`","Enable cloudresourcemanager.googleapis.com","Grant resourcemanager.projects.get to the runner identity","Set --tempLocation explicitly to avoid project-number lookup"],"tags":["gcp","project","network","api","java"],"backgroundTag":"entity-not-found","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"}