Reputation: 12465
I am following the tutorial for google cloud functions. Trying to deploy the hello world from command line returns
ERROR: (gcloud.beta.functions.deploy) value for field [locationsId] for in collection [cloudfunctions.projects.locations] is required but was not provided
deploy command is
gcloud beta functions deploy helloWorld --stage-bucket shopping-functions --trigger-topic hello_world
Upvotes: 4
Views: 4197
Reputation: 266
As @jdabello said, I attached --region
option to my command and it solves the problem as follows:
gcloud beta functions deploy helloWorld --stage-bucket your-bucket --trigger-topic hello_world --region=us-central1
Or you can set your default functions/region using gcloud config set
and you can skip specifying function's region each time.
gcloud config set functions/region us-central1
Upvotes: 6
Reputation: 1
Make sure to set a region for your function. You can add the --region flag to override the default functions/region property value for this command invocation.
Upvotes: 0
Reputation: 364
Have you deployed any functions using the "firebase deploy" command? I was having the same problem until I switched all of my functions to either gcloud or firebase. It seems they don't play well together yet.
Upvotes: 0
Reputation: 2222
It looks to me like you don't have a project set up properly?
Have you set up a project from which you want to use your cloud function? You can look it up by calling gcloud info
. You can also try reinitializing your environment with gcloud init
.
Let me know if this helps!
Upvotes: 2