Cannot connect to Google Drive

I have tried multiple times with GUI and TUI (as well as downloading my credentials). I can go through the process w/o any problems, but when I attempt to mount or browse:

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")

What is the problem you are having with rclone?

Unable to connect to Google Drive. I have set it up w/ both the TUI and GUI, as well as created a new oauth client id file and used that (had a previous one from trying rclone some time ago).

No FUSE errors (and it works fine for other chores).

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

- os/version: opensuse-leap 15.5 (64 bit)
- os/kernel: 5.14.21-150500.55.19-default (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.4
- go/linking: dynamic
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

I double checked and the API is enabled.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount gdrive: ~/g

(where 'g' is an empty directory--yes, I am that lazy)

 12:43 ~ $  rclone ls gdrive:
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")

The rclone config contents with secrets removed.

[Dropbox]
type = dropbox
token = ```
Drop box works fine

```[gdrive]
type = drive
client_id = [myid].apps.googleusercontent.com
client_secret = [mysecret]
scope = drive
service_account_file = /home/kevin/.config/rclone/client_secret_[somecrap]apps.googleusercontent.com.json
copy_shortcut_content = true
export_formats = odt,ods,odp,odg,svg
team_drive = 

My client secret file looks like:
{"installed":{"client_id":"[id].apps.googleusercontent.com","project_id":"mygdrive-[digits]","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_secret":"[shhhh, it is a secret]","redirect_uris":["http://localhost"]}}

A log from the command with the -vv flag

 12:45 ~ $  rclone ls -vv gdrive:
<7>DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "ls" "-vv" "gdrive:"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "gdrive:"
<7>DEBUG : Using config file from "/home/kevin/.config/rclone/rclone.conf"
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")

My PC info:

System:
  Host: localhost.localdomain Kernel: 5.14.21-150500.55.19-default
    arch: x86_64 bits: 64 compiler: gcc v: 7.5.0 Desktop: KDE Plasma v: 5.27.7
    Distro: openSUSE Leap 15.5

welcome to the forum,

  • make sure simple rclone ls works, before trying rclone mount
  • would not use both client_id/secret and service_account_file in the same rclone remote
    or can choose to use neither.
[gdrive.sac]
type = drive
scope = drive
service_account_credentials = {"type": "service_account", "project_id": "",   "private_key_id": "",   "private_key": "-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n",   "client_email": ".iam.gserviceaccount.com",   "client_id": "",   "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/.iam.gserviceaccount.com" }