Forward errors to user from GKE api on Kubernetes setup screen
When setting up Kubernetes on my project, I continuously received the following:
"We could not verify that one of your projects on GCP has billing enabled. Please try again."
This, eventhough my oauth and everything else was setup correctly. I initially tried setting this up a year ago on my GitLab server, but then just gave up. Today when I tried to set it up again, I was greeted wit the same error again.
Eventually, I decided to look in the Chrome dev tools Networking tab and I found that Google was spitting out the following 403 error:
"message": "Cloud Resource Manager API has not been used in project <PROJECT_ID> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=<PROJECT_ID> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
(Can't get the full JSON output anymore since it is working correctly again at the time of writing)
This error should have been forwarded to the user instead of me wasting hours figuring out why it wasn't working for me.
Update:
Got another one of those errors when selecting a project, also not forwarded to the user:
Request URL: https://content-cloudbilling.googleapis.com/v1/projects/<PROJECT_IDENTIFIER>/billingInfo
{
"error": {
"code": 403,
"message": "Cloud Billing API has not been used in project <PROJECT_ID> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbilling.googleapis.com/overview?project=<PROJECT_ID> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/cloudbilling.googleapis.com/overview?project=<PROJECT_ID>"
}
]
}
]
}
}

