2

Try to create a datalab session following this page: https://cloud.google.com/datalab/docs/quickstarts

$ datalab create junlab

ERROR: (gcloud.alpha.source.repos.create) Failed to create repository [datalab-notebooks] for Project [thinking-star-140602] with error

The caller does not have permission

PERMISSION_DENIED

A nested call to gcloud failed.

But actually I am the owner of the project.

Any idea?

3 Answers3

3

I'm not able to reproduce that error in a new project, but here are a couple of things you can try to narrow down the root cause:

  1. Run gcloud auth list and look at what account is listed as "ACTIVE". One potential source of this error is if you have signed in to gcloud with multiple accounts, and the active one is not the owner of the project.
  2. Go to the Cloud Source Repositories page in the cloud console, and see if you can create the repository there. That may give you a more detailed error message.
Omar Jarjur
  • 1,046
  • 5
  • 5
3

I have encountered similar problem and I do the following to solve the issue. Hope this help.

  1. list the authorization account "gcloud auth list"
  2. set the authorization account "gcloud config set account xxxxx"
  3. create the datalab "datalab create xxxx"
0

You may need to enable the Cloud Source Repositories API.

The easiest way to do this is to click on the link that can sometimes be within the error message you receive - like below but with your own account specifics and your project name at the end: https://console.cloud.google.com/apis/library/sourcerepo.googleapis.com/?project=<YOUR-PROJECT-NAME>

and may be hidden within the error message you received much like this:

ERROR: (gcloud.source.repos.create) ResponseError: status=[PERMISSION_DENIED],
code=[403], message=[User[<YOURACCOUNT@gmail.com>] does not have permission to access 
project[<YOUR-PROJECT-NAME>] (or it may not exist): The caller does not have permission].
details:
- Cloud Source Repositories API is not enabled. Please enable the API on the Google
  Cloud console. 
  enable at: https://console.cloud.google.com/apis/library/sourcerepo.googleapis.com/?project=<YOUR-PROJECT-NAME>
Failed to find or create the repository datalab-notebooks.
Ask a project owner to create it for you.

Hover over the address listed in the error message in your google cloud shell and you will even get a hyperlink to take you right there. Enable it when the page finishes opening.

Alternatively, you can track the API down by going to APIs & Services/Library and searching for Cloud Source Repositories. Click on the card that comes up, and then when the destination page finishes loading, click the ENABLE button.

You should be able to run the
datalab create junlab command in your google cloud shell now without issue.

leerssej
  • 14,260
  • 6
  • 48
  • 57