Google SDK / Dialogflow Deployment Error - deployment

I've been following a tutorial on creating a chatbot with Dialogflow and I've reached the section to do the fulfillment. The Google Cloud SDK got installed but when it comes time to deploy the function I keep getting this error.
https://dialogflow.com/docs/getting-started/basic-fulfillment-conversation
Jasons-MBP-3:~ jason$ sudo gcloud beta functions deploy Goddard --stage-bucket goddard.appspot.com --trigger-http
-2 ['./.git', './.gitignore']
-1 [False, False]
ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: './Library/Application Support/Google/Chrome/RunningChromeVersion'
If you would like to report this issue, please run the following command:
gcloud feedback
To check gcloud for common problems, please run the following command:
gcloud info --run-diagnostics
I tried sudo and updating the gcloud components but still the same thing. I went to the folder it says doesnt exist and I see the file there but it's an alias. When I click the alias Finder says it can't be opened because th original can't be found. Any suggestions?

So a friend of mine told me that for this section it had to be running in the same directory where the index.js file is. In case anyone else gets stuck!

Related

doctl install: neither $XDG_CONFIG_HOME nor $HOME are defined

Using Github actions to configure doctl (digitalocean) but getting this error when the job runs in the runner:
>>> doctl version v1.77.0 installed to /opt/github/actions-runner/_work/_tool/doctl/1.77.0/x64
/opt/github/actions-runner/_work/_tool/doctl/1.77.0/x64/doctl auth init -t ***
Error: neither $XDG_CONFIG_HOME nor $HOME are defined
Any suggestions or tips on how to get past this? Search DO's website & here, couldn't find any relevant material. Thanks!

cloud_sql_proxy gives "error reading config"... how do I fix this?

I have gcloud working in power shell:
> gcloud version
Google Cloud SDK 375.0.0
bq 2.0.74
core 2022.02.25
gsutil 5.6
I've been trying to follow these directions to get my Sql Management Studio to connect to a Google SQL service:
https://cloud.google.com/sql/docs/sqlserver/connect-admin-proxy#start-proxy
But I get this error:
PS C:\gcloud_stuff> ./cloud_sql_proxy -instances=<my instance connection>=tcp:1433
2022/03/06 02:02:51 GcloudConfig: error reading config: exit status 1; stderr was:
The system cannot find the path specified.
The system cannot find the path specified.
2022/03/06 02:02:51 google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
Does anyone know how to fix this? (I am new to Google Cloud)
Looks like you don't have a local set of credentials.
You can either run gcloud auth login and try again. Or you can create a service account key and pass it to the proxy with the -credentials_file flag. See the Proxy docs for details.

gcloud SDK: Unable to write file

I installed gcloud SDK with brew cask install google-cloud-sdk
$ gcloud container clusters get-credentials my-gke-cluster --region europe-west4-c
Fetching cluster endpoint and auth data.
ERROR: (gcloud.container.clusters.get-credentials)
Unable to write file [/Users/xxxxx/my-repo]: [Errno 21] Is a directory: '/Users/xxxxx/my-repo'
Now all permissions of the folder and recursive files are restricted to 600 (drw-------). Tried to reinstall gcloud but with no effect on its behavior.
I assume you're using macOS and I'm unfamiliar with it.
The gcloud container clusters get-credentials command should write to a file called ${HOME}/.kube/config.
The error suggests that it's trying to write the credentials to /Users/xxxxx/my-repo and this is determined by the value of ${KUBECONFIG}. Have you changed either ${KUBECONFIG} or your ${HOME} environment variable? You should be able to printf "HOME=${HOME}\nKUBECONFIG=${KUBECONFIG}" to inspect these.
You may be able to choose a different destination by adjust the value of KUBECONFIG. Perhaps set this to /Users/xxxxx and try the command again.
Ultimately, this is some sugar to update the local configuration file. It should be possible to create this manually if needs be. If the above don't work, I can update this answer with more details.

K8s getting error after change gcloud sdk location on Macos

I'm just fished connect to my kubernete.
But affter that I need to change the gcloud location from /Download to /usr folder.
Next, I run install.sh file for update the new location in .bash_profile.
Then I check gcloud command. It working well
But when I run kubectl get pod. The error showing.
Unable to connect to the server: error executing access token command "/Users/panda/Downloads/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=fork/exec /Users/panda/Downloads/google-cloud-sdk/bin/gcloud: no such file or directory output= stderr=
Hmm, how to update the location of gcloud sdk for solve this problem.
Thanks for your help.
In your Kubeconfig file (probably in ~/.kube/config) you’ll see it has the old path to your gcloud CLI. Update that file with the new path.

Unable to debug java app through stack driver in google kubernetes cluster

I am trying to debug a java app on GKE cluster through stack driver.
I have created a GKE cluster with Allow full access to all Cloud APIs
I am following documentation: https://cloud.google.com/debugger/docs/setup/java
Here is my DockerFile:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} alnt-watchlist-microservice.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/alnt-watchlist-microservice.jar"]
In documentation, it was written to add following lines in DockeFile:
RUN mkdir /opt/cdbg && \
wget -qO- https://storage.googleapis.com/cloud-debugger/compute-java/debian-wheezy/cdbg_java_agent_gce.tar.gz | \
tar xvz -C /opt/cdbg
RUN java -agentpath:/opt/cdbg/cdbg_java_agent.so
-Dcom.google.cdbg.module=tpm-watchlist
-Dcom.google.cdbg.version=v1
-jar /alnt-watchlist-microservice.jar
When I build DockerFile, It fails saying tar: invalid magic , tar: short read.
In stackdriver debug console, It always show 'No deployed application found'. Which application it will show? I have already 2 services deployed on my kubernetes cluster.
I have already executed
gcloud debug source gen-repo-info-file --output-directory="WEB-INF/classes/
in my project's directory.
It generated source-context.json. After its creation, I tried building docker image and its failing.
The debugger will be ready for use when you deploy your containerized app. You are getting No deployed application found error because your debugger agent is failing to download or unzip in dockerfile.
Please check this discussion to resolve the tar: invalid magic , tar: short read. error.
Unfortunately it looks like Alpine isn't regularly tested with Debugger. There's a sample setup here that might help you: https://github.com/GoogleCloudPlatform/cloud-debug-java#alpine-linux
I resolved the issue.
Firstly, you will have to use java image "gcr.io/google-appengine/openjdk" instead of Alpine one.
Secondly,
I was putting entry points without comma separated (Basically in wrong format)
ENTRYPOINT ["java","-agentpath:/opt/cdbg/cdbg_java_agent.so", "-Djava.security.egd=file:/dev/./urandom" ,"-Dcom.google.cdbg.module=watchlist"]