0

googlecloudsdk.command_lib.app.deploy_util.VersionPromotionError: Your deployment has succeeded, but promoting the new version to default failed. You may not have permissions to change traffic splits. Changing traffic splits requires the Owner, Editor, App Engine Admin, or App Engine Service Admin role. Please contact your project owner and use the gcloud app services set-traffic --splits <version>=1 command to redirect traffic to your newly deployed version. Original error: INVALID_ARGUMENT: Invalid request.

  • '@type': type.googleapis.com/google.rpc.BadRequest fieldViolations:
    • description: Traffic cannot be allocated to stopped version staging. Please ensure that traffic is only allocated to serving versions. field: service.split.allocations[staging] ERROR: (gcloud.app.deploy) Your deployment has succeeded, but promoting the new version to default failed. You may not have permissions to change traffic splits. Changing traffic splits requires the Owner, Editor, App Engine Admin, or App Engine Service Admin role. Please contact your project owner and use the gcloud app services set-traffic --splits <version>=1 command to redirect traffic to your newly deployed version. Original error: INVALID_ARGUMENT: Invalid request.
  • '@type': type.googleapis.com/google.rpc.BadRequest fieldViolations:
    • description: Traffic cannot be allocated to stopped version staging. Please ensure that traffic is only allocated to serving versions. field: service.split.allocations[staging]
  • status=1
  • set -e
  • '[' 1 -eq 0 ']'
  • fail 'Deployment failed.'
  • echo -e '\e[31m✖ Deployment failed.\e[0m'
  • exit 1 ✖ Deployment failed. Build teardown

This uses the Google Service Account, which has App Engine Admin, Deployer and storage admin.

Any ideas? Thanks

WallyKaye
  • 13
  • 5

2 Answers2

1

As you can see in this community answer, there are 2 additional roles that you should add to your account, they are:

  • roles/appengine.serviceAdmin
  • roles/cloudbuild.builds.builder

Adding these 2 permissions should give you enough right to complete the deployment.

Ralemos
  • 163
  • 7
  • Hi there, thanks. I added these permissions but I seem to be getting the same error. Interestingly, I can see on App engine that the latest deploy is sitting there in a stopped state and the previous version is still running. I also noticed that there were two services as well. The one service had the latest deploy in a "Stopped" state and the second service only had the previous deploy. – WallyKaye Apr 20 '21 at 04:55
  • Are you using the default app engine service account? – Ralemos Apr 20 '21 at 13:48
  • Yes correct, I am using the default App Engine Service account related to that particular App. – WallyKaye Apr 22 '21 at 04:17
  • Just another update on this issue. So the specifically relates to Traffic Split. So the deployment succeeds and the latest version is there but it seems that when transferring the traffic split from old version to new version it fails. After deployment, I manually did the traffic split and saved and that worked. So the question is why the traffic split specifically fails when doing the auto deployment through Bitbucket . tnx – WallyKaye Apr 23 '21 at 07:25
  • This is weird behavior you are seeing, and in the end it appears this is not a missing role issue. I would say that you should open a customer issue in [Google's Issue Tracker](https://issuetracker.google.com/issues/new?component=187191&template=0), as this is not an expected behavior so the Engineering team might need to troubleshoot this to find a root cause (and I couldn't find anything similar to this in the community or documentation). – Ralemos Apr 23 '21 at 14:04
0

The issue is resolved now, your additional roles @rafeal resolved the issue. The project I was looking at was different to the one that was part of the pipeline, so my mistake.

WallyKaye
  • 13
  • 5
  • it happens, glad to know the issue was resolved, in that case, please consider accepting the answer provided. – Ralemos Apr 28 '21 at 10:02