Skip to main content

Posts

Showing posts from 2020

GCP: google.api_core.exceptions.BadRequest: 400 POST , when running a bigquery in your shell

I like to code directly in the GCP console editor to test some POCs, but with this approach you have to deal with some situations, such as, getting your shell and editor disconnected after a few minutes idle, then when you retake your coding and re running your python code to execute some bigquery statements, you can see a nasty error like this: google.api_core.exceptions.BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects//jobs: Invalid project ID ''. Project IDs must contain 6-63 lowercase letters, digits, or dashes. Some project I Ds also include domain name separated by a colon. IDs must start with a letter and may not end with a dash. what happened?, you gcp shell was reseted and you lost your project connection, you can check that: (venv) jcalfucura@cloudshell: ~/crossprod $ gcloud config list --format 'value(core.project)' 2>/dev/null returns nothing. You can also use this statement: (venv) jcalfucura@cloudshell: ~/crossprod $ gcloud con

How to issue shell commands from a pod

I was trying to troubleshoot the network connectivity between a K8s cluster and a VM in GCP, at first i just SSHed into the nodes and then trying to ssh into an external VM, it all worked smoothly but still had problems with the app trying to connect to the external VM, so , the next step was to connect to the pod and start a session: kubectl exec -it --namespace <namespace> <pod> --container <containername> -- /bin/bash from there i was able to issue a command to ssh into the external vm.