Search code examples
macosunison

Unison fails with "Cannot find canonical name" when used with profile


I use Unison to sync folder between MacOS and external SSD drive connected via usb. External drive has ExFAT file system.

If I execute Unison by specifying two roots, then it works fine.

unison /Users/user.name/Nextcloud /Volumes/ssd_sync/macbook/nextcloud -fat=true

But when I execute Unison using profile, then it fails with an error

❯ unison nextcloud
Unison 2.53.7 (ocaml 5.2.0): Contacting server...

Error: Cannot find canonical name of "/Volumes/ssd_sync/macbook/nextcloud": unable to cd either to it ("/Volumes/ssd_sync/macbook/nextcloud": No such file or directory)
or to its parent "/Volumes/ssd_sync/macbook
("/Volumes/ssd_sync/macbook: No such file or directory)

My profile contains exactly the same root folders and looks like this

❯ cat /Users/user.name/Library/Application\ Support/Unison/nextcloud.prf
root = "/Users/user.name/Nextcloud"
root = "/Volumes/ssd_sync/macbook/nextcloud"
fat = true

I can cd to "/Volumes/ssd_sync/macbook/nextcloud". I noticed that error message has only on opening quotation mark ("/Volumes/ssd_sync/macbook: No such file or directory). Could you be related? If yes what could be the reason for this?

My main question is how to make Unison work for my case using a profile?

Update 1

I also tried with a different ocaml version by without any success.

unison version 2.53.7 (ocaml 4.14.2)


Solution

  • The problem is with the quotation marks, they aren't valid paths. In the command line it works because the parameters are interpreted a bit different than reading them from the file. Change config to:

    root = /Users/user.name/Nextcloud
    root = /Volumes/ssd_sync/macbook/nextcloud
    fat = true