1

I'm having a problem when trying to sync beta => alpha using mutagen on OSX

When a file is created on beta (Docker container) it won't get synchronized into alpha (host) resulting in error:

public/asd.txt: unable to create file: unable to set staged file permissions: unable to set ownership information: chown /Users/xxx/.mutagen/staging/sync_ORDrmPtp9gAdxdF0NC6EkEp3Eqaf9MMUgaXGn2CJx8H-alpha/da/3a404e69fec4666cf122d6588790e042a663d9d5_da39a3ee5e6b4b0d3255bfef95601890afd80709: operation not permitted

My mutagen.yml file says:

  defaults:
    permissions:
      defaultOwner: "id:10"
      defaultGroup: "id:3"
    ignore:
      paths:
        - .DS_Store

  code:
    alpha: "./"
    beta: "docker://php/app"
    mode: "two-way-resolved"
    permissions:
      defaultFileMode: 666
      defaultDirectoryMode: 777
    ignore:
      vcs: true
      paths:
        - "/vendor/"

Directory /Users/xxx/.mutagen/staging is owned by same user starting mutagen project start

Also tried starting mutagen sync as superuser with same result.

Any answers appreciated!

Mateusz Wu
  • 23
  • 2
  • 5

1 Answers1

4

The problem is that mutagen tries to apply the defaultOwner on the host system also, but chown is not permitted on Mac (see this question for further information).

The solution is to set the defaultOwner and defaultGroup for the beta system only like this:

code:
  alpha: "./"
  beta: "docker://php/app"
  mode: "two-way-resolved"
  ignore:
    vcs: true
    paths:
      - "/vendor/"
  configurationBeta:
    permissions:
      defaultOwner: "id:10"
      defaultGroup: "id:3"

This way the owner and group settings remain "default" for the host system, which is the user running mutagen.

I found it really helpful to confirm my settings for a running sync with mutagen sync monitor -l. This helped me to resolve this issue.

Christoph
  • 524
  • 10
  • 19
  • Very useful. Thanks. Pointed me in the right direction. – 2upmedia Dec 28 '21 at 23:04
  • How do you determine which owner and group id you should add there? – Babu Jul 05 '22 at 11:18
  • You can get the ids with the `id` command in your shell. If you're asking how to decide which user and group to set as owner then there's no single answer to that other than "it depends". You might want to ask a separate question and provide some extra context to your specific situation. – Christoph Jul 05 '22 at 12:39