{"record":{"id":"87316628aa2d5f93","repo":"googleapis/mcp-toolbox","slug":"failed-to-get-project-details-for-project-q-w","errorCode":null,"errorMessage":"failed to get project details for project %q: %w","messagePattern":"failed to get project details for project %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dataplex/dataplex.go","lineNumber":99,"sourceCode":"}\n\nfunc (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error) {\n\t// Initializes a Dataplex source\n\tclient, dataScanClient, dataProductClient, projectsClient, err := initDataplexConnection(ctx, tracer, r.Name, r.Project, r.ImpersonateServiceAccount, r.Scopes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Resolve project number\n\tproj, err := projectsClient.GetProject(ctx, &resourcemanagerpb.GetProjectRequest{\n\t\tName: \"projects/\" + r.Project,\n\t})\n\tif err != nil {\n\t\tclient.Close()\n\t\tdataScanClient.Close()\n\t\tdataProductClient.Close()\n\t\tprojectsClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to get project details for project %q: %w\", r.Project, err)\n\t}\n\tparts := strings.Split(proj.Name, \"/\")\n\tif len(parts) < 2 {\n\t\tclient.Close()\n\t\tdataScanClient.Close()\n\t\tdataProductClient.Close()\n\t\tprojectsClient.Close()\n\t\treturn nil, fmt.Errorf(\"unexpected project resource name format: %q\", proj.Name)\n\t}\n\tprojectNumberStr := parts[1]\n\tprojectNumber, err := strconv.ParseInt(projectNumberStr, 10, 64)\n\tif err != nil {\n\t\tclient.Close()\n\t\tdataScanClient.Close()\n\t\tdataProductClient.Close()\n\t\tprojectsClient.Close()\n\t\treturn nil, fmt.Errorf(\"failed to parse project number %q as int64: %w\", projectNumberStr, err)\n\t}","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dataplex/dataplex.go#L81-L117","documentation":"During Dataplex source initialization, the source resolves the configured project ID to its project resource via the Cloud Resource Manager GetProject API. This error wraps any failure from that RPC, with all four already-created clients (Catalog, DataScan, DataProduct, Projects) closed first. It indicates the project could not be fetched, most often because it does not exist or the caller lacks permission to view it.","triggerScenarios":"Config.Initialize calls projectsClient.GetProject(ctx, {Name: \"projects/<project>\"}) and the RPC returns an error: nonexistent project, typo'd project ID, disabled project, or caller lacking resourcemanager.projects.get / Viewer role.","commonSituations":"Typo in the `project` field of the toolbox YAML; using a project number where an ID is expected (or vice versa); ADC pointing to an account in a different org without access; running locally without gcloud auth application-default login; project recently deleted or billing disabled.","solutions":["Verify the project ID in the source config with `gcloud projects describe <project>` — fix typos.","Authenticate with an account that can view the project: `gcloud auth application-default login` as a member with roles/viewer (or resourcemanager.projects.get).","If using service account impersonation, confirm the target SA has Viewer on the project and you have roles/iam.serviceAccountTokenCreator on it.","Confirm the project exists and is active (not deleted/suspended) in the Cloud Console.","Check network/proxy connectivity to cloudresourcemanager.googleapis.com."],"exampleFix":"// before\nsources:\n  my-dataplex:\n    type: dataplex\n    project: my-projec-id\n// after\nsources:\n  my-dataplex:\n    type: dataplex\n    project: my-project-id","handlingStrategy":"validation","validationCode":"gcloud projects describe $PROJECT_ID >/dev/null && echo ok || echo 'project missing or inaccessible'","typeGuard":null,"tryCatchPattern":"src, err := cfg.Initialize(ctx, tracer)\nif err != nil {\n\tif strings.Contains(err.Error(), \"failed to get project details\") {\n\t\tlog.Fatalf(\"check project ID and IAM permissions: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Validate the project ID with `gcloud projects describe` before starting the toolbox.","Grant the runtime identity roles/viewer (or resourcemanager.projects.get) on the target project.","Keep project ID (not number) in the config and copy it from `gcloud config get-value project`.","Authenticate before launch: `gcloud auth application-default login`."],"tags":["gcp","project-not-found","permissions","dataplex","initialization"],"backgroundTag":"gcp-project-not-found","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}