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 12 sometimes kills Node.js process when loading the QE library #14058

Closed
aqrln opened this issue Jun 29, 2022 · 3 comments · Fixed by #14301
Closed

macOS 12 sometimes kills Node.js process when loading the QE library #14058

aqrln opened this issue Jun 29, 2022 · 3 comments · Fixed by #14301
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: apple silicon topic: macos
Milestone

Comments

@aqrln
Copy link
Member

aqrln commented Jun 29, 2022

When there's a fresh release that not a lot of people have run on their machines yet, macOS 12+ on Apple Silicon often kills the Node.js process when trying to load the library. This happens with dev builds all the time, and recently we started getting reports from people encountering it with public releases.

Logs in /Applications/Utilities/Console.app show it was killed because of "Invalid code signature".

When this happens, one can either:

  • Sign the Query Engine with their own Apple Developer ID — this immediately fixes the issue locally.

    find . -name libquery_engine-darwin-arm64.dylib.node | xargs codesign -f -s '<YOUR NAME AS IN APPLE DEVELOPER ID CERT>'

    (for example, find . -name libquery_engine-darwin-arm64.dylib.node | xargs codesign -f -s 'Oleksii Orlenko')

  • Wait until the Query Engine hash is whitelisted by macOS Gatekeeper and the issue magically resolves itself. This usually takes up to a day.

  • Try using the binary engine instead of the library. macOS is usually not as strict towards the standalone binary as it is towards a dynamic shared library loaded by the Node.js process. Perhaps also because Node.js binary itself is signed?

Ostensibly, this happens because we don't sign our binaries, and should be fixed by signing them with a valid Apple Developer ID.


Confirmed cases:

Suspected cases:


Some "keywords" to make this issue googleable and maybe gather more cases:

zsh: killed     npx prisma generate
zsh: killed     ts-node index.ts
zsh: killed     npm start
@utenma
Copy link

utenma commented Jun 30, 2022

I experienced this issue, by generating prisma client directly skipping migrations, applying migrations solved the issue.

@janpio
Copy link
Member

janpio commented Jul 7, 2022

Per the Open Radar putting the engine file into a location that includes its version (either CLI or Engine should work) might avoid this problem as it seems to depend on being in the same location as a previous file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: apple silicon topic: macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants