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?