Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS Sierra Command failed: codesign; The specified item could not be found in the keychain. #1457

Closed
neurosnap opened this issue Apr 11, 2017 · 8 comments · May be fixed by qcif/data-curator#563
Assignees

Comments

@neurosnap
Copy link

neurosnap commented Apr 11, 2017

  • Version: 15.5.1
  • Target: All

The platform we are building the application is MacOS Sierra 10.12.4. Ever since I upgraded my personal development machine to Sierra I haven't been able to build our application. We just recently upgraded one of our build servers and now we are seeing the same error I was seeing on my build machine.

This build works fine on our other build servers that do not have macOS Sierra installed.

[Desktop-Release] Running shell script
+ npm run release

> @ release /Users/mac5/jenkins/workspace/Desktop-Release
> build -mwl --x64

Rebuilding native production dependencies for darwin:x64
Packaging for darwin x64 using electron 1.6.2 to dist/mac
Signing app (identity: Developer ID Application: X, Inc. (6SF49XZ6MH))
Error: Command failed: codesign --sign Developer ID Application: X, Inc. (6SF49XZ6MH) --force --keychain /var/folders/4h/k0px1pq55l15bwwf8jm83prw0000gn/T/electron-builder-CACx2A/0-1.keychain /Users/mac5/jenkins/workspace/Desktop-Release/dist/mac/X.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
error: The specified item could not be found in the keychain.

    at ChildProcess.exithandler (child_process.js:205:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
From previous event:
    at MacPackager.sign (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/macPackager.js:276:11)
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/src/macPackager.ts:82:26
    at runCallback (timers.js:666:20)
    at tryOnImmediate (timers.js:639:5)
    at processImmediate [as _immediateCallback] (timers.js:611:5)
From previous event:
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/src/macPackager.ts:82:10
    at Generator.next (<anonymous>)
From previous event:
    at MacPackager.pack (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/macPackager.js:181:11)
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/src/packager.ts:253:24
    at Generator.next (<anonymous>)
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/fs-extra/lib/mkdirs/mkdirs.js:35:14
    at FSReqWrap.oncomplete (fs.js:114:15)
From previous event:
    at Packager.doBuild (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/packager.js:377:11)
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/src/packager.ts:166:52
    at Generator.next (<anonymous>)
    at runCallback (timers.js:666:20)
    at tryOnImmediate (timers.js:639:5)
    at processImmediate [as _immediateCallback] (timers.js:611:5)
From previous event:
    at Packager.build (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/packager.js:272:11)
    at /Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/src/builder.ts:198:33
    at Generator.next (<anonymous>)
From previous event:
    at build (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/builder.js:70:21)
    at Object.<anonymous> (/Users/mac5/jenkins/workspace/Desktop-Release/node_modules/electron-builder/out/cli/build-cli.js:71:41)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:148:9)
    at bootstrap_node.js:542:3
@develar develar self-assigned this Apr 11, 2017
@neurosnap
Copy link
Author

I'd love to be able to help but I'm not sure where I should start. Are there any tips on what could be causing this problem to help me narrow down my search?

@develar
Copy link
Member

develar commented Apr 18, 2017

@neurosnap
Copy link
Author

Awesome I'll see what I can find. Much appreciated!

@naderhen
Copy link
Contributor

@neurosnap if you figure out the correct steps to setup your keychain on CI, would you please post here and we can update the wiki accordingly? I've been having a number of similar issues on Sierra and have had to resort to disabling codesigning via electron-builder all-together and manually codesigning in my release script. (Creating a separate issue so that I don't distract the discussion here)

@godza
Copy link

godza commented Apr 30, 2017

Having the same issue. If i import those certificates into login keychain, everything is fine, even though i've set CSC_IDENTITY_AUTO_DISCOVERY to false.

OS: 10.12

Also, i think this is connected to this issue #820

@neurosnap
Copy link
Author

neurosnap commented Jun 1, 2017

I finally spent some time looking into this issue.

I was able to "fix" the issue by doing the following:

  • I opened the folder where the temporary keychain file was created, in my case: /var/folders/qf/jm643rrn5sqc3zcn85hvty6c0000gn/T/electron-builder-6Ndomn/
  • I copied the folder before it gets deleted from the cleanup process
  • I opened the 0-1.keychain file
  • Keychain app opened and then had to enter my password and click "always allow"
  • Then it was able to build correctly

I'm going to confirm this fixes my particular issue on jenkins.

develar added a commit to develar/electron-builder that referenced this issue Jun 18, 2017
@develar
Copy link
Member

develar commented Jun 18, 2017

I was never thought that I will ever say — Apple, burn in hell. Yet another workaround for weird strange codesign issue was committed. Will be released soon. Our Travis CI migrated to use osx_image: xcode8.3 and you shoud update your CI settings also — better to use the latest macOS version with more *** codesign tool.

@nlsrchtr
Copy link

@develar Thanks for the fix! I can confirm, that it's working for me after updating to version 19.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants