Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
--b2-versions doesn't work for crypt backed by B2 #1627
I'm not 100% sure how to fix this! Perhaps by getting the crypt remote to recognise the suffixes added for the versions.
I'm guessing yes as the crypt remote wraps the cleanup call. If it doesn't, please make another issue!
Info from dupe #1632
When you have B2 "lifecycle settings" set to include versioning, and you upload a new file in the same directory, with the same filename, then the B2 server has more than one version of the file with different timestamps.
The documented behavior is here
https://www.backblaze.com/b2/docs/lifecycle_rules.html (describes which versions to keep etc)
Due to the filenames being encrypted locally by rclone prior to uploading, these additional versions now available on the server causes the associated filenames to be a mix of ciphertext and a plaintext date/time stamp.
When rclone attempts to decrypt this now-modified filename, the decryption fails and rclone throws an error (visible with more verbose debugging enabled) saying that the file has an "invalid filename" and skips processing this file.
Ideally, rclone could identify when a B2 encrypted remote, using filename encryption, with B2 versioning enabled server-side, sees an "invalid filename", could have an additional decryption attempt, by properly parsing the now-modified filename into two parts. The first part, the original encrypted filename, could run through the decryption process normally. The second part, the date/time stamp, would be appended onto the original plaintext filename (result of part1 decryption)
This would allow rclone filename encryption and B2 versioning to work together.
This issue is being filed per ncw. Some discussion is in this thread https://forum.rclone.org/t/backblaze-b2-humming-along-as-a-replacement-for-acd/2580/25
This feature, or lack thereof, is a very very big deal to me (the practical implication is data loss in case I want to recover an older version of my data).
Can we expect a fix in the short-term? Or should I consider drastic steps like disabling encryption?
Also, does this really affect all crypt configuratons? Or does it only affect filename encryption?
I would be okay losing filename encryption as a workaround so long as the actual contents are encrypted and I get versioning. Does that work?