8000 fix: add b2 versionAt support to NewObject api by b1zzu · Pull Request #8555 · rclone/rclone · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: add b2 versionAt support to NewObject api #8555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

b1zzu
Copy link
@b1zzu b1zzu commented May 13, 2025

What is the purpose of this change?

Currently, versionAt is ignored from the NewObject API, which means that when retrieving an object with versionAt always the latest version is returned, or no object if it was soft deleted.

This is evident when using rclone with restic.

Example

$ rclone serve restic --b2-version-at 2025-05-08T10:00:00 b2:my-backups
$ restic --no-lock --repo rest:http://127.0.0.1:8080/ restore latest
Load(<data/689e1dbc45>, 1958097, 65019165) failed: <data/689e1dbc45> does not exist
ignoring error for /mybackup.txt: ReadFull(<data/689e1dbc45>): <data/689e1dbc45> does not exist

Was the change discussed in an issue or in the forum before?

No, initially I thought it was a configuration issue on my side, but when I found out that it was not I was already in the place where to fix it.

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@b1zzu
Copy link
Author
b1zzu commented May 13, 2025

I'm trying to fix the tests because the VersionAt/AfterDelete does not behave as expected, but the first time I've run the integration tests using my backblaze account it worked, but now most test are failing with this error and I can't progress:

=== RUN   TestIntegration/FsMkdir/FsEncoding/control_chars
    fstests.go:707: testing "␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟␡"
    fstest.go:534: Sleeping for 1s for findObject eventual consistency: 1/3 (failed to HEAD for download: Unknown 403  (403 unknown))
    fstest.go:534: Sleeping for 1.5s for findObject eventual consistency: 2/3 (failed to HEAD for download: Unknown 403  (403 unknown))
    fstest.go:534: Sleeping for 2.25s for findObject eventual consistency: 3/3 (failed to HEAD for download: Unknown 403  (403 unknown))
    fstest.go:538: 
        	Error Trace:	/home/davide/tmp/rclone/fstest/fstest.go:538
        	            				/home/davide/tmp/rclone/fstest/fstests/fstests.go:201
        	            				/home/davide/tmp/rclone/fstest/fstests/fstests.go:224
        	            				/home/davide/tmp/rclone/fstest/fstests/fstests.go:214
        	            				/home/davide/tmp/rclone/fstest/fstests/fstests.go:713
        	Error:      	Received unexpected error:
        	            	failed to HEAD for download: Unknown 403  (403 unknown)
        	Test:       	TestIntegration/FsMkdir/FsEncoding/control

This is how I run them:

export RCLONE_CONFIG_B2_ACCOUNT=<master-account>
export RCLONE_CONFIG_B2_KEY=<master-key>
export RCLONE_CONFIG_B2_TYPE=b2
cd backend/b2
go test -v -remote b2:

@albertony
Copy link
Contributor

Maybe there are some temporary test files left behind from your first run, that you need to clean up manually?

@b1zzu
Copy link
Author
b1zzu commented May 14, 2025

Maybe there are some temporary test files left behind from your first run, that you need to clean up manually?

I found out I've exhausted the free daily download budget from Backblaze 😓

@b1zzu b1zzu force-pushed the fix-b2-get-metadata-with-version-at branch from 13d24c1 to d7addb5 Compare May 14, 2025 14:22
@b1zzu
Copy link
Author
b1zzu commented May 14, 2025

Ready for review, all b2 integration tests PASS when I run them locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0