Mac build agent unable to access external drive, Operation not permitted error

Whenever I run a build on a particular agent, it immediately fails with a message

java.lang.RuntimeException: java.io.FileNotFoundException: /Volumes/SSDSled/TeamCity/work/directory.map (Operation not permitted)

I uploaded the full build log, the ID is 2021_06_02_CsifBV2UxDMjPsK2.

This agent is a Mac Mini (2018) running Catalina (10.15.7). The TeamCity server is on a separate Windows 10 computer. Server is TeamCity Professional 2020.2.4 (build 86063). The Mac is able to build if I set its work directory to a location on its internal drive. But that is too small, so we added an external USB 3.2 SSD. I tried different folders on the external, but the build always fails with the same error. Once it got far enough to create "directory.map" in the work folder, but it never actually builds anything. On the agent, agent.work.dir is set to "/Volumes/SSDSled/TeamCity/work". "SSDSled" is the external drive.

I added Java to the Mac's "Security & Privacy" setting for "Full Disk Access". "Files and Folders" automatically also lists Java with Full Disk Access. The Java install has two executables, one at "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin" and the other at "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/jre/bin". Both were added to Full Disk Access. But it seems Java still cannot access the drive.

How can I get this Mac to build?

Thanks, Marc

2 comments
Comment actions Permalink

Follow-up: I disabled SIP on the Mac, and the build ran to completion, so it looks like permissions was the problem. Can anyone tell me what else to change? I already gave Java Full Disk Access. Could there be another executable that also needs permission?

0
Comment actions Permalink

Just found this thread! I've also been running into this problem on both of my MacOS Catalina and Big Sur agents. I ended up disabling SIP in the end. Haven't found a real fix for this too. 

0

Please sign in to leave a comment.