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

I asked someone for their file as @lzl said but they told me the file was 0 bytes. I touched a file at that path and my warnings went away.


I encountered the same problem, and I copied the DetachedSignatures file from some other guy's MacBook and put it under /var/db path on my iMac. It solved the problem. Don't know why some mac just don't have this DetachedSignatures file. Not very many useful explanations on the Internet.


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

sudo touch /var/db/DetachedSignatures

This fixed the issue on my machine.


This appears to be logged by the Security framework during some operations; I always see it when my app calls SecKeyGeneratePair. Since everything works correctly I assume this is just noise. (There are other examples of this; the Security engineers at Apple seem to be bad about leaving noisy but harmless log messages in their production code.)

I wouldn't recommend trying to create the DetachedSignatures file! It's clearly used for something by the OS, and just shoving an empty file there, or one copied from elsewhere, could cause problems later on.