I am getting an odd result using rclone with service accounts in My Drive on a G Suite account. Using version 1.49.0-013 now, but had exactly the same results with all recent releases and beta versions. [EDIT: Installed 1.49.1 and same result.]
A folder called Media in remote gdrive is shared with an email for a service account using 1.json. I have double checked that the json contents include the specific email that Media has been shared to.
Command 1 shows the correct count of all files and a correct size for the folder Media.
If I run Command 2 below with --drive-shared-with-me and --drive-service-account-file flags it shows a size and file count which only includes some of the files in Media.
If I create an alias remote using exactly the same --drive-shared-with-me and --drive-service-account-file flags and values and run Command 3 then rclone shows the correct/full size and file count.
In principle Commands 2 and 3 should show exactly the same result. But they do not.
I have repeated this process with other accounts, folders and jsons and get a very similar (inconsistent) result, where flags in the command line give me partial access to files in a folder, whereas creating an alias with the same flags gives full access.
I have repeated the experiment with rclone lsd, lsf as well as with rclone copy and sync. In each case the result is the same. Command line flags seem to not give the same result as using the same flags in an alias remote.
All of the above occurs only when using My Drive folders. When using the same configuration and commands on Team Drives everything works perfectly.
I repeated the commands with -vv and -vvv but there are no errors at all.
Thank you as always. rclone continues to be astonishingly useful in all other respects.
Command 1 gives correct result:
root@gce:# rclone size gdrive:Media
Total objects: 51343
Total size: 34.467 TBytes (37897044011916 Bytes)
Command 2 gives incorrect result using shared and SA flags:
root@gce:# rclone size gdrive:Media --drive-shared-with-me=true --drive-service-account-file=/sa/1.json
Total objects: 691
Total size: 235.971 GBytes (253371929943 Bytes)
Command 3 gives correct result using exact same shared and SA flags:
root@gce:# rclone size alias2:Media
Total objects: 51343
Total size: 34.467 TBytes (37897044011916 Bytes)
root@gce:# rclone config show alias2
[alias2]
type = alias
remote = gdrive:
shared_with_me = true
service_account_file = /sa/1.json