Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud beta functions command says "Invalid choice functions"

I'm following the google cloud functions tutorial here: https://cloud.google.com/functions/docs/quickstart

I install google-cloud-sdk and source both path.bash.inc and completion.bash.inc.

The gsutil command step works and creates the storage bucket.

When I run gcloud beta functions deploy helloWorld --stage-bucket [BUCKET_NAME] --trigger-topic hello_world replacing with my [BUCKET_NAME] I get usage help and the following error:

``` ERROR: (gcloud.beta) Invalid choice: 'functions'.

Valid choices are [app, auth, bigtable, compute, config, container, dataflow, dataproc, debug, deployment-manager, emulators, error-reporting, iam, init, logging, ml, organizations, projects, pubsub, service-management, source, sql, test]. ```

I'm not sure how the gcloud command works, but I can see the functions directory in the lib/surface/ directory of the google-cloud-sdk.

Why does gcloud beta functions not work? How can I make it work?

like image 576
jrwren Avatar asked Mar 21 '17 01:03

jrwren


2 Answers

Make sure you have the latest cloud SDK installed.

I got the same error and it seems I had version 137 while the latest is 152.

After running gcloud components update it was solved.

like image 124
Yossi Avatar answered Sep 25 '22 14:09

Yossi


The functions are in subscription-only beta phase right now. From Quickstart:

Beta

This is a Beta release of Google Cloud Functions. This API might be changed in backward-incompatible ways and is not subject to any SLA or deprecation policy.

Want to get advance access to the latest and greatest? Click here to become a beta tester.

The gcloud cmd might be checking beta subscriptions. Did you subscribe?

Also make sure you have the most recent cloud SDK version.

like image 33
Dan Cornilescu Avatar answered Sep 23 '22 14:09

Dan Cornilescu