Unexpected EOF on crypt remote

Hi, proper head scratcher for me so hoping for some help -

What is the problem you are having with rclone?

I've noticed that I am getting a lot of 'unexpected EOF' errors in large sync jobs between crypted Gdrive remotes for many months now of seemingly random files - and the list of those are getting longer by the week.

The 'unexpected EOF' files are also always the same files and I'm never able to copy them at all, however I can copy their encrypted versions but I can never get it working properly even with a local crypt with the same keys.

To be clear - regardless of how many times I re-attempt, I always get 'unexpected EOF' for a growing number of files.

What is your rclone version (output from rclone version)

rclone v1.51.0

  • os/arch: linux/amd64
  • go version: go1.13.7

Although this has been happening at a smaller scale for 6 months+ so doubt it is a recent issue.

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

Linux 64

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

Google Drive & local crypt shown below

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

As mentioned above, this has been happening on Google Drive for me but I've managed to also reproduce it locally by copying the obfuscated filename and using the same crypt keys as the Gdrive remote - so here is my config:

[localtest]
type = local

[localtest-data]
type = crypt
remote = localtest:
filename_encryption = standard
password = A_LONG_STRING
password2 = ANOTHER_LONG_STRING
Copying from Gdrive the encrypted version

This is just to get a file with a known 'unexpected EOF' to my local filesystem...

$ rclone cryptdecode --reverse gdrive-encrypted: testfile2.mkv
testfile2.mkv    16gsfvl4v2c5tr4tzun21tngt3
$ rclone copy gdrive:stuff/16gsfvl4v2c5tr4tzun21tngt3 .
$ echo $?
0
$ ls -al 16gsfvl4v2c5tr4tzun21tngt3
-rw-r--r-- 1 linhead linhead 208553728 Apr  1 23:02 16gsfvl4v2c5tr4tzun21tngt3
To prove that my localtest and localtest-data equates to the GoogleDrive one above, I can decrypt the filenames with the same keys OK
$ rclone cryptdecode --reverse localtest-data: testfile2.mkv
testfile2.mkv    16gsfvl4v2c5tr4tzun21tngt3

$ rclone ls localtest:
208553728 16gsfvl4v2c5tr4tzun21tngt3

$ rclone ls localtest-data:
208502784 testfile2.mkv
I can still copy the encrypted file fine on my local filesystem
$ rclone copy localtest:16gsfvl4v2c5tr4tzun21tngt3 /tmp
$ echo $?
0
But I cannot copy the crypt-remote version of the file at all
$ rclone copy localtest-data:testfile2.mkv /tmp
2020/04/01 23:06:25 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:06:26 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:06:27 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:06:28 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:06:28 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:06:29 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
^C
With more verbosity
$ rclone copy -vvv localtest-data:testfile2.mkv /tmp
2020/04/01 23:09:15 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "copy" "-vvv" "localtest-data:testfile2.mkv" "/tmp"]
2020/04/01 23:09:15 DEBUG : Using config file from "/home/linhead/.rclone.conf"
2020/04/01 23:09:15 DEBUG : testfile2.mkv: Need to transfer - File not found at Destination
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Reopening on read failure after 208470016 bytes: retry 1/10: unexpected EOF
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Reopen failed after 208470016 bytes read: unexpected EOF
2020/04/01 23:09:16 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Received error: unexpected EOF - low level retry 1/10
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Reopening on read failure after 208470016 bytes: retry 1/10: unexpected EOF
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Reopen failed after 208470016 bytes read: unexpected EOF
2020/04/01 23:09:16 NOTICE: testfile2.mkv: Removing partially written file on error: unexpected EOF
2020/04/01 23:09:16 DEBUG : testfile2.mkv: Received error: unexpected EOF - low level retry 2/10
^C
FWIW

In this particular file it always appears to be after byte 208470016 which = 0xC6D0000, so:

$ hexdump 16gsfvl4v2c5tr4tzun21tngt3 | grep -A8 ^c6cffd0
c6cffd0 6c10 0d6d da50 756e 9b32 8fae 9f3c c61d
c6cffe0 9296 1f48 f411 0434 05b9 e207 ff49 29ef
c6cfff0 a7ae d26b 84c2 d81c 6ead 35a5 0690 13cd
c6d0000 f03c 49f6 caf8 8249 4c86 6287 16fb 491a
c6d0010 97bc d203 d759 7388 38a9 cd9b 9503 4a91
c6d0020 23d7 062f 7883 8707 da5e 7f29 78be 98e0
c6d0030 60a9 cbfd 7fa9 9934 9426 fe59 ab86 be60
c6d0040 b650 4574 61a5 07cf 9741 d065 8503 6777
c6d0050 3e98 0cb3 eb3c 09b2 3ae1 d453 452c 122e

Other

I think I eliminated the usual suspects:

  • Renaming the file does not change the 'unexpected EOF' behaviour
  • Moving the paths of the 'dodgy' files also does not change the 'unexpected EOF' behaviour
  • It is not a local I/O issue, I can replicate it between Gdrives and local instances as well
  • I cannot do a cryptcheck as the original files are long gone
  • It always seems to be at the 99% point of the transfer of the file when the 'unexpected EOF' occurs if I watch the file increase in size locally as it copies
  • I notice that the obfuscated version of the file is ~50k larger than the decrypted, I assume it is expected but just mentioning if not

Thanks!
LH

That is a strange one!

My first thought is that your files have some sort of corruption in them. However I'd expect to see "failed to authenticate decrypted block - bad password?" errors as the authentication won't pass if the blocks are corrupted.

I just checked by making a 1 bit error in a crypt file and that is what I see

$ rclone cat --discard secret:10M
2020/04/02 18:16:25 ERROR : 10M: Failed to send to output: failed to authenticate decrypted block - bad password?
2020/04/02 18:16:25 Failed to cat: failed to authenticate decrypted block - bad password?

Hmm the crypt blocks are 64k plus a bit and the header so I wouldn't expect a corruption due to the block decoding to come in at a nice round hex number. But it might just be buffer size multiples...

What happens if you do

rclone cat -vvv localtest-data:testfile2.mkv >/tmp/testfile2.mkv

Do you get the same error?

How about if you try seeking past the troublesome area with the --offset flag?

I wonder if the file has been truncated, or has random data on the end? Either could explain the problem.

I just chopped one character off the end of a crypted file and it gives the same error. Adding 1 byte gives the same error.

$ rclone cat --discard secret:10M
2020/04/02 18:18:43 ERROR : 10M: Failed to send to output: unexpected EOF
2020/04/02 18:18:43 Failed to cat: unexpected EOF

Suspiciously your file is exactly a round hex number of bytes long

>>> hex(208470016)
'0xc6d0000'

So this could be some data truncation or possibly an off by one in the rclone buffer handling.

Probably the thing to do would be to make a crypted file which is exactly that long 0xc6d0000 - a bit of trial and error should do it! ANd see if it decrypts properly.

I'd do that myself but I have to dash off right now.

I did that and it worked fine... So not that!

1 Like

Thanks @ncw !

As you probably already figured out - yes same issue with cat:

$ rclone cat -vvv localtest-data:testfile2.mkv > /tmp/testfile2.mkv
2020/04/02 22:43:45 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "cat" "-vvv" "localtest-data:testfile2.mkv"]
2020/04/02 22:43:45 DEBUG : Using config file from "/home/linhead/.rclone.conf"
2020/04/02 22:43:46 ERROR : testfile2.mkv: Failed to send to output: unexpected EOF
2020/04/02 22:43:46 Failed to cat: unexpected EOF

Same story with making a file exactly 0xc6d0000 long, no issues at all with that.

To correct myself - I have 'unexpected EOF' on a number of files of many sizes, trying a random sample of known broken 'unexpected EOF's again just to check where in the file it breaks:

Decode known crypted locationof 'unexpected EOF' file
$ rclone cryptdecode --reverse gdrive-encrypted: download/webcams/dashcam02/20200312-12h32.mkv
download/webcams/dashcam02/20200312-12h32.mkv    2z1sdiw2szofw2343ose1h24eq/ooqbrrgea2ze1s34zdv5mfkmas/wgs1c4gw5ygi1n7n6kbosslcgot3i
1h4km613ftr8t8s5trssk30/yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e

...as this is the only way to copy it.

Showing both decrypted and obfuscated file sizes
$ rclone ls gdrive-encrypted:download/webcams/dashcam02/20200312-12h32.mkv
2721284096 20200312-12h32.mkv

$ rclone ls gdrive-encrypted/2z1sdiw2szofw2343ose1h24eq/ooqbrrgea2ze1s34zdv5mfkmas/wgs1c4gw5ygi1n7n6kbosslcgot3i1h4km613ftr8t8s5trss
k30/yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e
2721948512 yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e
Copying the 'broken' file locally without issue
$ rclone copy gdrive-encrypted/2z1sdiw2szofw2343ose1h24eq/ooqbrrgea2ze1s34zdv5mfkmas/wgs1c4gw5ygi1n7n6kbosslcgot3i1h4km613ftr8t8s5trssk30/yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e .
$ echo $?
0
Confirming we see it on my local directory with same crypt keys
$ rclone ls localtest-data:
2721284096 20200312-12h32.mkv
208502784 testfile2.mkv
Trying to copy the crypt copy with a failure again
$ rclone -vvv copy localtest-data:20200312-12h32.mkv /tmp
2020/04/02 23:19:15 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "-vvv" "copy" "localtest-data:20200312-12h32.mkv" "/tmp"]
2020/04/02 23:19:15 DEBUG : Using config file from "/home/linhead/.rclone.conf"
2020/04/02 23:19:15 DEBUG : 20200312-12h32.mkv: Sizes differ (src 2721284096 vs dst 2329739264)
2020/04/02 23:19:16 DEBUG : 20200312-12h32.mkv: Starting multi-thread copy with 4 parts of size 648.812M
2020/04/02 23:19:16 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 4/4 (2040987648-2721284096) size 648.781M starting
2020/04/02 23:19:16 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 2/4 (680329216-1360658432) size 648.812M starting
2020/04/02 23:19:16 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 1/4 (0-680329216) size 648.812M starting
2020/04/02 23:19:16 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 3/4 (1360658432-2040987648) size 648.812M starting
2020/04/02 23:19:33 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 2/4 (680329216-1360658432) size 648.812M finished
2020/04/02 23:19:33 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 3/4 (1360658432-2040987648) size 648.812M finished
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 1/4 (0-680329216) size 648.812M finished
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: Reopening on read failure after 680263680 bytes: retry 1/10: unexpected EOF
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: Reopen failed after 680263680 bytes read: unexpected EOF
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 4/4 failed: multpart copy: read failed: unexpected EOF
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: Received error: multpart copy: read failed: unexpected EOF - low level retry 1/10
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: Starting multi-thread copy with 4 parts of size 648.812M
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 4/4 (2040987648-2721284096) size 648.781M starting
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 2/4 (680329216-1360658432) size 648.812M starting
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 3/4 (1360658432-2040987648) size 648.812M starting
2020/04/02 23:19:36 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 1/4 (0-680329216) size 648.812M starting
2020/04/02 23:19:53 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 3/4 (1360658432-2040987648) size 648.812M finished
2020/04/02 23:19:53 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 1/4 (0-680329216) size 648.812M finished
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 2/4 (680329216-1360658432) size 648.812M finished
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: Reopening on read failure after 680263680 bytes: retry 1/10: unexpected EOF
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: Reopen failed after 680263680 bytes read: unexpected EOF
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 4/4 failed: multpart copy: read failed: unexpected EOF
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: Received error: multpart copy: read failed: unexpected EOF - low level retry 2/10
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: Starting multi-thread copy with 4 parts of size 648.812M
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 4/4 (2040987648-2721284096) size 648.781M starting
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 1/4 (0-680329216) size 648.812M starting
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 2/4 (680329216-1360658432) size 648.812M starting
2020/04/02 23:19:54 DEBUG : 20200312-12h32.mkv: multi-thread copy: stream 3/4 (1360658432-2040987648) size 648.812M starting
^C
EOF position

This time after byte 680263680 which is 0x288C0000 (again, perfectly round!), so:

$ hexdump yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e | grep -A8 ^288bffd0
288bffd0 a7eb 3d34 ddbb 76ed 07a5 6846 173a 1912
288bffe0 643d 3628 d21d 797c bc5a a421 e8fc 4b77
288bfff0 f3dd b10f 7fbc fffd bf81 c25a c782 f4d2
288c0000 92aa fee2 d2f4 905f 22e8 a516 9a99 b7ae
288c0010 522f 4d53 6888 a901 4ed3 6ef2 db36 b9ef
288c0020 dab7 3235 bd84 6145 4e7a 8b82 c4a8 c0d5
288c0030 6d54 a621 4b0c 02a9 49f6 e732 5b46 b9a1
288c0040 5cf0 5558 8931 2392 b2fb 161c f6d0 8b9e
288c0050 2186 c193 0b66 48fc 135e 2cf6 4188 0f5f

Non-the-wiser after the hexdump however, as you said - the perfect position points is very strange!

At a loss though!

A file with this raw size 2721948512 (0xa23da360) should have 2721284096 (0xa2338000) bytes of real data in (according to crypt)

Let's see whether I agree...

2721284096 / 65536 = 41523.5

So we have 41523 * 64k chunks + 32768 left over to make 41524 chunks

Each chunk has a 16 byte overhead and there is a 32 byte header so that makes the total overhead 41524*16+32 = 664416 to make the crypted size 664416+2721284096 = 2721948512 which agrees :slight_smile:

This goes wrong after byte 680263680+2040987648 = 2721251328 which is really close to the end 2721284096-2721251328 = 32768 bytes....

Probably what I should have done is asked you to tell me the size of the file that rclone cat produced. I suspect the file is only missing the last 32k of data.

I think looking through the code that in order to get an UnexpectedEOF error on the last 32k of data then the last chunk of the file is corrupt. Either corrupted or truncated. Another possibility is that there is ~32k of junk on the end of the file.

Could you hexdump the last 64k of the file for me? You can attach .txt files here BTW. Something like this

tail -c 65536 gdrive-encrypted/2z1sdiw2szofw2343ose1h24eq/ooqbrrgea2ze1s34zdv5mfkmas/wgs1c4gw5ygi1n7n6kbosslcgot3i1h4km613ftr8t8s5trssk30/yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e | hexdump > hexdump.txt

If it doesn't look completely random then there is definitely a problem.

If you rclone cat the file then you should get the file decrypted - can you tell from looking at it if it is truncated?

Can you tell me exactly what has happened to these files?

  • how did they get uploaded
  • where have they been transferred from and to
  • have they always been broken or did they get broken at some point?

Do you have the originals for any of them - it would be useful to know what size they are.

Thanks

Thanks for your time on this!

Great!

Sure...

$ rclone cat -vvv localtest-data:testfile2.mkv > /tmp/testfile2.mkv
2020/04/03 13:22:55 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "cat" "-vvv" "localtest-data:testfile2.mkv"]
2020/04/03 13:22:55 DEBUG : Using config file from "/home/linhead/.rclone.conf"
2020/04/03 13:22:55 DEBUG : 20200312-12h32.mkv: Excluded
2020/04/03 13:22:56 ERROR : testfile2.mkv: Failed to send to output: unexpected EOF
2020/04/03 13:22:56 Failed to cat: unexpected EOF
$ ls -al /tmp/testfile2.mkv 
-rw-r--r-- 1 linhead linhead 208470016 Apr  3 13:22 /tmp/testfile2.mkv
$ rclone ls localtest-data:testfile2.mkv
208502784 testfile2.mkv
$ expr 208502784 - 208470016
32768

And you're right!

Sure:

$ tail -c 65536 16gsfvl4v2c5tr4tzun21tngt3 | hexdump > /tmp/testfile2-hexdump.txt
$ tail -c 65536 yv2t0942lqrkhni0az97dfp5c1umdib2sroas6fob8318c6lrosm95b312nfbr4b2hb1skhi2i62e  | hexdump > /tmp/20200312-12h32-hexdump.txt

20200312-12h32-hexdump.txt (192.0 KB) testfile2-hexdump.txt (192.0 KB)

Agree, I was hoping for FF's padding it or something similar!

As it's a mkv unfortunately I cannot tell if it is truncated but I agree it does not look like garbage either.

You made me look (this is on another system than my tests above) - I suspect we can blame something else but let me detail:

Files are written to a mergerfs mount /mnt/mergerfs, args:

$ ps auxww | grep mergerfs
root      8326  1.6  0.0 625652  1256 ?        S<sl  2019 2540:10 mergerfs /data/local:/mnt/netdata /mnt/mergerfs -o rw,sync_read,allow_other,category.action=all,category.create=ff,fsname=mergerFS,dev,suid

The official rclone docker container exposes the mount /mnt/netdata with arguments:

$ ps auxww | grep rclone 
root     25149  4.9  4.5 2382188 742916 ?      Ssl  Apr01 151:05 rclone --config /config/rclone.conf mount --allow-other --dir-cache-time=2h --cache-info-age=96h --cache-chunk-size=8M --cache-chunk-total-size=1024G --cache-chunk-clean-interval=15m --cache-read-retries=10 --cache-db-wait-time=5s --cache-tmp-wait-time=10m --cache-workers=32 --buffer-size=1M --attr-timeout=1s --cache-writes --cache-tmp-upload-path=/data/cache-upload --cache-db-path=/data/cache-db --cache-chunk-path=/data/cache-chunk --rc --rc-addr=:5572 --vfs-cache-mode minimal --cache-dir=/data/cache-dir --log-level DEBUG --log-file=/log/rclone.log --gid=1009 --umask=0000 gdrive-data-cache-crypt: /mnt/netdata

But file writes do not touch this mount above as mergerfs writes to /data/local - a simple cron job moves this to the gdrive and expire to the above mount over --rc after the rclone move finishes:

$ rclone -v --config $ABOVE_MENTIONED_RCLONECONF move /data/local/ gdrive-encrypted:  --checkers 3   --tpslimit 
3  --transfers 3 --exclude-from $MERGEFS_RCLONE_EXCLUDE --delete-empty-src-dirs  --log-file $MERGEFS_LOG

FWIW:

$ mergerfs -v
mergerfs version: 2.28.3
FUSE library version: 2.9.7-mergerfs_2.29.0
fusermount version: 2.9.7
using FUSE kernel interface version 7.29

As far as I can tell, 'unexpected EOF' files have always been broken, but I also do not have access to the original files for comparison, it also happens on such a small % of these that it is not practical to keep on disk for longer for post-breakage-analysis.

I suspect we could easily blame mergerfs but the act of 'rclone move' being able to send it to gdrive in the first place and the resulting EOF business makes me ponder...

I've now changed my process flow to skip mergerfs and write straight to the above /mnt/netdata mount (which is a crypt->cache->gdrive), however "new" 'unexpected EOF's come through after several days only.

Thanks!

1 Like

To my Mk1 eyeball they look random, so I'd say the most likely thing is the file has been truncated.

Can you play the mkv to see if it is truncated? Or maybe pass it through ffmpeg?

Taking into account the 32k length multiple of the unencrypted files then this probably happened during the process of upload.

Is it possible the files changed size while they were being uploaded? Rclone should have detected that, but I wonder if that detection isn't working on the FUSE mergerfs mount for some reason.

Great - let me know what happens :slight_smile:

FWIW - 2 Weeks later and no issues. Thanks for the help!

I assume it is mergerfs or most-probably, myself copying the files before they were completely written to disk and closed out.

Great, glad it is working now :slight_smile:

Cross fingers it doesn't re-occur - let me know if it does!

Guys. I had those broken EOF files too. Currently I found only 2 files. Mine was uploaded to Google Drive using (most likely) rclone v1.51.0 Windows 64-bit version. Practically all affected files were destroyed. Only ~5% from the beginning of the file was intact. The further data is random one (incorrectly decrypted). I uploaded them at 2020-05-04&05. They were uploaded directly from HDD to crypted Google drive backbend. Now I am very afraid that there may be much more such destroyed files which I am not aware.

So I would like that you offer me a way how to check for such corrupted encryption files so I could try replacing some files if I still have a copy. You can't somehow recover such broken encryption files, could you? It seems that you haven't managed to do that. I think the easiest way would be a program which would try to read every files endings (like last 4KB or so). You could run it on a mount. So for any broken EOF file it won't be possible and that would probably mean that it is corrupted. Rclone automatically would give off EOF reading errors when such files are read. I am not programmer and can't write such program myself. Maybe there is some CLI tool which is capable to do that? Maybe implement it to rclone as additional layer of protection against corrupted encryption. So the ending of the file would be read after the upload. Maybe do not do that check for all uploaded files but for the ones for which this bug could be expected. I gave my corrupted file stats, maybe there is some pattern. Do that check for all files with special dedicated flag. You haven't actually fixed that bug in rclone 1.52? This is critical bug as it causes data loss which is invisible until it is too late. Something must be done about it.

Corrupted files stats:
FILE1
Original: 554 918 046 bytes
Encrypted: 555 053 566 bytes
Decrypted (cat output): 554 893 312 bytes
Decrypted (undamaged part in the beggining): 33 550 336 bytes

FILE2
Original: 576 054 235 bytes
Encrypted: 576 194 907 bytes
Decrypted (cat output): 575 995 904 bytes
Decrypted (undamaged part in the beggining): 25 161 728 bytes

HI @gvnex

FWIW - my 'unexpected EOF' issue occurred (definitely) because I was deleting a file locally before the transfer has completed to gdrive. I now do a combination of checking for open files and ensuring my modified time of the file is more than a couple of minutes before deleting a local file in the first place.

The 'long way' of checking for "unexpected-EOF-files" are to look for the error message in your rclone logs - you can trigger it by sync'ing/copying the affected file and you should see it fail at ~99% completion with that message.

If I was sufficiently perplexed about it and had copies of both the original and gdrive-stored version I would probably hash the last couple of 100 bytes of each file and compare them - YMMV of course depending on how expensive opening the last x bytes of a file is compared the copying each for the same as per the above paragraph.

rclone cryptcheck should give you a reliable indication of whether the file on drive matches the local file.

Agreed.

The first thing is to work out why it is happening to you.

Is it possible the file changed while it was being uploaded?

For that

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