Issue Uploading Non-Empty Files to Proton Drive with rclone v1.66.0

What is the problem you are having with rclone?

Uploading files to a Proton Drive remote that contain content is no longer functional for me. This was working flawlessly a couple of days ago and still is for blank files. I am not aware that I have made any changes relevant to this issue.

I'm not sure if this is an issue on my side, if the API changed, or something entirely else. If someone could share their experience, I would appreciate it.

Things I've tried

I've tried on a different machine using Arch as well as using the beta version. I've disabled Proton Sentinel and disabled the version history. I've run the commands from different networks, and I can confirm that I can upload files (e.g., 0002.txt) via the web interface, though it does prompt me for a duplicate file.

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

rclone v1.66.0

  • os/version: ubuntu 23.10 (64 bit)
  • os/kernel: 6.5.0-28-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.1
  • go/linking: static
  • go/tags: snap

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

Proton Drive

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

A sequence of commands that reproduces the issue for me

$ touch 0001.txt
$ touch 0002.txt
$ vim 0002.txt 
$ cat 0002.txt 
This is a textfile
$ rclone copy 0001.txt proton:
$ rclone copy 0002.txt proton:

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

[proton]
type = protondrive
username = XXX
password = XXX
2fa = XXX
client_uid = XXX
client_access_token = XXX
client_refresh_token = XXX
client_salted_key_pass = XXX
### Double check the config for sensitive info before posting publicly

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

2024/04/23 21:05:55 DEBUG : rclone: Version "v1.66.0" starting with parameters ["/snap/rclone/495/bin/rclone" "copy" "0002.txt" "proton:" "-vv"]
2024/04/23 21:05:55 DEBUG : Creating backend with remote "0002.txt"
2024/04/23 21:05:55 DEBUG : Using config file from "/home/user/snap/rclone/495/.config/rclone/rclone.conf"
2024/04/23 21:05:55 DEBUG : fs cache: adding new entry for parent of "0002.txt", "/home/user/Documents"
2024/04/23 21:05:55 DEBUG : Creating backend with remote "proton:"
2024/04/23 21:05:55 DEBUG : proton drive root link ID '': Has cached credentials
2024/04/23 21:05:57 DEBUG : proton drive root link ID '': Used cached credential to initialize the ProtonDrive API
2024/04/23 21:05:58 DEBUG : 0002.txt: Need to transfer - File not found at Destination
2024/04/23 21:05:58.941983 WARN RESTY 400 POST https://mail.proton.me/api/drive/blocks: You are using an outdated version of the app. Please update to upload this file’ (Code=2000, Status=400), Attempt 1
2024/04/23 21:05:58.942033 ERROR RESTY 400 POST https://mail.proton.me/api/drive/blocks: You are using an outdated version of the app. Please update to upload this file’ (Code=2000, Status=400)
2024/04/23 21:05:58 ERROR : 0002.txt: Failed to copy: 400 POST https://mail.proton.me/api/drive/blocks: You are using an outdated version of the app. Please update to upload this file’ (Code=2000, Status=400)
2024/04/23 21:05:58 ERROR : Attempt 1/3 failed with 1 errors and: 400 POST https://mail.proton.me/api/drive/blocks: You are using an outdated version of the app. Please update to upload this file’ (Code=2000, Status=400)
2024/04/23 21:05:59 DEBUG : 0002.txt: Need to transfer - File not found at Destination
2024/04/23 21:06:00.221545 WARN RESTY 422 POST https://mail.proton.me/api/drive/shares/.../files: A file or folder with that name already exists (Code=2500, Status=422), Attempt 1
2024/04/23 21:06:00.221588 ERROR RESTY 422 POST https://mail.proton.me/api/drive/shares/.../files: A file or folder with that name already exists (Code=2500, Status=422)
2024/04/23 21:06:01 ERROR : 0002.txt: Failed to copy: a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt. Can use --protondrive-replace-existing-draft=true to temporarily override the existing draft
2024/04/23 21:06:01 ERROR : Attempt 2/3 failed with 1 errors and: a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt. Can use --protondrive-replace-existing-draft=true to temporarily override the existing draft
2024/04/23 21:06:02 DEBUG : 0002.txt: Need to transfer - File not found at Destination
2024/04/23 21:06:03.394869 WARN RESTY 422 POST https://mail.proton.me/api/drive/shares/.../files: A file or folder with that name already exists (Code=2500, Status=422), Attempt 1
2024/04/23 21:06:03.394909 ERROR RESTY 422 POST https://mail.proton.me/api/drive/shares/.../files: A file or folder with that name already exists (Code=2500, Status=422)
2024/04/23 21:06:04 ERROR : 0002.txt: Failed to copy: a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt. Can use --protondrive-replace-existing-draft=true to temporarily override the existing draft
2024/04/23 21:06:04 ERROR : Attempt 3/3 failed with 1 errors and: a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt. Can use --protondrive-replace-existing-draft=true to temporarily override the existing draft
2024/04/23 21:06:04 INFO  : 
Transferred:   	         19 B / 19 B, 100%, 3 B/s, ETA 0s
Errors:                 1 (retrying may help)
Elapsed time:         8.8s

2024/04/23 21:06:04 DEBUG : 6 go routines active
2024/04/23 21:06:04 Failed to copy: a draft exist - usually this means a file is being uploaded at another client, or, there was a failed upload attempt. Can use --protondrive-replace-existing-draft=true to temporarily override the existing draft

Using the flag --protondrive-replace-existing-draft=true changes the error message for the failed copy to:

2024/04/23 21:09:55 ERROR : 0002.txt: Failed to copy: 400 POST https://mail.proton.me/api/drive/blocks: You are using an outdated version of the app. Please update to upload this file’ (Code=2000, Status=400)

From the start Proton remote was only in beta with probably still some issues waiting to be ironed. At the moment it does not have anybody actively working on it and original author went quiet. Unfortunately it means that state of this remote slowly deteriorate. Bugs are not fixed and any changes on Proton side are not incorporated.

All together IMO means that until somebody decides to work on Proton remote its usage is not advisable.

Any help here would be welcomed.

Aw, that's a shame, but thanks for the insight. I'm not very familiar with Go, but perhaps I'll dive into it out of personal interest when I find some time.

2 Likes

I think I figured out why Proton Drive broke.

Yesterday, there was a commit in the go-proton-api repo that updates the Go version to 1.21 (it's been in version 1.18 for a while):

Since the rclone backend for Proton Drive is using the Proton-API-Bridge, which is based on the fork of the go-proton-api, this fork will need to update their Go version to 1.21 too.

Until that can be updated, I guess Proton Drive can't be used in rclone.

1 Like

Good sleuthing.

This fork was created by rclone Proton remote author. Unless he does it what is needed is to fork it again, make required changes and update rclone part.

This is also this remote challenge - it uses custom Proton-API-Bridge which has to be maintained as well. Much more complex than other remotes.

Without somebody taking care of it we have classing software rot situation.

Even after updating the Go version to 1.21, the Proton-API-Bridge fork still fails to upload files for me with the same "outdated" error. I also think that I noticed the failed uploads prior to the commit on the go-proton-api.

There's also something going on with the tests in that library where various functions only seem to work sporadically.

Hey thanks for reporting!

I am aware and working on this!

There is a new mechanism introduced by the upstream regarding uploading and I will try to make a fix this weekend!

5 Likes

Thanks for the update and for your work on the integration of the backend! If you need any help with the new fix, I'd be glad to try and help out.

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