Why do I see `503 Backend Error` when I try to get a Cloud Storage service account?

Ani

I try to deploy a storage triggered Cloud Function, and while this process normally worked just fine with many projects in the same organizations and with similar setups, since yesterday I have trouble to do so.

I can observe the following pattern in all GCP projects across multiple organizations:

  • Category A If at least one storage-triggered function has been deployed to a project before yesterday, I can just deploy again the same function or a new function to this project, no problem.

  • Category B If no storage-triggered functions have been deployed to a project before yesterday, I cannot deploy a storage-triggered function, no matter if I deploy functions through Cloud Build, or if I create a simple bucket function through the GCP console, even not when I just use the sample code suggested by the UI as is and link to a default bucket in the project.

I can't find any other significant differences in the setups between the two categories, in particular IAM and ACL, enabled APIs, and I've made sure that the function is always created in the same project as the bucket that is the trigger resource.

Error when using gcloud functions deploy

$ are retracted names

gcloud functions deploy $FUNCTION_NAME --region=us-central1 --source=https://source.developers.google.com/projects/$PROJECT_ID/repos/$REPO_NAME/moveable-aliases/$BRANCH_NAME/paths/$FUNCTION_NAME/src --trigger-resource=$API_PROJECT_ID-input --trigger-event=google.storage.object.finalize --timeout=540 --runtime=python37 --entry-point=main --memory=128MB --project=$API_PROJECT_ID --retry

will show this error for the project that fall into category B.

ERROR: (gcloud.functions.deploy) OperationError: code=13, message=Failed to configure trigger GCS Bucket: $API_PROJECT_ID-input

Doing the same in projects of category A succeeds fine as expected.

Error when using Google Cloud Console

On the page Create function,

  1. I select Cloud Storage as Trigger
  2. Event Type: `Finalize/Create*
  3. As Bucket I select a default bucket, e.g. $API_PROJECT_ID.appspot.com
  4. Everything else as default, including the suggested sample code
  5. SAVE

The deployment will fail for all projects of category B, but succeeds fine for projects in category A.

The deployment status message in the UI shows the following error:

Deployment failure:
Failed to configure trigger GCS Bucket: $API_PROJECT_ID

Error: Cloud Storage service account is not created

I have then started to compare the setups and noticed that in the GCP console, under Cloud Storage > Settings, only the project of category A have a Cloud Storage service account. Projects of category B don't have a Cloud Storage service account. So I tried to retrieve the account from the API:

https://cloud.google.com/storage/docs/json_api/v1/projects/serviceAccount/get

As you can guess, I'll get 200 OK with the corresponding Cloud Storage service account name only for projects in category A, but for all projects in category B I will see this error response with code 503:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "backendError",
    "message": "Backend Error"
   }
  ],
  "code": 503,
  "message": "Backend Error"
 }
}

I have tried a few times for many different projects since yesterday, nothing changed.

Further info and attempts to resolve

I have followed the instructions provided on: https://cloud.google.com/storage/docs/getting-service-account using the API Explorer on this page: https://cloud.google.com/storage/docs/json_api/v1/projects/serviceAccount/get

I'm not 100% certain the issues of the 503 error, the lack of service account and the deployment failures (code 13) are related. But IIRC, the storage trigger of GCF is actually based on Pub/Sub and that one will require the service account, as stated in the help text in GCP console under Storage > Settings:

Each project has an associated Cloud Storage service account. This is used to perform certain background actions: receiving PubSub notifications and encrypting/decrypting KMS encrypted objects.

I have also read the advice regarding this service account here: https://cloud.google.com/storage/docs/projects#service-accounts

I have also tried the following workarounds:

  • compared IAM between category A and B projects using gsutil iam and GCP console
  • compared ACL between category A and B projects using gsutil acl
  • deployed manually through the API other test buckets with differing predefinedAcl
  • deleted the bucket $API_PROJECT_ID-input and deployed again with no predefinedAcl
  • used default buckets of projects that have been automatically created, e.g. $API_PROJECT_ID.appspot.com
  • updated the deployment configurations of Cloud Deployment Manager for projects in category B
  • tried to disable and enable several APIs, but wouldn't do that for most APIs to avoid causing other problems
  • enabled Cloud Build API for projects in category B (which interestingly, only then has brought the inherited IAM permissions of a different Cloud Build service account into the IAM of an $API_PROJECT_ID-input bucket)
  • added Storage Object Creator role to the default service account ([email protected])
Ani

I have opened a case and later I was notified by GCP support that this was a general issue that affected less than 1% of projects.

We've received a report of an issue with Google Cloud Pub/Sub as of Friday, 2019-01-11 17:48 US/Pacific. We will provide more information by Friday, 2019-01-11 18:30 US/Pacific.

For background information: the bucket-triggers of Cloud Functions use Cloud Pub/Sub.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why do I get an error when I try to see my Text using useState?

Why do I get an error for "__CrtGetFileInformationByHandleEx " when I try to compile

Why do I get HTTP/1.1 503 Service Unavailable when sending messages to the HTTP protocol adapter?

Why do I get error when try to convert Carbon to DateTime?

I try to build Follow system, I have error when i try to get the pk of the vested account

Why Do I get an error when I try to get tkinter slider value?

why do I keep getting a 503 error?

Why do I get a NoClassDefFound error when I try to save my test plan?

Why do I get error when I try to alert the length of the passed array to the function?

Why do I get 'undefined' error when I try to read session atrribute from Controller

Why do I get an error when I try to add a dependent task to one created by the C plugin?

Why do I get an "invalid values" error when I try to access the network settings on Eclipse Mars?

Gitlab CI: why do I get an error when I try to define the pages stage?

Why do I get a compilation error when I try to have two methods with the same name and parameter type?

Why do i get this error when I try installing autopep8 using pip?

why do i get exception error when i try output array

Why do I get the error when I try to dereference a pointer to an array?

Why do i get this error when I try to perform some logical operation on dataframes?

Why do I get this error when I try to load the component in VueJS?

Why do I get this error in my logcat when I try to post JSON data?

Why do I get an error (Notice: Undefined index) when I try to echo a value from my database?

Why do I get a syntax error when I try to print a nested hash that has keys containing colons?

Why do I get an error message of NoneType object is not callable when I try to call this function?

Why do I get an Error when I try to rename a table after FROM?

Why do I get an error when I try to save mongoose model?

why do i get an error when i try to use my models?

Error 503 Backend fetch failed, when I pointed the domain to the IP

Why I get error when I try to declare local variable?

Why I get error when I try to create stored procedure?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  6. 6

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  7. 7

    Do Idle Snowflake Connections Use Cloud Services Credits?

  8. 8

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  9. 9

    Binding element 'string' implicitly has an 'any' type

  10. 10

    BigQuery - concatenate ignoring NULL

  11. 11

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  12. 12

    In Skype, how to block "User requests your details"?

  13. 13

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  14. 14

    Pandas - check if dataframe has negative value in any column

  15. 15

    flutter: dropdown item programmatically unselect problem

  16. 16

    Generate random UUIDv4 with Elm

  17. 17

    Is it possible to Redo commits removed by GitHub Desktop's Undo on a Mac?

  18. 18

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  19. 19

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  20. 20

    EXCEL: Find sum of values in one column with criteria from other column

  21. 21

    How to use merge windows unallocated space into Ubuntu using GParted?

HotTag

Archive