macOS 27: Permission denied to directory in launchd agent but works in command line
I have this launchd agent to start up the app copyparty. When I try to access my Downloads folder in copyparty (http://localhost:3923/), In my copyparty.log file it says [PermissionError] [Errno 1] Operation not permitted: b'/Users/user/Downloads', '/Downloads'". It didn't work when I changed the agent into a daemon. When I run the command in the terminal, I can access the Downloads folder just fine: copyparty -v /Users/user::A --see-dots -lo /Users/user/Library/Logs/copyparty.log.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.nixos.copyparty</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>/bin/wait4path /nix/store &amp;&amp; exec /nix/store/wn59rkhzxx1qj1h9sn5950fbdkxqn6qd-copyparty-most-1.20.24/bin/copyparty -v /Users/user::A --see-dots -lo /Users/user/Library/Logs/copyparty.log</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/user/Library/Logs/copyparty.error.log</string>
</dict>
</plist>