Unable to connect with GDrive using own client ID

What is the problem you are having with rclone?

I want to set up Google Drive with my own client id but encounters errors. I confirmed that when using the default rclone account it works just fine, so the issue does actually lie in my own client configuration.

I get this when trying to use gdrive after rclone configuration:

amil ~$rclone lsd gdrive:
2025/09/28 16:53:15 CRITICAL: Failed to create file system for "gdrive:": drive: failed when making oauth client: failed to create oauth client from service account: error processing credentials: google: read JWT from JSON credentials: 'type' field is "" (expected "service_account")

Run the command 'rclone version' and share the full output of the command.

rclone v1.71.1

    os/version: debian 13.1 (64 bit)

    os/kernel: 6.12.48+deb13-amd64 (x86_64)

    os/type: linux

    os/arch: amd64

    go/version: go1.25.1

    go/linking: static

    go/tags: none

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[gdrive]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
service_account_file = /home/kamil/Misc/client_secret_2_182205354389-uc5koobu5luhgal4ia7c5h2j1jk2jikb.apps.googleusercontent.com.json
team_drive =

A log from the command that you were trying to run with the -vv flag

kamil ~$rclone lsd -vv gdrive:
2025/09/28 17:01:42 DEBUG : rclone: Version "v1.71.1" starting with parameters ["rclone" "lsd" "-vv" "gdrive:"]
2025/09/28 17:01:42 DEBUG : Creating backend with remote "gdrive:"
2025/09/28 17:01:42 DEBUG : Using config file from "/home/kamil/.config/rclone/rclone.conf"
2025/09/28 17:01:42 CRITICAL: Failed to create file system for "gdrive:": drive: failed when making oauth client: failed to create oauth client from service account: error processing credentials: google: read JWT from JSON credentials: 'type' field is "" (expected "service_account")Paste  log here

welcome to the forum,

afiak, use client_id or service account file, but not both in the same remote
as the file contains the the client_id

[gdrivesa]
type = drive
scope = drive
service_account_file = d:\data\rclone\other\gdrive.sa\testunv-d0540da87aac.json
{
  "type": "service_account",
  "project_id": "testunv",
  "private_key_id": "redacted",
  "private_key": "-----BEGIN PRIVATE KEY-----\nredacted-----END PRIVATE KEY-----\n",
  "client_email": "test01@testunv.iam.gserviceaccount.com",
  "client_id": "redacted",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test01%40testunv.iam.gserviceaccount.com",
  "universe_domain": "googleapis.com"
}

Hi,

Tried only one of them separately and it does not resolve the error that I mentioned.

1 Like
rclone lsd gdrivesa: -vv
DEBUG : rclone: Version "v1.71.0" starting with parameters ["rclone" "lsd" "gdrivesa:" "-vv"]
DEBUG : Creating backend with remote "gdrivesa:"
DEBUG : Using config file from "d:\\data\\rclone\\rclone.conf"
DEBUG : Google drive root '': 'root_folder_id = 0ACOpOHt_iA2eUk9PVA' - save this in the config to speed up startup
           0 2024-09-13 11:10:11        -1 zork

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.