googlearchive / cloud-functions-emulator

A local emulator for deploying, running, and debugging Google Cloud Functions.
https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki
Apache License 2.0
826 stars 114 forks source link

Permissions Issue with DataStore in the Functions Emulator #270

Open ethan-seer opened 6 years ago

ethan-seer commented 6 years ago

Error

Error: 7 PERMISSION_DENIED: Missing or insufficient permissions.

Environment details

Steps to reproduce

  1. Run: functions config set projectId my-project (with datastore enabled on the project level)
  2. Download the following repo: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/functions/datastore
  3. Deploy each trigger
    functions deploy get --trigger-http
    functions deploy set --trigger-http
    functions deploy del --trigger-http
    1. Run the example: functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}'
briantq commented 5 years ago

I have encountered the same problem. It sounds like a IAM permission issue, but I can't figure it out as I am using the owner account for testing and can't get it to work.

briantq commented 5 years ago

@ethan-seer I am not sure if you are still having this issue, but found this post that solved my problem https://stackoverflow.com/questions/39978077/gcloud-exceptions-forbidden-403-missing-or-insufficient-permissions I had used gcloud auth login and evidently I needed to use gcloud auth application-default login

ethan-seer commented 5 years ago

Thanks @briantq . I figured out it was because I am in a beta that blocked my access. Thanks for f/u.