Configure: DVC + CircleCI + GDRIVE

Trying to configure DVC to pull gdrive stored artifacts from a CircleCI build? I followed instructions from docs, hints in this discussion-question & this git-hub issue but there seems to be something missing.

Here is the excerpt of the circle-ci configuration being used:

- run:
     name: Data checkout
     command: |
        dvc remote modify storage --local gdrive_use_service_account true;
        dvc remote modify storage --local gdrive_service_account_json_file_path /dev/null;
        dvc remote modify storage --local gdrive_service_account_user_email <>;
        dvc pull --recursive -r storage --verbose;

The $GDRIVE_CREDENTIALS_DATA environment variable was configured in Circle-CI server to be that of my Google’s Service Account JSON to access my google drive. But the CircleCI runner reports this error as if the environment variable did not get read.

0% 0/1 [00:00<?, ?file/s{'info': ''}]
Go to the following link in your browser:

Everything is up to date.              
ERROR: failed to pull data from the cloud - GDrive remote auth failed with credentials in 'GDRIVE_CREDENTIALS_DATA'.
Backup first, remove or fix them, and run DVC again.
It should do auth again and refresh the credentials.

Things I am unsure about.

  1. Is the GDRIVE_CREDENTIALS_DATA environment variable the right name DVC commands looks for?
  2. Which JSON content should this environment variable have?
    • .dvc/tmp/gdrive-user-credentials.json ?
    • Google Service account JSON looking like this?
  "type": "service_account",
  "project_id": "<my_project>",
  "private_key_id": "<key_id>",
  "private_key": "<key_hash>",
  "client_email": "<>",
  "client_id": "<client_id>",
  "auth_uri": "",
  "token_uri": "",
  "auth_provider_x509_cert_url": "",
  • Or Google client secret JSON looking like this?
  "installed": {
    "client_id": "<google_client_id>",
    "project_id": "<google_project_id>",
    "auth_uri": "",
    "token_uri": "",
    "auth_provider_x509_cert_url": "",
    "client_secret": "<client_secret>",
    "redirect_uris": [
  1. Is the 1st time google browser authentication step still required for CI machines?

Many thanks

I guess you had met a bug , you can try to set any value for gdrive_service_account_json_file_path and try again.

Yea, that git-issue is one of the links I was looking at because it reports a working alternative to the bug. You’ll note I followed the same DVC setup but I am still not able to get DVC pulling data, so I must be missing something…

The problem is that my CI machine still goes through GDrive’s Oauth interactive mechanism to authenticate via the browser, but the GDrive service credentials passed through the environment variable seem are either not read, or are not set properly by me.

Answers to any of my 3 questions would help narrow down things.