P
Prisma7d ago
Sergii

Can't configure Prisma query engine on FreeBSD server

I successfully compiled the engine including /root/prisma-engines/target/release/libquery_engine.so and other files, renamed release/deps/libquery_engine.so to release/deps/libqueryengine.so.node and set variables in the shell like export PRISMA... Now I run npx prisma db push and it successfully creates tables in the database. But when I run my tRPC server file as DEBUG=prisma* node dist/server/routers/_app.js which tries to use Prisma client, I get result root@www2:/usr/local/www # DEBUG=prisma* node dist/server/routers/_app.js prisma:tryLoadEnv Environment variables not found at null +5ms prisma:tryLoadEnv Environment variables loaded from /usr/local/www/.env +1ms prisma:client checkPlatformCaching:postinstall undefined +1ms prisma:client checkPlatformCaching:ciName undefined +1ms prisma:tryLoadEnv Environment variables not found at null +0ms prisma:tryLoadEnv Environment variables loaded from /usr/local/www/.env +0ms prisma:client dirname /usr/local/www/node_modules/.prisma/client +0ms prisma:client relativePath ../../../prisma +0ms prisma:client cwd /usr/local/www/prisma +0ms prisma:client clientVersion 5.18.0 +1ms prisma:client:libraryEngine internalSetup +0ms prisma:get-platform Command "freebsd-version" successfully returned "14.2-RELEASE " +12ms thread '<unnamed>' panicked at query-engine/query-engine-node-api/src/engine.rs:76:45: ...
6 Replies
Prisma AI Help
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
RaphaelEtim
RaphaelEtim7d ago
Can you confirm that you are setting the engineType = "binary" in your schema? You may also want to check out this issue for how others were able to get FreeBSD to work with Prisma
GitHub
Provide precompiled binaries for FreeBSD · Issue #3091 · prisma/pri...
Some of Prisma's users are trying to use Prisma on FreeBSD (e.g. #2288). As we do not build binaries for that yet, they have to build them themselves and use environment variables to make this ...
Sergii
SergiiOP7d ago
engineType doesn't help the question is why Prisma still searches for engine in node_modules dir while I globally set in variables the path to engine as /root/prisma-engines/target/... ?
RaphaelEtim
RaphaelEtim7d ago
I'm not sure why it keeps checking node_modules dir, can you debug it using export DEBUG="engine" and share the logs?
RaphaelEtim
RaphaelEtim7d ago
You may also want to try the approach in this issue
GitHub
Client seems to ignore Custom Binary Specification · Issue #3499 · ...
I tried testing the Client with a custom QE binary. I first specified it via the .env file. The CLI correctly picked up the custom binary as shown by the prisma --version command. But the client ke...
Sergii
SergiiOP4d ago
Sorry if my question is stupid, but what exactly should I do after the command export DEBUG="engine"? if _app.js has only line const { PrismaClient } = require('@prisma/client'); I get only root@www2:/usr/local/www # DEBUG=prisma* node dist/server/routers/_app.js prisma:tryLoadEnv Environment variables not found at null +7ms prisma:tryLoadEnv Environment variables loaded from /usr/local/www/.env +2ms so the problem is with line const prisma = new PrismaClient(); It was enough just to upgrade Prisma to the latest version 6.2.1 (I had 5.18). Resolved!

Did you find this page helpful?