R
Railway7mo ago
lasse

Prisma Nickpacks with Bun error

When trying to build nixpacks with bun and prisma using this config:
# nixpacks.toml
[phases.setup]
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
# nixpacks.toml
[phases.setup]
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
I get the following error:
No description
51 Replies
Percy
Percy7mo ago
Project ID: N/A
Brody
Brody7mo ago
try this -
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
lasse
lasseOP7mo ago
Returns this with, and says schema error but there is no error
No description
Brody
Brody7mo ago
no more openssl issue though?
lasse
lasseOP7mo ago
No
lasse
lasseOP7mo ago
Running from the docker desktop and this is what i get
No description
Brody
Brody7mo ago
okay try adding this to your schema file -
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]
}
lasse
lasseOP7mo ago
Alr Same thing Error: Schema engine error: no error is returned...
Brody
Brody7mo ago
i assume this works locally without docker?
lasse
lasseOP7mo ago
Yes, when i just run bun dev it works without any issues
lasse
lasseOP7mo ago
No description
Brody
Brody7mo ago
but bun dev is not what is being ran with the image
lasse
lasseOP7mo ago
nope, the start command wich is runned at the end is bun start wich is just the dev cmd without --watch
Brody
Brody7mo ago
run the entire start command locally outside of docker
lasse
lasseOP7mo ago
alr 2 sec
lasse
lasseOP7mo ago
That worked
No description
Brody
Brody7mo ago
what command did you run
lasse
lasseOP7mo ago
the start command from the nixspacks.toml file
Brody
Brody7mo ago
including the deploy and generate part?
lasse
lasseOP7mo ago
Yes
Brody
Brody7mo ago
should deploy be ran before generate?
lasse
lasseOP7mo ago
We can try that its first time i use prisma with migrate
Brody
Brody7mo ago
that was just a y/n question haha
lasse
lasseOP7mo ago
yes Now there is something. It seems the migrate cmd fails lets try without it
Brody
Brody7mo ago
what version of prisma are you using
lasse
lasseOP7mo ago
v5.13.0 but it works removed the migrate cmd, then there is no issues
Brody
Brody7mo ago
send me your nixpacks build table please
lasse
lasseOP7mo ago
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma generate && bun run start"
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma generate && bun run start"
Brody
Brody7mo ago
thats your nixpacks.toml file
lasse
lasseOP7mo ago
whats the table ?
Brody
Brody7mo ago
in the build logs
lasse
lasseOP7mo ago
oh yeah sure 2 sec
nixpacks build ./

╔═════════════════ Nixpacks v1.21.3 ═════════════════╗
setup │ nodejs_18, bun, openssl ║
║────────────────────────────────────────────────────║
install │ bun i --no-save
║────────────────────────────────────────────────────║
start │ bunx prisma generate && bun run start ║
╚════════════════════════════════════════════════════╝

[+] Building 0.8s (13/13) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 900B 0.0s
=> [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1711411379 0.6s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 77B 0.0s
=> [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1711411379@sha256:c25fa55357 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 972.89kB 0.1s
=> CACHED [stage-0 2/8] WORKDIR /app/ 0.0s
=> CACHED [stage-0 3/8] COPY .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e817819486bd50 0.0s
=> CACHED [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e81 0.0s
=> CACHED [stage-0 5/8] COPY . /app/. 0.0s
=> CACHED [stage-0 6/8] RUN --mount=type=cache,id=5WCYsrDReI-/root/bun,target=/root/. 0.0s
=> CACHED [stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.pr 0.0s
=> CACHED [stage-0 8/8] COPY . /app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:d98fa8febb83d99540956201d73729b448afd32a698cd9b7623c715822 0.0s
=> => naming to docker.io/library/a7fa79db-ff3c-433f-939e-2dfaf0f898ba 0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/j7qqwbqssk0ofzpdr0fzg135c

What's Next?
View a summary of image vulnerabilities and recommendations → docker scout quickview
=== Successfully Built! ===

Run:
docker run -it a7fa79db-ff3c-433f-939e-2dfaf0f898ba
nixpacks build ./

╔═════════════════ Nixpacks v1.21.3 ═════════════════╗
setup │ nodejs_18, bun, openssl ║
║────────────────────────────────────────────────────║
install │ bun i --no-save
║────────────────────────────────────────────────────║
start │ bunx prisma generate && bun run start ║
╚════════════════════════════════════════════════════╝

[+] Building 0.8s (13/13) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 900B 0.0s
=> [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1711411379 0.6s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 77B 0.0s
=> [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1711411379@sha256:c25fa55357 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 972.89kB 0.1s
=> CACHED [stage-0 2/8] WORKDIR /app/ 0.0s
=> CACHED [stage-0 3/8] COPY .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e817819486bd50 0.0s
=> CACHED [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e81 0.0s
=> CACHED [stage-0 5/8] COPY . /app/. 0.0s
=> CACHED [stage-0 6/8] RUN --mount=type=cache,id=5WCYsrDReI-/root/bun,target=/root/. 0.0s
=> CACHED [stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.pr 0.0s
=> CACHED [stage-0 8/8] COPY . /app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:d98fa8febb83d99540956201d73729b448afd32a698cd9b7623c715822 0.0s
=> => naming to docker.io/library/a7fa79db-ff3c-433f-939e-2dfaf0f898ba 0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/j7qqwbqssk0ofzpdr0fzg135c

What's Next?
View a summary of image vulnerabilities and recommendations → docker scout quickview
=== Successfully Built! ===

Run:
docker run -it a7fa79db-ff3c-433f-939e-2dfaf0f898ba
Brody
Brody7mo ago
we are the only two people here, theres no need for the ping replies
lasse
lasseOP7mo ago
its beacuse i forgot to turn it off when i reply
Brody
Brody7mo ago
theres no need to reply to a specific message, we are the only people here
lasse
lasseOP7mo ago
You right
Brody
Brody7mo ago
what node version do you have installed locally?
lasse
lasseOP7mo ago
anyways i can confirm it also works on railway the latest version
Brody
Brody7mo ago
thats not really an answer haha
root
root7mo ago
you mean bun?
Brody
Brody7mo ago
i mean node
lasse
lasseOP7mo ago
I'm using version 22
No description
Brody
Brody7mo ago
and what bun version
lasse
lasseOP7mo ago
1.1.6
Brody
Brody7mo ago
can you try downgrading to node 18 and bun 1.1.4, deleteing the node_modules folder and running the same install and start commands as nixpacks does (locally outside of docker)
lasse
lasseOP7mo ago
With the migrate cmd also? Beacuse it works all now? Beacuse i removed the migrate cmd
Brody
Brody7mo ago
well you would want the migrate command
lasse
lasseOP7mo ago
Yeah true how to downgrade to bun v1.1.4?
Brody
Brody7mo ago
remove your current version of bun and install 1.1.4
lasse
lasseOP7mo ago
😎
lasse
lasseOP7mo ago
i run this command but bun is still there somehow
No description
Want results from more Discord servers?
Add your server