serverless / serverless-google-cloudfunctions

Serverless Google Cloud Functions Plugin – Adds Google Cloud Functions support to the Serverless Framework
https://www.serverless.com
MIT License
271 stars 127 forks source link

Error: Deployment failed: RESOURCE_ERROR #246

Open Lusitaniae opened 3 years ago

Lusitaniae commented 3 years ago

I think we should improve error logging, I spend hours looking at these errors below and its completely useless.

Debug/verbose mode shows no useful information.

Finally I look at deployment manager and see the issue (from looking at the resulting template), a wrong region.

Instead of using GCP region name, I was writing AWS region name.

But this doesn't come anywhere in the logs and I completely missed it.

  Error --------------------------------------------------

  Error: Not Found
      at Gaxios._request (/builds/trueid-intrend/trueid-serverless-cicd/services/data-analysis/node_modules/googleapis-common/node_modules/gaxios/src/gaxios.ts:140:15)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at JWT.requestAsync (/builds/trueid-intrend/trueid-serverless-cicd/services/data-analysis/node_modules/googleapis-common/node_modules/google-auth-library/build/src/auth/oauth2client.js:343:18)
Serverless: Checking deployment create progress...
. 
  Error --------------------------------------------------

  Error: Deployment failed: RESOURCE_ERROR

       {"ResourceType":"storage.v1.bucket","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"Invalid Value","reason":"invalid"}],"message":"Invalid Value","statusMessage":"Bad Request","requestPath":"https://storage.googleapis.com/storage/v1/b","httpMethod":"POST"}}

Suggestions

Actionable error messages, include more data about the error

and/or

Link to the failed deployment job in Deployment Manager

Ganitzsh commented 3 years ago

There should be a validation on that before creating anything actually