Proton Drive: gopenpgp: error in reading key ring: openpgp

What is the problem you are having with rclone?

I tried to follow the instructions from Proton Drive, but there is no option for protondrive. Therefore, I did create a config file and received the following error message:

2024/12/22 17:49:07 Failed to create file system for "remote:": didn't find backend called "protondrive"

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

rclone 1.64.2
- os/version: fedora 40 (64 bit)
- os/kernel: 6.11.10-200.fc40.x86_64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.6
- go/linking: dynamic
- go/tags: none

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

protondrive

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

rclone lsd remote:

The rclone config contents with secrets removed.

[remote]
type = protondrive
username = 
password = 

A log from the command with the -vv flag

2024/12/22 17:55:37 DEBUG : rclone: Version "1.64.2" starting with parameters ["rclone" "lsd" "remote:" "-vv"]
2024/12/22 17:55:37 DEBUG : Creating backend with remote "remote:"
2024/12/22 17:55:37 DEBUG : Using config file from "/home/[user]/.config/rclone/rclone.conf"
2024/12/22 17:55:37 Failed to create file system for "remote:": didn't find backend called "protondrive"

Please use the latest rclone (1.68.2 as now). It does not really matter what worked or not in some historical rclone. Your version is 9 releases behind.

Nobody is going to investigate it.

Thank you, I have upgraded to the lastest version, the option for the proton backend is now available and the config file was generated automatically. The following error occurs with the same command (rclone lsd proton):

2024/12/22 18:15:29.279146 WARN RESTY gopenpgp: error in reading key ring: openpgp: invalid data: user ID signature with wrong type, Attempt 1
2024/12/22 18:15:29.279204 ERROR RESTY gopenpgp: error in reading key ring: openpgp: invalid data: user ID signature with wrong type
2024/12/22 18:15:29 CRITICAL: Failed to create file system for "proton:": couldn't initialize a new proton drive instance: gopenpgp: error in reading key ring: openpgp: invalid data: user ID signature with wrong type

as per docs:

NOTE: The Proton Drive encryption keys need to have been already generated after a regular login via the browser, otherwise attempting to use the credentials in rclone will fail.

secondly have you created your config manually? is your password obfuscated?

Do you use 2FA?

The GPG key from proton was already in use (online and also via local import).

No, the config was generated automatically, Yes, the password is base64 encoded.

Yes, I use 2FA and provided the OTP-token from the Authenticator App.

Indeed we have an issue.

I have tried with my free proton account. First time I had:

$ rclone lsd protondrive:
2024/12/22 20:02:51.969093 WARN RESTY 422 POST https://mail.proton.me/api/auth/v4: For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/appeal-abuse (Code=9001, Status=422), Attempt 1
2024/12/22 20:02:51.969192 ERROR RESTY 422 POST https://mail.proton.me/api/auth/v4: For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/appeal-abuse (Code=9001, Status=422)
2024/12/22 20:02:51 CRITICAL: Failed to create file system for "protondrive:": couldn't initialize a new proton drive instance: 422 POST https://mail.proton.me/api/auth/v4: For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/appeal-abuse (Code=9001, Status=422)

but after logging in into web UI and completing some CAPTCHA:

$ rclone lsd protondrive:
2024/12/22 20:04:26.483865 WARN RESTY 422 POST https://mail.proton.me/api/auth/v4/2fa: Incorrect login credentials. Please try again. (Code=8002, Status=422), Attempt 1
2024/12/22 20:04:26.483943 ERROR RESTY 422 POST https://mail.proton.me/api/auth/v4/2fa: Incorrect login credentials. Please try again. (Code=8002, Status=422)
2024/12/22 20:04:26 CRITICAL: Failed to create file system for "protondrive:": couldn't initialize a new proton drive instance: 422 POST https://mail.proton.me/api/auth/v4/2fa: Incorrect login credentials. Please try again. (Code=8002, Status=422)

of course my 2FA expired so I updated 2FA in config file (you have to update it and then run some rclone command as long as it is valid):

$ rclone lsd protondrive:
          -1 2023-11-22 20:05:00        -1 Test
          -1 2023-11-07 15:33:35        -1 proton-test

After that config file looks like this:

[protondrive]
type = protondrive
username = redacted
2fa = 123456
client_uid = redacted
client_access_token = redacted
client_refresh_token = redacted
client_salted_key_pass = redacted

It tells me that your account behaves differently.

I use a custom domain with proton, does it work for you with a custom domain?

The client*-paramaters are not generated with my setup, maybe due to the failed initial login.

It also failed with my original proton mail address :-/

It might be a clue.

Protondrive remote is in beta with multiple issues still reported on this forum.

Let's see if remote's author can comment here.

@henrybear327 would you mind to have a look?

Also please note that all users reports point into abyssal performance with rclone and stories of outright blocking of rclone.

Existing remote is reverse engineered attempt to try to make something working.

As long as protodrive is not interested in publishing documented API and working with 3rd party tools I am afraid it is only experimental stuff. Not worth spending time if needed for anything more serious. At least this is my opinion.

At least, the did put Linux support on their roadmap (information from 25/11/2024) with a SDK for 2025: "One thing we are doing to move Drive for Linux forward is building a software development kit (SDK), so that members of the community can contribute to this journey, too."

This would be great if it happens indeed