rclone icon indicating copy to clipboard operation
rclone copied to clipboard

dropbox: Unable to decrypt returned paths from changeNotify

Open dennisoderwald opened this issue 5 years ago • 38 comments

What is the problem you are having with rclone?

As soon as many files are tried to be read at the same time, the "too_many_requests/..: Too many requests or write operations. Trying again in 300 seconds." error occurs. From that point on, no further log entries appear and the mount seems to have hung up. Neither a timeout nor any other attribute helps. Only a restart of the service solves the problem.

An attempt at 'df -h' or an 'ls' freezes completely.

With my Google Drive mount, the problem does not occur. I get i/o errors sometimes but it does not freeze.

What is your rclone version (output from rclone version)

rclone v1.54.1

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

Ubuntu 18.04

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

Dropbox

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

/usr/bin/rclone mount \
  --user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' \
  --config=/home/admin/.config/rclone/rclone.conf \
  --allow-other \
  --allow-non-empty \
  --rc \
  --rc-addr=localhost:5572 \
  --fast-list \
  --vfs-read-chunk-size=64M \
  --vfs-read-chunk-size-limit=2048M \
  --buffer-size=64M \
  --dir-cache-time=1h \
  --timeout=1m \
  --attr-timeout=10m \
  --dropbox-chunk-size=64M \
  --umask=002 \
  --syslog \
  -vvv \
  dropbox: /mnt/remote

dennisoderwald avatar Mar 24 '21 01:03 dennisoderwald

Can you try the latest beta and see if you can reproduce the issue with it? If so, please paste the log from that.

darthShadow avatar Mar 24 '21 04:03 darthShadow

@darthShadow Thank you for your quick support. I'll test it out and get back to you.

dennisoderwald avatar Mar 24 '21 09:03 dennisoderwald

I am now testing with the following version:

rclone v1.55.0-beta.5334.d6870473a
- os/type: linux
- os/arch: amd64
- go/version: go1.16.2
- go/linking: static
- go/tags: cmount

A message that I did not notice before or did not appear where I am at a loss right now. There are just increased problems that occur with individual folders:

2021/03/24 10:53:53 NOTICE: Encrypted drive 'dropbox:': ChangeNotify was unable to decrypt "1l77gk0gcijgrei4hlvr7ugoc/569vnmue4q5nvl9s5rhu8h2bt8/u8kc3jgspqf9sgh1ndi38nopmf9n5cdnpmbugv8k9sr8b5squlnt85l00sah3gp239oear3khr8je": illegal base32 data at input byte 25
2021/03/24 10:53:53 NOTICE: Encrypted drive 'dropbox:': ChangeNotify was unable to decrypt "1l77gk0gcijgrei4hlvr7ugoc/569vnmue4q5nvl9s5rhu8h2bt8/u8kc3jgspqf9sgh1ndi38nopmf9n5cdnpmbugv8k9sr8b5squlnt85l00sah3gp239oear3khr8je/f68s6an5n2fmffai81oqumadhfcmb8qj7omahnae53u3l9sm8uut9u2pg8q525q3p1o0n34g25pgu": illegal base32 data at input byte 25

Otherwise, it runs just felt more stable... but I continue to observe it...

dennisoderwald avatar Mar 24 '21 09:03 dennisoderwald

Can you please add your redacted config?

darthShadow avatar Mar 24 '21 11:03 darthShadow

@wolveix Can you take a look at this? I am guessing the entryPath manipulation we are doing in the changeNotifyRunner function in the dropbox remote is breaking the crypt decryption logic.

darthShadow avatar Mar 24 '21 11:03 darthShadow

I'll look into this shortly.

robtme avatar Mar 24 '21 11:03 robtme

Can you please add your redacted config?

[dropbox_unencrypted]
type = dropbox
token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2021-03-24T14:47:11.666625156+01:00"}

[dropbox]
type = crypt
remote = dropbox_unencrypted:Folder/Folder
filename_encryption = standard
directory_name_encryption = true
password = XXX (62 length)
password2 = XXX (62 length)

dennisoderwald avatar Mar 24 '21 12:03 dennisoderwald

Do I understand this correctly: Everything is fine with my data, but polling is supported in the beta and here decryption does not work for data checked via polling?

dennisoderwald avatar Mar 25 '21 10:03 dennisoderwald

Yes, you are correct.

darthShadow avatar Mar 25 '21 12:03 darthShadow

Yes, you are correct.

Okay, then I am reassured :) And look forward to @wolveix his fix.

dennisoderwald avatar Mar 25 '21 12:03 dennisoderwald

I'll look into this shortly.

@wolveix Have you had time to look at it? :)

dennisoderwald avatar Mar 29 '21 12:03 dennisoderwald

I'll look into this shortly.

@wolveix Have you had time to look at it? :)

Sorry for the wait, been a busy week. I'll make sure to review this tomorrow :)

robtme avatar Mar 31 '21 00:03 robtme

By the way, the original problem is not fixed with the latest beta. :( I first thought that this is now fixed but I guess I was wrong.

dennisoderwald avatar Mar 31 '21 19:03 dennisoderwald

Working on a fix now. I believe I've resolved the decryption issue, but I'm unsure about the original issue described in this request.

robtme avatar Apr 01 '21 00:04 robtme

I was able to narrow it down to something to do with API errors like "too_many_requests" and the associated rate limit. It seems that not only new requests are postponed but also entries that actually come from the cache are not answered anymore.

dennisoderwald avatar Apr 01 '21 00:04 dennisoderwald

Thanks. Yeah, I've noticed the same behaviour a couple of times. It does eventually resolve itself in my experience, but it's not ideal and I'd like to gain a better understanding as to why it's happening. I don't believe it's an issue strictly with the polling implementation, but I can't say for sure. I'll continue reviewing this prior to committing the potential fix for the decryption issue, but it'd be great if @ncw could find the time to also review this.

robtme avatar Apr 01 '21 00:04 robtme

Okay, a few interesting notes. In my testing, I create a directory containing a bunch of files (I just do cp */*.go thisisatest/ from rclone's source and upload the resulting directory), delete a couple of files, and make sure between actions that the changes are reflected via polling to a mount.

One thing I can consistently reproduce is this: if you touch two files, then upload them via rclone move remote:/file_name with about a second between the uploads, the first one will always be picked up just fine through polling. The second one will always encounter a decrypt failure. If you upload a folder with many files in, it will usually be picked up without issue.

I'm going to spend more time going over the full existing implementation tomorrow. The strange thing is that my server (running v1.55.0-beta.5239.b029fb591) has been running for a month without issues (no decrypt errors in the log). But when carrying out the same testing as above, the issues are correctly reproduced. But my regular uploads are absolutely fine.

robtme avatar Apr 01 '21 02:04 robtme

@dennisoderwald do you happen to be using this with cloudbox? I've been trying for weeks to get polling to work. Does not seem to work on encrypted or unencrypted dropbox remotes.

jkristoph avatar Apr 05 '21 14:04 jkristoph

@dennisoderwald do you happen to be using this with cloudbox? I've been trying for weeks to get polling to work. Does not seem to work on encrypted or unencrypted dropbox remotes.

No, outside of cloudbox. However, this has nothing to do with cloudbox, so the issue.

dennisoderwald avatar Apr 05 '21 14:04 dennisoderwald

@dennisoderwald do you happen to be using this with cloudbox? I've been trying for weeks to get polling to work. Does not seem to work on encrypted or unencrypted dropbox remotes.

No, outside of cloudbox. However, this has nothing to do with cloudbox, so the issue.

I was just grabbing at straws, I've been unable to get polling to work. I'm pulling out my hair.

jkristoph avatar Apr 05 '21 14:04 jkristoph