macOS Mojave cannot find /var/db/DetachedSignatures with Swift 4

Magno picture Magno · Sep 26, 2018 · Viewed 7.2k times · Source

I had no such error with High Sierra, now with Mojave my application done with Swift 4 is issuing this error. It will happen when I try to get software information by call: /usr/sbin/system_profiler SPApplicationsDataType

My application wont fail and works but I notice that it will expose this error when running:

system_profiler[2052:52918] [logging-persist] os_unix.c:42249: (0) open(/var/db/DetachedSignatures) - Undefined error: 0

I guess it is related to code signatures but I don't know how to handle that, maybe a bug as there isn't any file called DetachedSignatures inside /var/db

Answer

John Ballinger picture John Ballinger · Jun 20, 2019

os_unix.c:37227: (21) seekAndRead(/var/db/DetachedSignatures) - Is a directory

sudo touch /var/db/DetachedSignatures

This fixed the issue on my machine.