macOS: can't start syncthing service via Homebrew (125: Domain does not support specified action)

Hi! I’m on a M1 MacBookPro on macOS Sonoma (14.6.1) and installed syncthing via Homebrew which installs but I can’t start the service:

% brew services start syncthing
Could not enable service: 125: Domain does not support specified action

Error: Failure while executing; `/bin/launchctl enable gui/503/homebrew.mxcl.syncthing` exited with 125.

Even though this page is not related to troubleshooting syncthing, it is the same exact error so I decided to create a brew group, added my admin user to it and updated permissions on my /opt/homebrew directory.

It didn’t work so thought I’d put a shout out here to see if anyone else has gotten the service to run & persist in macOS through this method.

Thanks for any nudges! :pray:t3:

turns out you can’t do everything from the command line.

I “window” logged into my admin user and a few prompts came up immediately on log in (one that Syncthing installed a background item (paraphrasing))

now if I brew services list:

Name      Status  User      File
emacs     none              
syncthing started admin ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist
unbound   none  

and the service is up at http://127.0.0.1:8384

the issue I’m having now is even though permissions are open on the directory I am syncing (ie. world writable) - I am getting these failures (causing “Out of Sync” on the folder heading):

Syncing: handling dir (setting permissions): chmod /Users/Shared/saves: operation not permitted

The service is owned by the admin user (as seen above) so I’m not sure why it is having issues with chmod (when I can do this from the command line no problem)

any ideas?

hmm - I “window” logged out of the admin user and noticed the service stopped:

Name      Status User      File
emacs     none             
syncthing none   admin
unbound   none 

how can I configure the syncthing service to run in the background even if nobody is logged in (like is configured on Linux)?

Yeah, LaunchAgents are usually (always?) tied to a logged in user of some kind. You can create a LaunchDaemon which runs independently. We don’t have any documentation for that, but you can google it and look at the examples in /Library/LaunchDaemons (which is where you’ll want to put the thing). You may want to grant Syncthing full disk access manually beforehand or things will probably not work well, LaunchDaemons don’t run in a window context so can’t pop up dialogs for accessing stuff etc.

ah - thanks for pointing this out. I didn’t realize the default config wasn’t a system level daemon.

I’ve set up Emby to launch on macOS startup before I moved it to a Linux server so I’ll see if I can dig up the old launch daemon config and model the Syncthing one after that.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.