Quentin123345 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

gcloud preview app deploy - 403 response #407

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

gcloud preview app deploy build/staged-app/app.yaml --project OBSCURED 
--version 1 --promote --bucket gs://OBSCURED-deploy

You are about to deploy the following modules:
 - OBSCURED/default (from [C:\Users\OBSCURED\OBSCURED\OBSCURED\build\staged-app\app.yaml])
     Deployed URL: [https://OBSCURED.appspot.com]

Do you want to continue (Y/n)?  y

Beginning deployment...
Copying files to Google Cloud Storage...
Synchronizing files to [gs://OBSCURED-deploy].
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [403] Operation not allowed

What is the expected output? What do you see instead?

Excerpt from the log:

2015-11-28 17:47:38,167 DEBUG    root            {u'status': 
u'PERMISSION_DENIED', u'message': u'Operation not allowed', u'code': 403, 
u'details': [{u'resourceType': u'gae.api', u'@type': 
u'type.googleapis.com/google.rpc.ResourceInfo', u'description': u'The 
"appengine.versions.create" permission is required.'}]}
2015-11-28 17:47:38,167 DEBUG    root            (gcloud.preview.app.deploy) 
Error Response: [403] Operation not allowed

Details: [
  [
    {
      "@type": "type.googleapis.com/google.rpc.ResourceInfo",
      "description": "The \"appengine.versions.create\" permission is required.",
      "resourceType": "gae.api"
    }
  ]
]
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 609, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 1228, in Run
    resources = command_instance.Run(args)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\surface\preview\app\deploy.py", line 285, in Run
    images.get(module))
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\appengine_api_client.py", line 71, in DeployModule
    self.client.apps_modules_versions.Create, create_request)
  File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\api\requests.py", line 78, in MakeRequest
    raise exceptions.HttpException(ExtractErrorMessage(error_json))
HttpException: Error Response: [403] Operation not allowed

Original issue reported on code.google.com by todd.eve...@gmail.com on 29 Nov 2015 at 12:57

GoogleCodeExporter commented 8 years ago
Can you verify that your current user (`gcloud config list 
--format='value(core.account)'`) has "EDITOR" or "OWNER" permission on your 
current project (the argument to `--project`)? You can see this permission in 
the Cloud Developers Console (https://console.developers.google.com/).

Have you ever seen a deployment work using this user/project combination? Or 
has this bug always been present.

Original comment by z...@google.com on 30 Nov 2015 at 8:59

GoogleCodeExporter commented 8 years ago
Yes, I am the current user, and I have owner permission on the project. I've 
always successfully deployed this project via the Google Plugin for Eclipse but 
have never successfully deployed via gcloud. I'm trying to move to a push to 
deploy workflow and have everything working except for the gcloud deployment 
step.

Todd

Original comment by todd.eve...@gmail.com on 30 Nov 2015 at 9:25

GoogleCodeExporter commented 8 years ago
We're going to have our server-side team take a look at this.

When you say "a push-to-deploy" workflow, what do you mean? Is there a 
particular set of instructions that you're following? How did you log in on the 
machine that's performing the gcloud step (ex. via "gcloud auth login" or via a 
service account)?

Original comment by z...@google.com on 30 Nov 2015 at 10:08

GoogleCodeExporter commented 8 years ago
I'm following the instructions here closely: 
https://cloud.google.com/tools/cloud-repositories/docs/push-to-deploy. One 
excpetion is that I'm not using 'mvn gcloud:deploy' to deploy because I'm using 
Gradle.

The 403 error occurs whether I attempt to deploy via Bitnami Jenkins or via my 
local Google Cloud SDK shell.

Thanks for your help!

Todd

Original comment by todd.eve...@gmail.com on 30 Nov 2015 at 10:16

GoogleCodeExporter commented 8 years ago
There's a known issue with that doc (sorry! I updated it last week, but it's 
taking a couple of days for change to publish).

It's missing "https://www.googleapis.com/auth/cloud-platform" from the --scopes 
flag. Can you try again after adding that?

Original comment by z...@google.com on 30 Nov 2015 at 10:20

GoogleCodeExporter commented 8 years ago
Ha! I found your stackoverflow answer for that problem, and it did fix the 
error preventing access to my cloud storage bucket. I also have to include the 
--bucket argument to specify which bucket to use. As you can see in my original 
report, access to cloud storage is working:

Copying files to Google Cloud Storage...
Synchronizing files to [gs://OBSCURED-deploy].

And I see the files in cloud storage browser. The error occurs directly after 
that:

Updating module [default]...failed.

Original comment by todd.eve...@gmail.com on 30 Nov 2015 at 10:36

GoogleCodeExporter commented 8 years ago
Ok, thanks for running through all the options with me :)

I'll sic the right back-end team on this problem.

Original comment by z...@google.com on 30 Nov 2015 at 10:40

GoogleCodeExporter commented 8 years ago
We can take a deeper look at this if you share the name of your app and what 
username/account you're using.

If you'd prefer not to share publicly, feel free to email me at zjn@google.com.

Original comment by z...@google.com on 4 Dec 2015 at 2:55

GoogleCodeExporter commented 8 years ago
After offline discussions, we learned that this is not an issue that should 
affect any other users.

Original comment by z...@google.com on 28 Dec 2015 at 3:45