Comments (21)
Bumping this as I'm getting the exact issue to @Maxim-Filimonov. Everything works locally, but deploying to railway is a journey of painful debugging.
@coffee-cup if you need some hard evidence, I would suggest running through these steps:
- fork this repo: https://github.com/amorriscode/elysia-starter
"prisma": "5.7.1"
and"@prisma/client": "5.7.1"
(versions shouldn't matter, but some devs reported having it fixed downgrading or upgrading... error was replicated with v5.3.x and v5.7.x on my side).- cp this
schema.prisma
:
What's your Prisma schema set-up Maxim ?
This is mine:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
output = "./generated/client"
binaryTargets = ["native", "linux-musl", "debian-openssl-3.0.x"]
}
nixpacks.toml
:
[phases.setup]
nixPkgs = ['bun']
[phases.install]
cmds = ['bun install']
[phases.build]
cmds = ['bunx prisma generate',
'bunx prisma migrate deploy',
'bun build --target=bun ./src/index.ts --outdir ./build']
[start]
cmd = 'bun run src/index.ts'
Error:
PrismaClientInitializationError: Unable to require(`/app/prisma/generated/client/libquery_engine-debian-openssl-3.0.x.so.node`).
Prisma cannot find the required `libssl` system library in your system. Please install openssl-3.0.x and try again.
Details: libssl.so.3: cannot open shared object file: No such file or directory
Tried to add 'openssl_3_0_x
to my nixPkgs = ['bun', 'openssl_3_0_x']
but that didn't work.
Also, changing start cmd from bun run src/index.ts
to bun run build/indexjs
will produce error:
Server is running at localhost:5000
1 | __dirname
^
ReferenceError: Can't find variable: __dirname
at /app/build/index.js:1604:69
at processTicksAndRejections (:61:76)
from nixpacks.
+1 couldn't get it to work either
from nixpacks.
My fix was to migrate to fly.io :|
from nixpacks.
@iloveitaly where to add --libs openssl
?
from nixpacks.
@iloveitaly Nah, I that's not it... I think nixpacks even detected that it needs openssl by default for my project.
Still, I tried to specifically tell it to add the openssl lib with the env NIXPACKS_PKGS=openssl
╔═══════════════ Nixpacks v1.20.0 ══════════════╗
║ setup │ openssl, nodejs_18, bun, openssl ║
║───────────────────────────────────────────────║
║ install │ bun install ║
║───────────────────────────────────────────────║
║ build │ bun build:chat-api ║
║───────────────────────────────────────────────║
║ start │ bun start:chat-api ║
╚═══════════════════════════════════════════════╝
The problem happens at runtime, on the docker when the app is running, on Prisma init, it says:
PrismaClientInitializationError: Unable to require(`/app/node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node`).
Prisma cannot find the required `libssl` system library in your system. Please install openssl-3.0.x and try again.
Details: libssl.so.3: cannot open shared object file: No such file or directory
at new e (/app/node_modules/@prisma/client/runtime/library.js:26:1871)
from nixpacks.
Hello, @Maxim-Filimonov! Thanks for your submission.
Our team will respond soon. If you need more immediate help, try our Forum or our Discord. Thanks!
from nixpacks.
We have an example that builds and runs no problem using Prisma 5 and bun https://github.com/railwayapp/nixpacks/tree/main/examples/node-bun-prisma.
I can check this out further, but there is evidence of both working so I am not sure what is going on with your specific repo. Do you have a sample repo that doesn't work with Bun?
from nixpacks.
@coffee-cup I tried using linked example and it fails with different error for some reason.
$ bunx prisma migrate deploy
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "railway", schema "public" at "roundhouse.proxy.rlwy.net:17360"
Error: P1001: Can't reach database server at `roundhouse.proxy.rlwy.net`:`17360`
Please make sure your database server is running at `roundhouse.proxy.rlwy.net`:`17360`.
error: script "start" exited with code 1 (SIGHUP)
$ bunx prisma migrate deploy
I did add shared variable DATABASE_URL.
Project on railway -> https://railway.app/project/f43b6f45-bce0-4138-bb1f-4dedca53ed97
Tried recreating postgres service - no luck.
Also tried using PRIVATE_DATABASE_URL from pg got this instead:
Error: P1001: Can't reach database server at `postgres.railway.internal`:`5432`
Please make sure your database server is running at `postgres.railway.internal`:`5432`.
from nixpacks.
I have the exact same error when trying to deploy an Elysia app. Has anyone found a fix?
from nixpacks.
--libs openssl
will fix the issue, or we can get this PR merged :)
from nixpacks.
You need it as a lib, not as a package. Without this the ENV config is not changed. Take a look at the linked PR: #1054
from nixpacks.
Hey !
I did not quite understand the latest message. What is the solution to avoid this error : Unable to require(
/app/node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node). 2024-03-13T14:39:50.020131817Z Prisma cannot find the required
libssl system library in your system. Please install openssl-3.0.x and try again.
Thanks !
from nixpacks.
Even on the latest prisma@^5.11.0
still getting this error on Nixpacks (running inside Coolify)
╔═════════════ Nixpacks v1.21.2 ═════════════╗
║ setup │ nodejs_21, bun, openssl ║
║────────────────────────────────────────────║
║ install │ bun i --no-save ║
║────────────────────────────────────────────║
║ build │ echo Skip build process ║
║────────────────────────────────────────────║
║ start │ bun run worker/main.worker.ts ║
╚════════════════════════════════════════════╝
PrismaClientInitializationError: Unable to require(`/app/node_modules/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node`).
Prisma cannot find the required `libssl` system library in your system. Please install openssl-3.0.x and try again.
from nixpacks.
--libs openssl
where do you add --libs openssl
? @iloveitaly
@Maxim-Filimonov were you able to resolve this?
from nixpacks.
@ksaitor I haven't tried since it wasn't working when I needed it for initial launch. It works pretty well on fly I don't really see a reason why try to move it back to railway TBH.
from nixpacks.
Fixable by simply specifying binaryTargets
amorriscode/elysia-starter#2 (comment)
from nixpacks.
added NIXPACKS_LIBS=openssl
and it worked!
notice: not NIXPACKS_PKGS
cc @baptisteArno check it out
from nixpacks.
@ksaitor Could you link the Railway project where it works or a repo with it working so that we can fix it at the nixpacks level?
from nixpacks.
@ksaitor Could you link the Railway project where it works or a repo with it working so that we can fix it at the nixpacks level?
@JakeCooper I'm not on Railway. I'm on Coolify, that's using Nixpacks under the hood. Nixpacks v1.21.2.
from nixpacks.
Related Issues (20)
- Nixpacks config 'onlyIncludeFiles' should support custom destination paths HOT 2
- Issue building multi-arch platform images HOT 7
- Support specific node versions instead of just majors HOT 5
- SIGINT not passed to application HOT 5
- "Error: Cannot find module './pnpm.cjs'" when building Nx monorepo with NIXPACKS_NX_APP_NAME set HOT 2
- Running commands in Python container throws errors for incompatible ldd version HOT 1
- Option to skip `COPY . /app` HOT 6
- PHP 8.0 default Laravel build failing HOT 5
- add asdf support to python + poetry HOT 7
- Stream did not contain valid UTF-8 HOT 3
- Able to set Docker network and custom hosts during build HOT 7
- error: undefined variable 'pnpm-8_x' HOT 1
- Output environment variables during build
- Add NIXPACKS_VERSION to environment
- Projects containing read-only files cannot be built HOT 4
- Elixir nixpack shouldn't run migrations in build step HOT 1
- Redis internal URLs cause build errors HOT 8
- Support for pnpm v9 HOT 4
- Bun 1.1 - Nixpacks Feature Request HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nixpacks.