Sync() errors on Mac over SMB

This is in reference to my earlier thread.

So I was going to mount the repo by first mounting the smb share, then doing a restic mount on my Mac. However, it appears I can’t even list the snapshots on my Mac. It’s fine, and I can still restore the profile using restic restore on my Windows box, but I found this odd and thought I’d report it.

akrabu-macbook-air:~ akrabu$ restic -r /Volumes/b$/restic --password-file /Volumes/b$/!Apps/Restic/password.txt snapshots

repository 3cc4819d opened successfully, password is correct

Save(<lock/07d5ca9565>) returned error, retrying after 552.330144ms: Sync: sync /Volumes/b$/restic/locks/07d5ca956503c160e8dbda361a5f5cb04d2551e5761cd2126d8d3d00915a73dd: operation not supported

Save(<lock/07d5ca9565>) returned error, retrying after 1.080381816s: Sync: sync /Volumes/b$/restic/locks/07d5ca956503c160e8dbda361a5f5cb04d2551e5761cd2126d8d3d00915a73dd: operation not supported

Save(<lock/07d5ca9565>) returned error, retrying after 1.31013006s: Sync: sync /Volumes/b$/restic/locks/07d5ca956503c160e8dbda361a5f5cb04d2551e5761cd2126d8d3d00915a73dd: operation not supported

Save(<lock/07d5ca9565>) returned error, retrying after 1.582392691s: Sync: sync /Volumes/b$/restic/locks/07d5ca956503c160e8dbda361a5f5cb04d2551e5761cd2126d8d3d00915a73dd: operation not supported

Save(<lock/07d5ca9565>) returned error, retrying after 2.340488664s: Sync: sync /Volumes/b$/restic/locks/07d5ca956503c160e8dbda361a5f5cb04d2551e5761cd2126d8d3d00915a73dd: operation not supported

signal interrupt received, cleaning up

Any idea what’s going on?

Could be my repo is still somewhat damaged even after running prune (see prior thread), but Windows can list the snapshots (and apparently restore) without issue.

I’ll try to mount the repo directly from the external drive hosting it once this restore (and a few ongoing backups) are finished and report back.

EDIT: Apparently it’s a locking issue. I can use --no-lock and list snapshots, but I still can’t mount. Does mounting require exclusive access?

Are you using credentials that don’t have write access?

Nope. Using the same user credentials that the backup itself uses. Just did a double-check, and that user has complete read-write access to the volume. I also copied a text file and then deleted it from inside the repo. Not a problem.

Aha, I see. I misinterpreted the error message.

The sync operation is failing, presumably because Mac’s CIFS driver does not support it. I’m not sure what could be done about this… @fd0, would it make sense to ignore the “operation not supported” errno for Sync()? If the underlying storage doesn’t support it, there’s not much we can do about it anyway.

1 Like

Yep, that’d be the best course of action I think. People use all sorts of odd file systems with the local backend…

3 Likes

I’m having the same sync ... operation not supported issue on my Mac (so smb is not working on the latest MacOs, Catalina or v10.15, either).

FWIW, I think this issue wasn’t present when I started using restic, almost three years ago. Pretty soon I switched to the faster sftp, and have been using that since.
Now I needed to do a restore, and when trying over SMB, got the error message.

Having the same issue on macOS 10.15.1 initializing a restic repo on a smb share:

$ mount
…
//myuser@myserver/myshare on /Volumes/myshare (smbfs, nodev, nosuid, mounted by myuser)
…
$ restic init --repo /Volumes/myshare/tmp/restic-repo
enter password for new repository: …
enter password again: …
Fatal: create key in repository at /Volumes/myshare/tmp/restic-repo failed: Sync: sync /Volumes/myshare/tmp/restic-repo/keys/a17237c3c5fdf5b580c34d747ac9eaba1f4f86f1304b2b10f6054822c60ce793: operation not supported
$ restic version
+restic 0.9.6 compiled with go1.13.4 on darwin/amd64

I have full write access to that folder.