gcloud

Can't access gcloud compute, DatabaseError


While trying to connect to a google cloud compute instance via iap-tunnel, I get this error message:

ERROR: gcloud crashed (DatabaseError): file is not a database

I tried connecting from an ubuntu CLI using

gcloud compute start-iap-tunnel "comfy-ui-lab-$INSTANCE_NAME" 8188 --project=$INSTANCE_PROJECT --zone=$INSTANCE_ZONE --local-host-port=localhost:8188

for appropriate variables, as i did for the last few weeks. However instead of a password prompt, I just received the Error message. Running

gcloud info --run-diagnostics

yields the same problem


Solution

  • Your gcloud client SQLLite db is probably corrupted. Running gcloud init should fix this. If it does not, backup/clean the gcloud config dir first and then rerun gcloud init :

    cd ~/.config
    mv gcloud gcloud_bak
    gcloud init