After MacOS Upgrade to Ventura, restic repo giving "inappropriate ioctl for device" errors

Using this version from Homebrew:

$ restic version
restic 0.14.0 compiled with go1.19 on darwin/amd64
$

After I upgraded to Ventura (13.0.1), when I run restic commands to access a repo on an ExFat volume on a USB drive, I’m getting these errors:

$ restic snapshots
repository 12697d8f opened (repository version 2) successfully, password is correct
Save(<lock/5129334b09>) returned error, retrying after 552.330144ms: sync /Volumes/BACKUP_HD/macbook_restic/locks/5129334b098beb2a142b8a052b80727cb8e784a7d70bb7022c0ea08fa3a0db2a-tmp-963238146: inappropriate ioctl for device
Save(<lock/5129334b09>) returned error, retrying after 1.080381816s: sync /Volumes/BACKUP_HD/macbook_restic/locks/5129334b098beb2a142b8a052b80727cb8e784a7d70bb7022c0ea08fa3a0db2a-tmp-3721763287: inappropriate ioctl for device
...
github.com/restic/restic/internal/backend/local.(*Local).Save
	github.com/restic/restic/internal/backend/local/local.go:181
github.com/restic/restic/internal/backend/limiter.rateLimitedBackend.Save
	github.com/restic/restic/internal/backend/limiter/limiter_backend.go:30
github.com/restic/restic/internal/backend.(*RetryBackend).Save.func1
	github.com/restic/restic/internal/backend/backend_retry.go:66
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer
	github.com/cenkalti/backoff/v4@v4.1.3/retry.go:55
github.com/cenkalti/backoff/v4.RetryNotify
	github.com/cenkalti/backoff/v4@v4.1.3/retry.go:34
github.com/restic/restic/internal/backend.(*RetryBackend).retry
	github.com/restic/restic/internal/backend/backend_retry.go:46
github.com/restic/restic/internal/backend.(*RetryBackend).Save
	github.com/restic/restic/internal/backend/backend_retry.go:60
github.com/restic/restic/internal/cache.(*Backend).Save
	github.com/restic/restic/internal/cache/backend.go:59
github.com/restic/restic/internal/repository.(*Repository).SaveUnpacked
	github.com/restic/restic/internal/repository/repository.go:488
github.com/restic/restic/internal/restic.SaveJSONUnpacked
	github.com/restic/restic/internal/restic/json.go:31
github.com/restic/restic/internal/restic.(*Lock).createLock
	github.com/restic/restic/internal/restic/lock.go:161
github.com/restic/restic/internal/restic.newLock
	github.com/restic/restic/internal/restic/lock.go:105
github.com/restic/restic/internal/restic.NewLock
	github.com/restic/restic/internal/restic/lock.go:66
main.lockRepository
	github.com/restic/restic/cmd/restic/lock.go:42
main.lockRepo
	github.com/restic/restic/cmd/restic/lock.go:23
main.runSnapshots
	github.com/restic/restic/cmd/restic/cmd_snapshots.go:71
main.glob..func24
	github.com/restic/restic/cmd/restic/cmd_snapshots.go:29
github.com/spf13/cobra.(*Command).execute
	github.com/spf13/cobra@v1.5.0/command.go:872
github.com/spf13/cobra.(*Command).ExecuteC
	github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
	github.com/spf13/cobra@v1.5.0/command.go:918
main.main
	github.com/restic/restic/cmd/restic/main.go:98
runtime.main
	runtime/proc.go:250
runtime.goexit
	runtime/asm_amd64.s:1594
unable to create lock in backend
$

“restic unlock” completes OK, but doesn’t fix this problem.

This repo/volume was created in MacOS 12 (Monterey) and always worked fine there.

I’m not sure if this is a restic issue or MacOS issue, so looking for some help on where to start from a restic perspective.

Some other notes:

  • Other volumes on the USB drive work fine (Time Machine, Carbon Copy Cloner).
  • I can access the volume used for the repo via the shell fine and do, e.g., “ls” on the directories to see the raw restic files OK.

So it seems like everything works OK with the USB drive/volumes after the Ventura upgrade aside from restic.

macOS apparently has changed the error code which is returned when restic tries to make sure that the files were actually written to an exfat disk. All other file systems should still work fine.

We’ve worked around this problem in backend/local: Ignore ENOTTY for fsync on Mac by greatroar · Pull Request #4021 · restic/restic · GitHub . However, that PR is not yet part of a released version, thus you’d have to use a beta build from restic beta releases (/)