Paul Phoenix
Paul Phoenix

Reputation: 1433

gcloud is crashing while authenticating service account key with error: gcloud crashed (OperationalError): disk I/O error

I am trying to run the following command: gcloud auth activate-service-account --key-file service_account_key.json

Post which I get an error output as below:

ERROR: gcloud crashed (OperationalError): disk I/O error

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

Running gcloud diagnostics comes clean with below output:

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

Property diagnostic detects issues that may be caused by properties.
Checking hidden properties...done.
Hidden Property Check passed.
Property diagnostic passed (1/1 checks passed).

Earlier the diagnostics used to give error that google services are not reachable which was fixed by setting up the proxy and then authentication started to work. but now it is failing with proxy settings as is(proxy works fine).

Neither diagnostics is giving enough info about the crash nor the error message itself.

below are the gcloud version info:

$ gcloud version
Google Cloud SDK 254.0.0
bq 2.0.45
core 2019.07.15
gsutil 4.40
Updates are available for some Cloud SDK components.  To install them,
please run:
  $ gcloud components update

I have also tried --verbose that too was not of much help.

Upvotes: 0

Views: 4196

Answers (2)

Ajinkya Pawar
Ajinkya Pawar

Reputation: 1

  1. Navigate to gcloud config folder
cd ~/.config/gcloud 
  1. Make empty access_token.db file from the gcloud config folder
> access_tokens.db
  1. Now activate the service account
gcloud auth activate-service-account --key-file service_account_key.json

Upvotes: 0

Paul Phoenix
Paul Phoenix

Reputation: 1433

As suggested by @guillaume I updated the gcloud SDK to the latest version and got more verbose error message post which I was able to fix the issue.

WARNING: Could not store access token in cache: disk I/O error
[Step 1/1] ERROR: gcloud crashed (OperationalError): disk I/O error

The default location where the gcloud was writing configs(/.config/gcloud) needed a clean-up. We updated the config directory itself to a new dir as we had limited access to earlier pointed directory otherwise a clean-up would have sufficed.

Upvotes: 0

Related Questions