gcloud beta functions command says "Invalid choice functions" - google-cloud-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?

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.

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.

Related

Firebase Cloud Functions - Error: Functions did not deploy properly. - Provided module can't be loaded

today I had the following after running the command firebase functions deploy --only functions.
After much research, I found the command firebase functions:log
This showed me the "correct" error.
Provided module can't be loaded. Did you list all required modules in
the package.json dependencies?
The solution to my specific problems was:
remove node_modules folder
npm install in functions folder
In my case, After a long time of searching, I found the reason to be that I had disabled billing for the project for some time.
It now worked fine after I enabled it in the Google cloud console.
It would have been really helpful if firebase could show any useful error message to suggest the problem. I found this after many trials.

Quarkus: CDI not working when using Google Cloud Functions

I followed the QUARKUS - GOOGLE CLOUD FUNCTIONS tutorial, but dependency injection doesn't seem to be working in that context as any #Inject'ed object is null at runtime:
both while testing locally,
and running on GCP too.
Downloading and running the tutorial solution gives the same result for me.
Am I missing something ?
This error is usually caused by using the wrong entry point inside the gcloud command.
You must use the Quarkus provided function and not your function as the entry point class from your gcloud command.
This is descibed in this part of the guide https://quarkus.io/guides/gcp-functions#build-and-deploy-to-google-cloud, maybe we need to make it clearer.
For a background function, use gcloud functions deploy my-function --entry-point --entry-point=io.quarkus.gcp.functions.QuarkusBackgroundFunction ...
For an HTTP function, use gcloud functions deploy my-function --entry-point --entry-point=io.quarkus.gcp.functions.QuarkusHttpFunction ...
The Quarkus function will bootstrap the framework (including CDI), search for your function and inject dependencies in it.

Deploying Code and Managing configuration with Terraform

Just to give context:
I am planning to use Terraform to bring up new separate environments with ec2 machines, elb etc. and then maintaining configuration as well.
Doing that with terraform and using AWS provider sounds fairly simple.
Problem 1:
While launching those instances I want to install few packages etc. so that when Terraform launches the instances (servers) things/ apps should be up and running.
Assuming the above is up and running:
Problem 2:
How do I deploy new code on the servers in this environment launched by Terraform?
Should I use for eg. ansible playbooks/chef recipes/puppet manifests for that? or Terraform gives some other options/ways?
Brief answers:
Problem 1: While launching those instances I want to install few packages etc. so that when Terraform launches the instances (servers) things/ apps should be up and running.
A couple of options:
Create an AMI of your instance with the installed packages and specify that in the resource.
Use the user data script to install the packages that you need when the instance starts.
Use ansible playbooks/chef recipes/puppet to install packages once the instance is running (e.g. creating an opsworks stack with terraform)
Problem 2: How do I deploy new code on the servers in this environment
launched by Terraform? Should I use for eg. ansible playbooks/chef
recipes/puppet manifests for that? or Terraform gives some other
options/ways?
Not the intended use case for terraform, use other tools like jenkins or aws services like codepipeline or codedeploy. Ansible/chef/puppet can also help (e.g. with opsworks)

Unable to initialize gcloud environment

I have google cloud sdk installed on my ubuntu 14.4system but whenever I type gcloud init in my console, I get the following error:-
rbenv: gcloud: command not found
Further if I run gcloud init with sudo the error changes to:-
/usr/bin/env: ruby1.9.1: No such file or directory
I am unable to understand what has google cloud sdk to do with rbenv. I tried reinstalling google cloud sdk but with the same result. Is there a way out? any help is greatly appreciated.
On linux when you install the SDK it prompts to put following into your ~/.bashrc so PATH and such are setup to make cmds like gcloud visible
# The next line updates PATH for the Google Cloud SDK.
source '/home/scott/google-cloud-sdk/path.bash.inc'
# The next line enables shell command completion for gcloud.
source '/home/scott/google-cloud-sdk/completion.bash.inc'
If you are not on linux/OSX then the SDK install will have similar
It sounds as though gcloud is not on your $PATH.
If you installed the Cloud SDK to /home/username/google-cloud-sdk/, you should be able to invoke gcloud by running /home/username/google-cloud-sdk/bin/gcloud info. If you would like to be able to run simply gcloud, you can run export PATH="/home/username/google-cloud-sdk/bin:$PATH" (to make this setting persist, put that command in your ~/.profile file.

CoreData: Failed to load optimized model at path

I am getting this warning multiple times when i goto a view using google maps.This started as soon as i migrated to swift 2.0 and xcode 7 for my exising project .Im using google maps in my project. See the console log below
I have gone through some links but was not helpful
https://code.google.com/p/gmaps-api-issues/issues/detail?id=8459
https://forums.developer.apple.com/thread/14157
In my case I needed doing 1) update cocoa pod, 2) setup again, and 3) update pods.
1) $ gem update cocoapods
2) $ pod setup
3) $ pod update
As indicated in your console log, this is caused by an issue in the Google Maps SDK. The issue has been fixed in the latest Google Maps SDK release, so if you update it, it should work like before.
If you're using CocoaPods, just add pod 'GoogleMaps' in your podfile and run $ pod install.