bcpierce00 / unison

Unison file synchronizer
GNU General Public License v3.0
3.86k stars 224 forks source link

macOS GUI client fails to sync extended attributes #952

Closed mroi closed 10 months ago

mroi commented 10 months ago

I was trying the extended attributes support for the first time, when I noticed an oddity: For the same build (my own as well as the release tarball), the text UI would sync extended attributes just fine, while the graphical UI would refuse. The error I get is an alleged lack of server support for Sync: xattr, which is simply untrue. Bildschirmfoto 2023-08-16 um 20 12 18

Again, the same binary syncs extended attributes fine with the text UI.

The debug logs from both versions look like this:

Michael@jupiter:/U/S/L/C/U/C/MacOS (1) > ./Unison -ui graphic -debug all Test
Preferences:
<shortened>
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose ssh://bios/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[remote] Shell connection: ssh (ssh, bios, -e, none, -C, unison, -server, __new-rpc-mode)
[remote] Selected RPC version: 1
[globals] Installing roots...[features] Supported features:
  - Sync: ACL
  - Sync: xattr
[globals] Checking path '' for expansions
Roots: 
        /Users/Michael/
        ssh://bios/
  i.e. 
        /Users/Michael/
        ssh://bios/
  i.e. (in canonical order)
       /Users/Michael
       //bios//home/michael

[features] Common features for root /Users/Michael:
  - Sync: ACL
  - Sync: xattr
[props] Setting permission mask to 7777 (7777 and 7777)
Client and server are incompatible. Setting up feature "Sync: xattr" failed with error
"You have requested synchronization of extended attributes (the "xattrs" preference) but the server does not support this.".

It may be possible to rectify this by changing the user preferences.
Ultimately, it may require upgrading either the server or the client.
Michael@jupiter:/U/S/L/C/U/C/MacOS (1) > ./Unison -ui text -debug all Test
[startup] Preferences:
<shortened>
Unison 2.53.2 (ocaml 4.14.1) log started at 2023-08-16 at 20:09:55

[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose ssh://bios/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[recon] root2direction called to choose /Users/Michael/ from /Users/Michael/ and ssh://bios/
[remote] Shell connection: ssh (ssh, bios, -e, none, -C, unison, -server, __new-rpc-mode)
[remote] Selected RPC version: 1
[features] Supported features:
  - Sync: ACL
  - Sync: xattr
[features] Common features for root /Users/Michael:
  - Sync: ACL
  - Sync: xattr
[features] Common features for root //bios//home/michael:
  - Sync: ACL
  - Sync: xattr
[features] Enabled features:
  - Sync: ACL
  - Sync: xattr
[startup] Roots: 
        /Users/Michael/
        ssh://bios/
  i.e. 
        /Users/Michael/
        ssh://bios/
  i.e. (in canonical order)
       /Users/Michael
       //bios//home/michael

[globals] Checking path '' for expansions
[props] Setting permission mask to 7777 (7777 and 7777)
[stasher] initBackupsLocal
[stasher] d = /
[stasher] Prefix and suffix regexps for backup filenames have been updated
[server: stasher] initBackupsLocal
[server: stasher] d = /
[server: stasher] Prefix and suffix regexps for backup filenames have been updated
Looking for changes
<sync continues correctly>

I think the macOS graphical UI lacks some steps in its setup compared to the text UI as the feature information for the roots is never completely shown. From the code, I think the relevant part may be:

But my OCaml skills are way below understanding the details here. Any advise what I can try?

gdt commented 10 months ago

Looks like evidence of a bug so this is legit in the tracker. For discussion/help please ask on unison-hackers@.

tleedjarv commented 10 months ago

Could you please try a debug build from https://github.com/bcpierce00/unison/actions/runs/5895042600 (I don't have a way to test on macOS myself but this will hopefully fix the bug)

mroi commented 10 months ago

Wow. Blind debugging. And even better: It works. I tested all three app bundle artifacts. All work.

hmijail commented 4 months ago

Found the same problem, which makes sense given that the last release is previous to this issue. Any plans for a new release?

tleedjarv commented 4 months ago

There is a release candidate build available at https://github.com/bcpierce00/unison/actions/runs/7902642581 (scroll all the way to the end)

hmijail commented 4 months ago

Thank you. Actually I tried that one before commenting here, and though it ran, it displayed a weird empty dialog at the end. (Maybe because my profile has batch = true? no idea)

Then I tried running the CLI again and got an error that I couldn't find any info about (Fatal error: Property lists: paths not yet registered!), which stopped unison from doing anything. After a good while trying stuff I ended up deleting the archive files to be able to run unison again.

So I'd say there's a bug somewhere, not sure if in that GUI or what. I suspect unison renamed a folder as part of the sync and then tried to apply changes to the old folder.

tleedjarv commented 4 months ago

Thank you. Actually I tried that one before commenting here, and though it ran, it displayed a weird empty dialog at the end. (Maybe because my profile has batch = true? no idea)

Please report a separate issue if you can reproduce this, possibly in the mailing list if it's more a question "is this a bug?". Provide a screenshot of the weird dialog.

Then I tried running the CLI again and got an error that I couldn't find any info about (Fatal error: Property lists: paths not yet registered!), which stopped unison from doing anything. After a good while trying stuff I ended up deleting the archive files to be able to run unison again.

This is unrelated, as this is a result of downgrading Unison and running an older version with upgraded archives.