gcloud commands crashed

3,094 views
Skip to first unread message

Pedro Collado

unread,
Feb 2, 2022, 3:49:55 AM2/2/22
to Google Cloud Developers
Hey
All gclcoud commands are crashing or not working in my Ubuntu WSL terminal. 
I can't do anything.
I've tried to update google cloud sdk and the same crash happens.
I've tried to uninstall and install SDK and it crashes again.

The error says: "gcloud crashed (DatabaseError): database disk image is malformed"
Check img attached.

Does anybody know How to fix this?
is possible to remove gcloud database / all SDK components  and start over=?

Please Help



gcloud-DatabaseError.png

Chris Gerber

unread,
Feb 2, 2022, 10:05:40 AM2/2/22
to Pedro Collado, Google Cloud Developers
There may be two database files in your configuration directory, access_tokens.db and credentials.db. I would try renaming them one at a time, and letting gcloud recreate them. On my Linux machine I would be running the following:

# Display the location of the database files
gcloud_config_dir=$(gcloud info --format="value(config.paths.global_config_dir)")
echo $gcloud_config_dir
# If this didn't work, try using $HOME/.config/gcloud

# Rename the credentials database and test gcloud again
mv ${gcloud_config_dir?}/credentials.db{,.old}
gcloud compute instances list --limit=1

# If necessary, rename the access tokens database and test gcloud again
mv ${gcloud_config_dir?}/access_tokens.db{,.old}
gcloud compute instances list --limit=1

--
You received this message because you are subscribed to the Google Groups "Google Cloud Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-dev/7d569030-039e-4ff5-9944-752dc08f0714n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages