gcloud util installation crashed on Windows 10 - google-cloud-platform

I want to install gcloud ssh component on Windows 10 Home in order to ssh GCE instances. But it failed showing the following message.
Your current Cloud SDK version is: 347.0.0
Installing components from version: 347.0.0
These components will be installed.
Name: gcloud Beta Commands
Version: 2019.05.17
Size: < 1 MiB
For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notes
Do you want to continue (Y/n)? y
Creating update staging area
10%
(snip)
100%
100%
ERROR: gcloud crashed (Error): [('C:\\Users\\tafut\\gcloud\\google-cloud-sdk\\platform\\gsutil\\third_party\\funcsigs\\docs\\index.rst', 'C:\\Users\\tafut\\gcloud\\google-cloud-sdk.staging\\platform\\gsutil\\third_party\\funcsigs\\docs\\index.rst', 'symbolic link privilege not held'), ('C:\\Users\\tafut\\gcloud\\google-cloud-sdk\\platform\\gsutil\\third_party\\mock\\docs\\changelog.txt', 'C:\\Users\\tafut\\gcloud\\google-cloud-sdk.staging\\platform\\gsutil\\third_party\\mock\\docs\\changelog.txt', 'symbolic link privilege not held')]
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
Here is the gcloud version installed.
$ gcloud version
Google Cloud SDK 347.0.0
bq 2.0.69
core 2021.06.25
gsutil 4.64

i suggest you once uninstall cloud sdk and reinstall it again,sometimes most of the errors will get resolved through reinstalling .refer this documentation to uninstall.you can refer this documentation for installing it. and use any of this methods to ssh

I was using gcloud command from the "Git bash" in Windows. Even though I opened the "Git bash" with "Run as Administrator", gcloud would crash.
Instead, I opened Google Cloud SDK Shell (I still used "Run as Administrator"), and the gcloud commands worked without crashing.

Related

When deploying a service on Cloud Run, the latest build is not being used

I'm using this command to submit the build:
gcloud builds submit --tag gcr.io/[my-project]/[my-service]
This successfully submits the build and everything is correct in the Cloud Build tab in the GCP interface.
And this command to deploy:
gcloud beta run deploy [my-service]
--service-account [service-account]#[my-project].iam.gserviceaccount.com
--image gcr.io/[my-project]/[my-service]:latest --cpu 2 --memory 8Gi
--timeout 59m59s --vpc-connector=pyston-vpc-connector
--vpc-egress=private-ranges-only
--set-cloudsql-instances=[my-project]:europe-west2:[my-instance]
This does 'successfully' deploy the service, as in there are no errors. However, it is not deploying using the latest build, it uses the last build submitted by someone else in my team.
I have tried deploying in the GCP interface as well but this led to the same outcome.
Any ideas on how t solve this?
Thanks!
I was specifying the incorrect Container Registry Repository when submitting the build meaning the deployment couldn't find the latest image.

bq command not found

I am currently working on windows machine. Installed WSL to be able to work in Linux env.
Installed the Google Cloud SDK and am able to run gsutil and gcloud commands.
However, while trying to run bq, I get the bq command not found error.
Can someone help me here?
"bq" is one of the default Cloud SDK components, and gets installed by default.
Please check with the command "gcloud components list" to confirm if "bq" is available.
If not, maybe somehow your installation got corrupted. Please try re-installing to fix this issue.
Otherwise, try running these commands, see how the path for all are set and same like "/usr/bin" in the given example. This may reveal some path setting related issues which need to be fixed.
I've run into a similar issue when working on a Windows environment. I have found that calling bq.cmd helps to get the BigQuery commands to execute.
So running:
bq.cmd ls
instead of running:
bq ls
To list datasets in your current project.
In WSL2, install the Google Cloud CLI with this command as shown in the documentation.
curl https://sdk.cloud.google.com | bash
Then restart your WSL installation. The bq command works at both a Windows command prompt and a WSL terminal.

gcloud crashed (SSLHandshakeError) in gcloud app deploy

Unable to deploy my app as I started getting below error since today morning.
I have tried gcloud info --run-diagnostics and gcloud components reinstall without much help.
I tried to deploy it using the old Google App Engine Launcher for Windows but faced the same error.
Earlier it worked till yesterday night (IST) using gcloud. Please help!
I am on latest gcloud sdk and have updated all its components. I use Win10. I tried rebooting my laptop as well.
C:\gaurav\coding\python\myapp\myapp\dist>gcloud app deploy --project=myproject --version 1 --verbosity=info ./app.yaml
INFO: Refreshing access_token
ERROR: gcloud crashed (SSLHandshakeError): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
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
C:\gaurav\coding\python\myapp\myapp\dist>
Diagnostics Output.
C:\gaurav\coding\python\myapp\myapp\dist> gcloud info --run-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
ERROR: Reachability Check failed.
Cannot reach https://accounts.google.com (SSLHandshakeError)
Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (SSLHandshakeError)
Cannot reach https://www.googleapis.com/auth/cloud-platform (SSLHandshakeError)
Network connection problems may be due to proxy or firewall settings.
Do you have a network proxy you would like to set in gcloud (Y/n)? n
ERROR: Network diagnostic (0/1 checks) failed.
C:\gaurav\coding\python\myapp\myapp\dist>
Although gcloud info --run-diagnostics complains that the three URLs are not reachable. I am able to open them from web browser.
I found that when using Fiddler (for viewing network traffic) and have decrypting https traffic enabled, then I received the SSLHandshakeError.
Stopping the tool (or choosing not to decrypt https traffic) and then running the gcloud resulted in success.
According to the comments, also a problem with other web debugging proxies such as Charles.
A problem in recent GAE and GCloud SDK versions is the presence of invalid SSH certificates, see, for example, Google App Engine SSL Certificate Error and issue 38338974.
You could try to use my suggested solution in the above-mentioned post and replace your SDK's certificate file with a valid one (will have to locate a good one for the gcloud SDK, my answer was for the GAE SDK).
You might also be able to use the gcloud config command to set the core custom_ca_certs_file configurable property to point to a file with up to date certificates, if you have one. I didn't try it, YMMV.
Upgrading to Python 2.7.9 on MacOS High Sierra solved the issue for me.
I had this issue upon install of the google cloud SDK on MacOS Mojave. I am not behind a corporate proxy, and all the answers on the web seemed to indicate that this was the issue. I noticed in the install.sh script that it takes an environment variable CLOUDSDK_PYTHON for the python executable. So, I fixed this by exporting the path to my python 3 executable.
In my case:
export CLOUDSDK_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
The install worked as expected after this.
On MacOS Catalina, the solution was to completely uninstall gcloud and reinstall it.
I had the same issue, downloaded the root/intermediate cert from one of the google url you get when you run the command: gcloud info --run-diagnostics and append to the cacerts.txt file that is being used. In my case it was the following one: google-cloud-sdk/lib/third_party/httplib2/python2/httplib2/cacerts.txt
For me it was a conflict in the python versions. gcloud was calling a different version. The solution was to set CLOUDSDK_PYTHON to point to the correct python (python2 in this case).
I tried to deploy gcloud and I was getting this error. Here is how I fixed it:
Access to Google cloud using Firefox
Download certificate. pem file and chain file
Append them on cert.pem located at:
C:\Program Files\google-cloud-sdk\lib\third_party\certifi\cert.pem
(using this you are creating custom CA cert file based on your proxy)
Update cert file as mentioned here: https://cloud.google.com/sdk/gcloud/reference/config/set
(Absolute path to a custom CA cert file.)
Make sure you have cert.pem at the end of path.
I fixed the problem by installing gcloud from apt-get. The guide is at this link

gsutil Updates are available check

On seemly random occasions running a gsutil command it displays:
Updates are available for some Cloud SDK components. To install them,
please run:
$ gcloud components update
My issue is that I run gsutil commands programmatically on a "server" so I don't see this message as it does not appear in either Standard Out or Err from .Net Process.
I see there is a gsutil version command but I don't see a query to do a check if I have the current version.
Is there a gsutil, or other GCP SDK command, I can run that will tell me if my local copy needs to be updated with output via Standard Out?
Here is the output from Version -l
H:\OUTREACH\WEBSITE\GCP>gsutil version -l
gsutil version: 4.27
checksum: 522455e2d24593ff3a2d3d237eefde57 (OK)
boto version: 2.47.0
python version: 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
OS: Windows 7
multiprocessing available: False
using cloud sdk: True
pass cloud sdk credentials to gsutil: True
config path(s): xxxx
gsutil path: xxxx
compiled crcmod: True
installed via package manager: False
editable install: False
gsutil tool comes with Cloud SDK. When you run gsutil it actually invokes a gcloud wrapper which forwards its credentials to gsutil. Among other things it occasionally checks if newer versions of Cloud SDK are available.
If you do not wish this check to be performed, you can disable it by setting corresponding gcloud property via
gcloud config set component_manager/disable_update_check true
To actually check if update is available you can run
gcloud components list
which will display something like
Your current Cloud SDK version is: 163.0.0
The latest available version is: 165.0.0
To update run gcloud components update.
You can find out if a new copy of gsutil is available by running:
gsutil update
Also, you can avoid having updates offered when running on your server by setting the software_update_check_period variable, as described in https://cloud.google.com/storage/docs/gsutil/commands/update.

SSH Error while trying to connect to Google Compute Instance

I am running below command to connect to google compute instance:
gcloud compute ssh example-instance
I am getting error message below:
ERROR: (gcloud.compute.ssh) Your platform does not support OpenSSH.
Can someone please help me in this regard.
Thanks
Shiv
Try updating your local Cloud SDK and run ssh command again. To update the Google Cloud SDK use the following command:
gcloud components update
The error is pretty much self-explanatory. You need to install an OpenSSH to operate. Try installing OpenSSH. The guide for installing on Windows 10 is as follows:
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse