Skip to content

Commit 0bc707b

Browse files
Chore: add "project does not exist" instrunctions on troubleshooting doc (#1336)
1 parent 55a06fa commit 0bc707b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/TROUBLESHOOTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ See [GLOSSARY.md](./GLOSSARY.md).
2828
- [Error: Gitlab pipelines access denied](#gitlab-pipelines-access-denied)
2929
- [Error: Unknown project id on 4-project step context](#error-unknown-project-id-on-4-project-step-context)
3030
- [Error: Error getting operation for committing purpose for TagValue](#error-error-getting-operation-for-committing-purpose-for-tagvalue)
31+
- [The user does not have permission to access Project or it may not exist](#the-user-does-not-have-permission-to-access-project-or-it-may-not-exist)
3132
- - -
3233

3334
### Project quota exceeded
@@ -531,3 +532,44 @@ The cause of this message is that the CI/CD repository has "Limit access to this
531532

532533
Add all the projects/repositories to be used in the Terraform Example Foundation to the allow list available in
533534
`CI/CD Repo -> Settings -> CI/CD -> Token Access -> Allow CI job tokens from the following projects to access this project`.
535+
536+
### The user does not have permission to access Project or it may not exist
537+
538+
**Error message:**
539+
540+
```text
541+
Error when reading or editing GCS service account not found: googleapi: Error 400: Unknown project id: <PROJECT-ID>, invalid.
542+
The user does not have permission to access Project <PROJECT-ID> or it may not exist.
543+
```
544+
545+
**Cause:**
546+
547+
Terraform is trying to fetch or manipulate resources associated with the given project **PROJECT-ID** but the project was not created in the first execution.
548+
549+
What was created in the first execution was the project id that will be used to create the project. The project id is a composition of a fixed prefix and a random suffix.
550+
551+
Possible causes of the project creation failure in the first execution are:
552+
553+
- The user does not have Billing Account User role in the billing account
554+
- The user does not have Project Creator role in the Google Cloud organization
555+
- The user has reached the project creation quota
556+
- Terraform apply failed midway due to a timeout or an interruption, leaving the project ID generated in the state but not creating the project itself
557+
558+
**Solution:**
559+
560+
If the cause is the project creation quota issue. Follow instruction in the Terraform Example Foundation [troubleshooting](https://github.com/terraform-google-modules/terraform-example-foundation/blob/master/docs/TROUBLESHOOTING.md#billing-quota-exceeded)
561+
562+
After doing this fixes you need to force the recreation of the random suffix used in the project ID.
563+
To force the creation run
564+
565+
```bash
566+
terraform taint <RESOURCE-ID>
567+
```
568+
569+
For example
570+
571+
```
572+
terraform taint module.seed_bootstrap.module.seed_project.module.project-factory.random_id.random_project_id_suffix
573+
```
574+
575+
And try again to do the deployment.

0 commit comments

Comments
 (0)