gcloud init ERROR: gcloud crashed (ConnectionError) - google-cloud-platform

Google Cloud SDK installer is downloaded successfully.
After successful installation, it runs gcloud init command
It asked for sign-in
After providing signing in details, the following error occurs
ERROR: gcloud crashed (ConnectionError):
HTTPSConnectionPool(host='oauth2.googleapis.com', port=443):
Max retries exceeded with url: /token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000016A45426A08>:
Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
How to handle this error?

I was trying gcloud init on a remote desktop, and received this error: gcloud crashed (ConnectionError)
The following solution worked for me.
I used the command gcloud init --console-only instead of gcloud init

SSL verification fails mostly if you are behind proxy. You can disable ssl auth for gcloud client using below cmd:
gcloud config set auth/disable_ssl_validation True

Google will eventually block your IP when you exceed a certain amount of requests.
You can try to create another superuser form command line may be it will resolve the issue.

When i was trying with broadband it was giving same error, but when i switched to mobile data, everything is working fine for me.

Related

CLI plugin installation problem on Grafana

I'm getting the following error when trying to install a plugin from the Grafana CLI installed on Kubernetes. I deleted and rebuilt the pod, it works fine but the error persists. Other Grafana features are working fine. What can I do?
Failed to send requesterrorGet "https://grafana.com/api/plugins/repo": context deadline exceeded (Client.Timeout exceeded while awaiting headers)Error: ✗ Failed to send request: Get "https://grafana.com/api/plugins/repo": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
BR
You say there is no problem with Grafana working. Kubernetes also does not give an error with the pod. In the error content, it says "Failed to send request: Get". Most likely it can access the internet but not dns resolution. If ping 8.8.8.8 is working but ping google.com is not working, you need to add nameserver.
For this, you can add something like the following into the /etc/resolv.conf file.
nameserver 8.8.8.8

How to make google-cloud-sdk work behind the proxy?

When using google-cloud-sdk, following behavior is noticed. GOAL is to have the same behavior as point 1 mentioned below for the failed case in point 2. This will ensure the working of gcloud behind proxy. Help in this?
service account was able to be activated via Powershell (In case of Manual Proxy setup in the Windows Proxy Settings). Following is how the successful case looks like.
PS C:\Users\monica.bostina\Downloads\DLP1\Attended Framework> gcloud config list
[core]
account = vf-grp-dlplt-dev-dlp01#appspot.gserviceaccount.com
disable_user_reporting = True
project = vf-grp-dlplt-dev-dlp01
Your active configuration is: [default]
PS C:\Users\monica.bostina\Downloads\DLP1\Attended Framework> gcloud auth activate-service-account --key-file="temporary-credentials.json"
Activated service account credentials for: [vf-grp-dlplt-dev-dlp01#appspot.gserviceaccount.com]
service account was failing to get activated via Powershell (In case, Use Proxy setup is ON and Manual Proxy settings are OFF in the Windows Proxy Settings). Error message was the below.
PS C:\Users\monica.bostina\Downloads\DLP1\Attended Framework> gcloud config list
[core]
account = vf-grp-dlplt-dev-dlp01#appspot.gserviceaccount.com
disable_user_reporting = True
project = vf-grp-dlplt-dev-dlp01
Your active configuration is: [default]
PS C:\Users\monica.bostina\Downloads\DLP1\Attended Framework> gcloud auth activate-service-account --key-file="temporary-credentials.json"
ERROR: gcloud crashed (TransportError): HTTPSConnectionPool(host='oauth2.googleapis.com', port=443): Max retries exceeded with url: /token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000199D6670DF0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
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'm working in a corporate environment dealing with VPNs and proxies.
Whitelisted the following URLs at proxy level --
https://accounts.google.com/o/oauth2/auth
https://oauth2.googleapis.com/token
https://www.googleapis.com/oauth2/v1/certs
https://www.googleapis.com/robot/v1/metadata/x509/vf-grp-XXXXXXXXXXXappspot.gserviceaccount.com
https://www.googleapis.com/auth/cloud-platform
Perhaps the manual proxy configuration is working but when using automatic detection you're being given a PAC script that doesn't work with the Gcloud URLs. It also may not be applied to shell/terminal.
Gcloud has its own proxy configuration internal to the application you could rely on so you don't have to manually set the proxy config in the OS.
I had to set the following values (as documented):
gcloud config set proxy/type [PROXY_TYPE]
gcloud config set proxy/address [PROXY_IP_ADDRESS]
gcloud config set proxy/port [PROXY_PORT]
In my case because we also use custom CA certificates on our proxy so I also had to extract them and combine them into a single cert that could be trusted within Gcloud.
gcloud config set core/custom_ca_certs_file [PATH_TO_CUSTOM_CA]

Cloud Foundry cli i/o timeout

I was able to successfully deploy BOSH and CF on GCP. I was able to install the cf cli on my worker machine and was able to cf login to the api endpoint without any issues. Now I am attempting to deploy a python and a node.js hello-world style application (cf push) but I am running into the following error:
Python:
**ERROR** Could not install python: Get https://buildpacks.cloudfoundry.org/dependencies/python/python-3.5.4-linux-x64-5c7aa3b0.tgz: dial tcp: lookup buildpacks.cloudfoundry.org on 169.254.0.2:53: read udp 10.255.61.196:36513->169.254.0.2:53: i/o timeout
Failed to compile droplet: Failed to run all supply scripts: exit status 14
NodeJS
-----> Nodejs Buildpack version 1.6.28
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
**WARNING** Node version not specified in package.json. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
-----> Installing node 6.14.3
Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-6.14.3-linux-x64-ae2a82a5.tgz]
**ERROR** Unable to install node: Get https://buildpacks.cloudfoundry.org/dependencies/node/node-6.14.3-linux-x64-ae2a82a5.tgz: dial tcp: lookup buildpacks.cloudfoundry.org on 169.254.0.2:53: read udp 10.255.61.206:34802->169.254.0.2:53: i/o timeout
Failed to compile droplet: Failed to run all supply scripts: exit status 14
I am able to download and ping the build pack urls manually on the worker machine, jumpbox, and the bosh vms so I believe DNS is working properly on each of those machine types.
As part of the default deployment, I believe a socks5 tunnel is created to allow communication from my worker machine to the jumpbox so this is where I believe the issue lies. https://docs.cloudfoundry.org/cf-cli/http-proxy.html
When running bbl print-env, export BOSH_ALL_PROXY=ssh+socks5://jumpbox#35.192.140.0:22?private-key=/tmp/bosh-jumpbox725514160/bosh_jumpbox_private.key , however when I export https_proxy=socks5://jumpbox#35.192.140.0:22?private-key=/tmp/bosh-jumpbox389236516/bosh_jumpbox_private.key and do a cf push I receive the following error:
Request error: Get https://api.cloudfoundry.costub.com/v2/info: proxy: SOCKS5 proxy at 35.192.140.0:22 has unexpected version 83
TIP: If you are behind a firewall and require an HTTP proxy, verify the https_proxy environment variable is correctly set. Else, check your network connection.
FAILED
Am I on the right track? Is my https_proxy variable formatted correctly? I also tried https_proxy=socks5://jumpbox#35.192.140.0:22 with the same result.

Unable to login to https://api.cloudfoundry.com

despite the fact that i have setup everything i am still unable to login:
C:>vmc target
[https://api.cloudfoundry.com]
C:> vmc info
VMware's Cloud Application Platform
For support visit http://support.cloudfoundry.com
Target: https://api.cloudfoundry.com (v0.999)
Client: v0.3.23
C:>vmc login xxxxxxxxxxx -t
Attempting login to [https://api.cloudfoundry.com]
Password: **
Problem with login to 'https://api.cloudfoundry.com', A connection attempt failed because the connected party did not pr
operly respond after a period of time, or established connection failed because connected host has failed to respond. -
connect(2), try again or register for an account.
Has anyone an idea what I am possibly missing here?
Please update your vmc client
gem update vmc

Error in tunneling service on VMC

I've push an app to my CF on cloud_controller paas.azure4j.us with uri yamashowcase.azure4j.us .
When I tried to create tunnel on service which binded to it an error occured like this :
toriq#meruvian354:~$ sudo vmc tunnel yamashowcase-db
Stopping Application 'caldecott': OK
Redeploying tunnel application 'caldecott'.
Uploading Application:
Checking for available resources: OK
Packing application: OK
Uploading (1K): OK
Push Status: OK
Binding Service [yamashowcase-db]: OK
Staging Application 'caldecott': OK
Starting Application 'caldecott': OK
Getting tunnel connection info: ..........Error: Expected remote tunnel to know about
yamashowcase-db, but it doesn't
I use vmc version 0.3.23 .
Any solution for this ??
I think this error is a little misleading. I would check the logs on the instance, particularly the cloud controller log and log for the service node used for yamashowcase-db (mysql, postgre etc)