open(/var/db/DetachedSignatures) - Undefined error:0

Error in Xcode 10.3 on macOS 10.15.3 on executing command SecCodeCopyGuestWithAttributes for macOS Cocoa application.

[logging-persist] os_unix.c:43353: (0) open(/var/db/DetachedSignatures) - Undefined error: 0

The file /var/db/DetachedSignatures does not exist. Any reason why? How to fix this?

Post not yet marked as solved Up vote post of shwetam Down vote post of shwetam
7.2k views

Replies

How to fix this?

Do you need to fix this? Does it actually result in some sort of problem? If not, I’m inclined to treat this as log noise.

OTOH, if there is an actual problem, please describe its symptoms?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
  • Please disregard this, I can't format my response here

  • Mine2, and my app went stuck. I'm just about to ask the forum

Add a Comment
Having the same problem with some build failures where Xcode can't sign the app at the end of our CI process.
I think it’s unlikely that these things are related. /var/db/DetachedSignatures is only used if the system has to synthesise a code signature for an app that doesn’t have one (for example, you add a firewall exception for an app that’s unsigned). The fact that it’s missing on standard user systems is not an error.

I think you need to dig deeper into the code of your signing problem. My experience is that many CI systems run your build scripts in odd environments, and that causes keychain operations to fail.

For example, they run in a global context and then explicitly set the user ID to that of your build user. This is generally inadequate on macOS because it doesn’t switch all the other Mac-specific execution context. See the Execution Contexts section of Technote 2083 Daemons and Agents for more background on the challenges here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I have the same problem (Xcode 12.3, MacOS 10.15 Catalina and 11.1 Big Sur).

Our code (a security tool based on the new EndpointSecurity framework) attempts to extract some code-signing information for processes as part of logic that determines whether or not to authorize some user actions)

So we execute
Code Block
CFDictionaryRef attributes = (bridge CFDictionaryRef)@{(bridge NSString *)kSecGuestAttributePid : [NSNumber numberWithInt:self.pid] };
SecCSFlags options = kSecCSDefaultFlags;
status = SecCodeCopyGuestWithAttributes(NULL, attributes, options, &dynamicCode);

and then do some verifications on the dynamicCode -- however, we're flooded with the same logs as the OP, plus, for some reason - despite the method returning success, OS hangs and kills our process immediately at that point (EndpointSecurity clients have this harsh reaction to just about anything, including any attempt to debug, or breakpoint, or run with instruments, or experience certain exceptions etc.). When run outside of the ES context - the code runs just fine, but logs are still emitted, for each execution of the SecCodeCopyGuestWithAttributes

When run outside of the ES context - the code runs just fine, but logs
are still emitted, for each execution of the
SecCodeCopyGuestWithAttributes

Right, which is evidence to support my earlier assertion that this is just On log noise.

EndpointSecurity clients have this harsh reaction to just about
anything, including any attempt to debug, or breakpoint, or run with
instruments, or experience certain exceptions etc

Indeed they do. ES clients live in a privileged position within the system and thus the system places strict constraints on what they can do.

and kills our process immediately at that point

Does that yield a crash report?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
  • I'm not an app developer. I work in bioinformatics and I hobby in automation. All I'm trying to do is get a simple AppleScript to run to synch my reminders with my Raspberry Pi so I can use reminder completion events as automation triggers in Node Red. I had no interest in codesigning (though I've done it once before for a Java-based bioinformatics app.

    However, whenever I launch my reminder synch script using osascript on the command line, it ran orders of magnitude slower than it script editor. (about 40 seconds in the editor and sometimes in excess of 10 minutes when launched via osascript). I came to conclude that this may be due to the script being flagged as "indirect access" by tccd. And I read that averting the "indirect access" monniker required codesigning. So I tried ad-hoc codesigning the app version of my script.

    I have thousands of tccd messages in console before I code-signed, and I should look closer at those messages, but with the codesigned app, a 2 minute run of the app-version of the script before timeout, there are over 52,000 lines of these messages in console.

    So I would like to know, are these errors really noise, or is it a clue to why I can't run my applescript in a reasonable runtime?

Add a Comment

This is not an answer. I wanted to note that my errors stem from the use of NSTask.

I have created some helper build scripts in swift to automate a new app build. These are compiled and can be run from within Xcode as well or as useful command lines.

It will spawn an NSTask (Now renamed Process in swift) where I would do something like this

/usr/bin/codesign --remove-signature "/my file....."

If I ran this command in terminal, all works well. Buy if I ran under my script, using an NSTask I see errors like the harmless [logging-persist] and others

It seems as if the apple tools are not happy running as child processes under my NSTask. Any advice on how to configure NSTask properly.

I'm seeing this same error message when trying to use startosinstall on a macOS 12.0.1 system. The startosinstall doesn't do anything after this message. So, it's either related or something else is going wrong after it and therefore not being logged.

nvm ... it's Apple's settings they sneaked in for M1 Macs requiring a password for the install, despite being run by sudo (root). Having to put the password in a script is a step backwards indeed ...

  • I am getting the same error when trying to execute startosinstall through Process().

Add a Comment

I kept getting that too (XCode 13.4.1 OS 12.4 M1 iMac).

This worked for me:

sudo touch /var/db/DetachedSignatures

in Terminal.

  • Thank you - that seems to have worked for me also.

  • Thanks, it worked for me also.

  • This worked for me, too. Running Sonoma 14.1.