restic: Getting error on save lock

Output of restic version

restic 0.9.5 compiled with go1.12.4 on darwin/amd64

How did you run restic exactly?

$ restic -v -r backup-repository check

using temporary cache in /var/folders/lr/5vbfxcnd0vd3nm4djf1py7ycg0qddv/T/restic-check-cache-172008049
enter password for repository: 
repository 8205b840 opened successfully, password is correct
created new cache in /var/folders/lr/5vbfxcnd0vd3nm4djf1py7ycg0qddv/T/restic-check-cache-172008049
create exclusive lock for repository
Save(<lock/9f4aaf42a5>) returned error, retrying after 552.330144ms: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 1.080381816s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 1.31013006s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 1.582392691s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 2.340488664s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 4.506218855s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 3.221479586s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 5.608623477s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 7.649837917s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Save(<lock/9f4aaf42a5>) returned error, retrying after 15.394871241s: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported
Fatal: unable to create lock in backend: Sync: sync backup-repository/locks/9f4aaf42a530a5130b4cb4e201146bf436a32c4dc239e3477146a2b844e3eb81: operation not supported

check command with --no-lock option

restic --no-lock -v -r backup-repository check
using temporary cache in /var/folders/lr/5vbfxcnd0vd3nm4djf1py7ycg0qddv/T/restic-check-cache-832642100
enter password for repository: 
repository 8205b840 opened successfully, password is correct
created new cache in /var/folders/lr/5vbfxcnd0vd3nm4djf1py7ycg0qddv/T/restic-check-cache-832642100
load indexes
check all packs
check snapshots, trees and blobs
no errors were found

What backend/server/service did you use to store the repository?

Expected behavior

restic should successfully set lock on repository for backup.

Actual behavior

restic fails to set lock on repository for each command. I tried successfully to run check command with --no-lock option (see logs above).

Steps to reproduce the behavior

Do you have any idea what may have caused this?

No

Do you have an idea how to solve the issue?

No

Did restic help you or made you happy in any way?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Every operation which results in Sync() getting called will trigger this error. This involves creating new repos, creating a lock file in the repo, and so on.

I did some more testing and it seem to be related to a change introduced by go1.12 (which is the version used to compile the 0.9.5 binaries). I confirmed this by compiling the latest restic master with go1.11 and creating a repo over SMB, which worked fine for me. The same restic version compiled with go1.12+ produces the sync errors.

The relevant section from the go1.12 release notes:

File.Sync now uses F_FULLFSYNC on macOS to correctly flush the file contents to permanent storage. This may cause the method to run more slowly than in previous releases.

I ran into the exact same issue while setting up a backup with restic on my Macbook (latest Mojave and restic version), so I played along a bit with this behaviour.

My NAS is running latest free napp-it version using SMB3. With a Windows 10 Machine and the same restic version I had no issues. This behaviour only occurs while using restic 0.9.5 on macOS access an SMB3 share:

  • With SMB3, creating a repository from macOS this issue occurs just like written and i am unable to perform backups to a repository which was created locally and copied to a share
  • Disabling SMB3 and enabling the AFP service works, no issues accessing the share with restic
  • I tried another Server, an older QNAP NAS and set the SMB version to 2.1: no issues with Windows nor macOS. BUT: Changing to SMB3 in the server GUI is perfectly fine here also. Unfortunately i can’t say, which SMB3 protocol version exactly is used…
  • At this point I decided to try out the latest FreeNAS with SMB3, instead of napp-it just to clarify it’s not something odd in the server configuration, so I changed the backend completely, but even this changed nothing in the behaviour written above.

So it seems, that the current restic version indeed have trouble accessing SMB3 shares on macOS Mojave above a specific SMB3 version.

I hope that helps a bit.