rclone: googleapi: Error 403: Only files with binary content can be downloaded

What is the problem you are having with rclone?

Within last 24 hours, a cronjob that runs rclone started returning the following error for some files:

2021/07/09 17:09:10 ERROR : XXX: Failed to copy: failed to open source object: open file failed: googleapi: Error 403: Only files with binary content can be downloaded. Use Export with Docs Editors files., fileNotDownloadable

The file itself is not new; it has been on the Drive for quite some time.

What is your rclone version (output from rclone version)

$ rclone version
rclone v1.55.1-DEV
- os/type: linux
- os/arch: amd64
- go/version: go1.16.5
- go/linking: dynamic
- go/tags: cmount

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
$ uname -a
Linux debian 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

Which cloud storage system are you using? (e.g. Google Drive)

Google Drive.

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

rclone sync --exclude /XXX/ googledrive: /path/to/google_drive/

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

I will dump, redact and provide it later if necessary.

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don’t comment if you have no relevant information to add. It’s just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 26 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for testing @Nicuz.

I’ve merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.56 which should be very soon.

Thanks @hoxu that JSON dump was exactly what I needed.

The problem is that this object is reporting a size

  "size": "71250",                                                                                                                                                                                                 

But rclone assumes anything with a size or an md5 checksum is a file, not a google doc

https://github.com/rclone/rclone/blob/c0b2832509c8c1678de4982e4a91ce691091c078/backend/drive/drive.go#L1324-L1327

So this has changed for some reason.

If I check out the docs I see this

property type description
md5Checksum string The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
size long The size of the file’s content in bytes. This is applicable to binary files in Google Drive and Google Docs files.

I am pretty sure that size didn’t used to be applicable to google docs files.

Anyway here is a potential fix - can anyone having this problem give it a go please?

v1.56.0-beta.5586.c4aabaf49.fix-5455-drive-docs on branch fix-5455-drive-docs (uploaded in 15-30 mins)

Same issue here, some selected gSheets giving the reported error. Looking at similar files, I’ve noted that the erratic one has a size value (like 50K).

Workaround Just make a copy of the gSheet on gDrive. The new copy doesn’t have size allocated and works flawlessly with rclone.

Hope it helps.

For the sake of completeness: I tested with https://beta.rclone.org/rclone-beta-latest-linux-amd64.zip

rclone v1.56.0-beta.5587.94b143929
- os/version: debian 10.10 (64 bit)
- os/kernel: 4.19.0-16-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.16.5
- go/linking: static
- go/tags: none

Problem fixed. Thanks for the swift fix @ncw!

@ncw Thank you! I must say I’m impressed by the speed with which this was addressed, and the cooperation of everyone!