That is the structure of the credential file, down to (almost) a tee - my token_uri is different, though this is likely because I am using Cloud Identity rather than the usual google sign-in. Nonetheless, the credential file is unaltered and works with 1.43.
I also tested with 1.44 and can confirm that it does not work with 1.44
$ git show 6b8b9d19f399ec281548faec7154ad3fe61b2ee8
commit 6b8b9d19f399ec281548faec7154ad3fe61b2ee8
Author: Fabian Möller <fabianm88@gmail.com>
Date: Tue Sep 4 12:28:45 2018 +0200
googlecloudstorage: fix service_account_file been ignored - Fixes #2523
diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.go
index 1d74bccaf..2f47d9156 100644
--- a/backend/googlecloudstorage/googlecloudstorage.go
+++ b/backend/googlecloudstorage/googlecloudstorage.go
@@ -345,7 +345,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
}
// try loading service account credentials from env variable, then from a file
- if opt.ServiceAccountCredentials != "" && opt.ServiceAccountFile != "" {
+ if opt.ServiceAccountCredentials == "" && opt.ServiceAccountFile != "" {
loadedCreds, err := ioutil.ReadFile(os.ExpandEnv(opt.ServiceAccountFile))
if err != nil {
return nil, errors.Wrap(err, "error opening service account credentials file")
Which means that in rclone 1.43 rclone isn’t loading the credentials from a file at all. If I try 1.43 I get this
$ rclone-v1.43.1 lsd gcs-iam:
2018/12/05 10:05:38 Failed to create file system for "gcs-iam:": failed to configure Google Cloud Storage: empty token found - please run rclone config again
So I conjecture that you are loading the token either from the config file using this.
–gcs-service-account-credentials
Service Account Credentials JSON blob
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Config: service_account_credentials
Env Var: RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS
Type: string
Default: “”
Can you show your config please (scrub any tokens from it) and describe how you are configuring rclone if it isn’t in the config file - thanks!
I'm getting the same issue. I am using rclone config to create the configuration but just can't seem to get it to work with SA JSON file. I am running it from a GCP VM so there is no ability to call out to a web browser for authentication with an account so I have to get the SA JSON part working.
arnold@rclonelinux1:~/rclone-v1.48.0-linux-amd64$ rclone listremotes
rcloneone:
arnold@rclonelinux1:~/rclone-v1.48.0-linux-amd64$ rclone ls rcloneone:
2019/08/14 19:31:58 Failed to create file system for "rcloneone:": failed configuring Google Cloud Storage Service Account: error processing credentials: invalid character 'r' looking for beginning of value
arnold@rclonelinux1:~/rclone-v1.48.0-linux-amd64$ rclone ls rcloneone:rclonestore
2019/08/14 19:32:25 Failed to create file system for "rcloneone:rclonestore": failed configuring Google Cloud Storage Service Account: error processing credentials: invalid character 'r' looking for beginning of value
arnold@rclonelinux1:~/rclone-v1.48.0-linux-amd64$
arnold@rclonelinux1:~/rclone-v1.48.0-linux-amd64$ rclone ls rclone2:
2019/08/14 20:48:46 Failed to create file system for "rclone2:": failed configuring Google Cloud Storage Service Account: error processing credentials: invalid character 'r' looking for beginning of value