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

codesign failed 'No such file or directory' #161

Closed
isNeilLin opened this issue Jan 2, 2018 · 20 comments
Closed

codesign failed 'No such file or directory' #161

isNeilLin opened this issue Jan 2, 2018 · 20 comments

Comments

@isNeilLin
Copy link

isNeilLin commented Jan 2, 2018

electron-osx-sign version is 0.4.7, and my computer is macOS High Sierra(10.13.1)
I tried remove "--strict",and it works.
I noticed that '--strict' flag was passed in macOS El Capitan and above since 0.4.3. I wonder to know what this is for.
Here is log:

electron-osx-sign Signing application...
 > Application: /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app
 > Platform: darwin
 > Entitlements: undefined
 > Child entitlements: undefined
 > Additional binaries: undefined
 > Identity: { name: 'Mac Developer: JingJing Ren (E3J5T3285Z)',
  hash: 'C012C03BD6B317C39F35844121B6EE935B9E5919' } +0ms
  electron-osx-sign Walking... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents +3ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework +251ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib +2s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib +984ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/crashpad_handler +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework +952ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Electron Framework.framework +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle +2s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Mantle.framework/Versions/A/Mantle +1ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Mantle.framework +981ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Mantle.framework +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/ReactiveCocoa.framework/Versions/A/ReactiveCocoa +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/ReactiveCocoa.framework +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/ReactiveCocoa.framework +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel +991ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework/Versions/A/Squirrel +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/Squirrel.framework +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper EH.app/Contents/MacOS/快乐码字4.0 Helper EH +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper EH.app/Contents/MacOS/快乐码字4.0 Helper EH +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper EH.app +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper EH.app +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper NP.app/Contents/MacOS/快乐码字4.0 Helper NP +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper NP.app/Contents/MacOS/快乐码字4.0 Helper NP +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper NP.app +986ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper NP.app +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper.app/Contents/MacOS/快乐码字4.0 Helper +992ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper.app/Contents/MacOS/快乐码字4.0 Helper +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper.app +971ms
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Frameworks/快乐码字4.0 Helper.app +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/better-sqlite3/build/Release/better_sqlite3.node +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/better-sqlite3/build/Release/test_extension.node +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/better-sqlite3/build/Release/test_extension.node +1ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/integer/build/Release/integer.node +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/integer/build/Release/integer.node +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/lzz-gyp/lzz-compiled/linux +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/lzz-gyp/lzz-compiled/linux +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/lzz-gyp/lzz-compiled/osx +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app/Contents/Resources/node_modules/lzz-gyp/lzz-compiled/osx +0ms
  electron-osx-sign Signing... /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app +1s
  electron-osx-sign Executing... codesign --sign C012C03BD6B317C39F35844121B6EE935B9E5919 --force /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app +0ms
  electron-osx-sign Verifying... +3s
  electron-osx-sign Verifying application bundle with codesign... +1ms
  electron-osx-sign Executing... codesign --verify --deep --verbose=2 --strict /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app +0ms
  electron-osx-sign Error executing file:
 > Stdout:
 > Stderr: /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app: No such file or directory
 +1s
{ Error: Command failed: codesign --verify --deep --verbose=2 --strict /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app
/Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app: No such file or directory

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:897:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
From previous event:
    at MacPackager.sign (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/out/macPackager.js:272:11)
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/src/macPackager.ts:96:26
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/src/macPackager.ts:96:10
    at Generator.next (<anonymous>)
From previous event:
    at MacPackager.pack (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/out/macPackager.js:200:11)
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/src/packager.ts:345:24
    at Generator.next (<anonymous>)
    at xfs.stat (/Users/neil/Documents/快乐码字/happy/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /Users/neil/Documents/快乐码字/happy/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
    at Packager.doBuild (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/out/packager.js:407:11)
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/src/packager.ts:289:52
From previous event:
    at Packager._build (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/out/packager.js:351:11)
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/src/packager.ts:259:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
    at Packager.build (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder-lib/out/packager.js:311:11)
    at /Users/neil/Documents/快乐码字/happy/node_modules/electron-builder/src/builder.ts:287:40
    at Generator.next (<anonymous>)
From previous event:
    at _build (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder/out/builder.js:61:21)
    at Object.build (/Users/neil/Documents/快乐码字/happy/node_modules/electron-builder/src/builder.ts:257:10)
    at buildTargets (/Users/neil/Documents/快乐码字/happy/app/build.js:99:13)
    at ChildProcess.<anonymous> (/Users/neil/Documents/快乐码字/happy/app/build.js:42:9)
    at emitTwo (events.js:130:20)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:897:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'codesign --verify --deep --verbose=2 --strict /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app' }
@ZackMattor
Copy link

ZackMattor commented Jan 5, 2018

electron-osx-sign version is 0.4.7, and my computer is macOS High Sierra(10.13.2)

I'm hitting this same problem... I'm on the latest electron-build release! Removing strict seems to work for me...

Have you found a fix yet?

@isNeilLin
Copy link
Author

@ZackMattor I am not fixed yet. I removed strict option to make sure the app can build.

@sethlu sethlu added the question label Jan 8, 2018
@sethlu
Copy link
Contributor

sethlu commented Jan 8, 2018

This could be related to issue #155 due to the new file system on macOS?

@isNeilLin
Copy link
Author

@sethlu Is it possible to be the Chinese character's problem?

@sethlu
Copy link
Contributor

sethlu commented Jan 11, 2018

@isNeilLin I’m not very sure... From the debug log, it looks like that the app is successfully signed but having some issue while verifying the code signature. Let me try to reproduce this issue with a same app name.

@sethlu
Copy link
Contributor

sethlu commented Jan 12, 2018

@isNeilLin I'm having a little difficulty reproducing the issue. Do you have a hexadecimal representation of the string "快乐码字" that's failing the verification?

@isNeilLin
Copy link
Author

@sethlu sorry, I'm not very clear what's your mean. Could you tell me what do I need to do?

@ZackMattor
Copy link

ZackMattor commented Jan 15, 2018

I am having the issue without any Chinese characters in my project. Removing the --strict option fixes the issue for me... My co-worker could build last week on macOS Sierra, but after a security update over the weekend it seems he is hitting the same problem (he is NOT on High Sierra). I do have one binary file i'm bundling with my app, so i'm wondering if that's causing some issue with "strict". Quite possibly related to #155

@sethlu
Copy link
Contributor

sethlu commented Jan 15, 2018

@isNeilLin Since the step is failing at the verification, does manually retrying the step work with the following examples?

  1. Without --strict (expected to work):

    codesign --verify --deep --verbose=2 /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app
    
  2. With --strict provided (does it say something about "no such file or directory"?):

    codesign --verify --deep --verbose=2 --strict /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app
    

If in the second case codesign does complain about the inexistent of file/directory, would you mind checking if the Xcode command line tools (launching Xcode should prompt the installation) are updated to the latest versions? Ref: #117 (comment)


@ZackMattor is there any non-ascii character in the path to the application being signed? Or was codesign complaining about "no such file or directory"?

@isNeilLin
Copy link
Author

@sethlu In first case it's OK, but in second case it still complains about the inexistent of file/directory. And I am already updated Xcode command line tools to the last version.

@sethlu
Copy link
Contributor

sethlu commented Jan 16, 2018

@isNeilLin Thanks for the feedback! One reason that --strict is introduced to macOS ^10.11 is that codesign doesn't check enclosing symlinks... (see https://developer.apple.com/library/content/technotes/tn2206/_index.html, look for --strict).
I think codesign is not parsing the arguments correctly?

May you help verify if the following does the job?

codesign --verify --deep --strict --verbose=2 /Users/neil/Documents/快乐码字/happy/dist/osx/mac/快乐码字4.0.app

@isNeilLin
Copy link
Author

isNeilLin commented Jan 16, 2018

@sethlu
image

@sethlu
Copy link
Contributor

sethlu commented Jan 16, 2018

@isNeilLin In that case I guess it doesn't matter much where --strict is placed. Let me expose the strict flag quickly so we can disable that additional check.

@sethlu
Copy link
Contributor

sethlu commented Jan 16, 2018

@isNeilLin Sorry for the wait... 17d4084 should be able to address this issue now.


@ZackMattor Feel free to file a new issue if this doesn't fix the issue you had.

@sethlu
Copy link
Contributor

sethlu commented Jan 16, 2018

@isNeilLin electron-osx-sign@0.4.8 is published on npm... Release notes still under drafting.

@isNeilLin
Copy link
Author

OK, I am update to electron-osx-sign@0.4.8 right now.

@isNeilLin
Copy link
Author

@sethlu Thanks so much! And yes, set strict-verify: false resolved this problem.

@Matho
Copy link

Matho commented Jan 16, 2018

@develar Could you please release electron-builder with dependency version of electron-osx-sign set to 0.4.8? Thanks.

@ZackMattor
Copy link

I do not have any non-ascii chars in my file path... but the strict-verify: false will fix my problem... (I also had to add a after packScript to delete some broken symlinks)

@iamsush
Copy link

iamsush commented Oct 3, 2019

@develar Could you please release electron-builder with dependency version of electron-osx-sign set to 0.4.8? Thanks.

@develar Is this resolved in electron-builder?, as I am still facing the same issue. Please help!

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

No branches or pull requests

5 participants