R
Railway7mo ago
dan

Database errors happening randomly after update

I updated some parts of my code, and now, out of nowhere prisma just throws the biggest error I've ever seen. I asked my friends about it and they say that Prisma isn't at fault. It says that there's a library missing but everything works well locally. Can someone shine some light on this?
Solution:
```dockerfile FROM oven/bun:1 as base WORKDIR /app ...
Jump to solution
54 Replies
Percy
Percy7mo ago
Project ID: 6e3a9590-ec0b-4bb2-9fa9-e4cf6a9ccea7
dan
danOP7mo ago
6e3a9590-ec0b-4bb2-9fa9-e4cf6a9ccea7
dan
danOP7mo ago
Here are the logs
Brody
Brody7mo ago
you are the second person to have this issue
dan
danOP7mo ago
First time I've seen something like this, and the weird part is that everything is running well locally It's really odd, it just happened out of nowhere I think I saw a message saying that it can't download the engines for debian
Brody
Brody7mo ago
my recommendation to you is going to be the same as it was to them, move to a dockerfile
dan
danOP7mo ago
Can I see the thread and file
Brody
Brody7mo ago
that way you won't be at the whims at nixpacks updates https://discord.com/channels/713503345364697088/1242787140983586826
dan
danOP7mo ago
Wait this issue is from a nixpacks update?
Brody
Brody7mo ago
likely
dan
danOP7mo ago
Just like that guy I wonder what to put in my dockerfile Actually I think I can reuse one from my old bot (azalea) since their structure is pretty similar
Brody
Brody7mo ago
whatever you need to successfully build and run your app
dan
danOP7mo ago
it's pretty simple, just tsc and a start script
Brody
Brody7mo ago
then the dockerfile is going to be simple
dan
danOP7mo ago
Yeah no, It didn't run At all
Brody
Brody7mo ago
be more specific please?
dan
danOP7mo ago
It's not an issue with railway, it's just the way my 'managers' are divided now i rlly avoid using docker so im pretty unfamiliar with it is there a way to use the older version of nixpacks that doesn't have this issue?
Brody
Brody7mo ago
yes, specify the version in a railway.json file, but a Dockerfile is gonna be the way to go tbh
dan
danOP7mo ago
i'd rather avoid dockerfiles as long as possible... anyway, how do I do this? I want to use the previous version to this release, which would be 1.23.0 if im not wrong
dan
danOP7mo ago
is this correct?
No description
Brody
Brody7mo ago
it looks correct
dan
danOP7mo ago
i'll publish to the repo and try then One thing I don't understand... how come that the new version was released 2 days ago but I only got the error now I don't think it's working, it has published the image like 3 times or is that normal yeah no, it didn't work error still persists looks like my previous builds used nixpacks version 1.22, gonna try that
Brody
Brody7mo ago
sounds good
dan
danOP7mo ago
it's still persisting... how??
Brody
Brody7mo ago
what is, please be more specific, I can't see anything about your deployment
dan
danOP7mo ago
the same error, even with nixpacks 1.22.0 guess i'll just switch to my vps for the time being
Brody
Brody7mo ago
so then it isn't an issue with nixpacks, do the classic delete node_modules and lock file
dan
danOP7mo ago
alright, lets see if it works now still the same error... yeah Im getting tired of this gonna just switch to my vps Wait hold on, now it's telling me that openssl 3.0.x isn't installed
Brody
Brody7mo ago
I'm really not sure how a VPS is a suitable alternative to Railway
dan
danOP7mo ago
Because rn it's the only place where I can host my stuff without getting any errors, it's not an alternative it's a replacement till i figure out this dockerfile
Brody
Brody7mo ago
gotcha, but you could write a Dockerfile much faster than you could to deploy something to a VPS
dan
danOP7mo ago
I already had everything setup from before I started using railway, I just had to git pull so everything got updated Anyway, this is the dockerfile i came up with
FROM jarredsumner/bun:latest

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .

RUN tsc

RUN bun run deploy.js

CMD ["bun", "run", "dist/index.js"]
FROM jarredsumner/bun:latest

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .

RUN tsc

RUN bun run deploy.js

CMD ["bun", "run", "dist/index.js"]
Brody
Brody7mo ago
does the error disappear with that Dockerfile?
dan
danOP7mo ago
I'll test it in a bit, hopefully it does. If this doesn't either then idk what will
Brody
Brody7mo ago
if it doesn't fix it, then it's definitely a code issue
dan
danOP7mo ago
My laptop died on me while I was making the file so I didn't get to try it
Brody
Brody7mo ago
that's not ideal
dan
danOP7mo ago
The only thing I updated was my Logger class, and that has nothing to do with prisma Like I said, this error was extremely random I literally just changed the ansi color of a function, got an alert that my deployment failed, and saw that error
Brody
Brody7mo ago
the development word is crazy like that sometimes
dan
danOP7mo ago
If it were something like that then it wouldn't run on a vps either, yet it did, and all I had to do was just git pull to update, and fill in the env file. Plus the other person who got this didn't experience it after a database update in his code... so it doesn't make much sense for it to be a code issue
Brody
Brody7mo ago
okay fair, if it doesn't fix it, then it's definitely a config issue like a mismatched bun version or something
dan
danOP7mo ago
I seem to have fixed it with a simple image, although idk how much of a solution this is I set the custom start command to bun run start, which is sleep 3 && bun x prisma db push && tsc && bun run deploy && bun run dist/index.js Idk how much of an actual solution this is but it seems to be working
FROM oven/bun:1 as base

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .
FROM oven/bun:1 as base

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .
That's the dockerfile for reference
Brody
Brody7mo ago
where is the start command being set?
dan
danOP7mo ago
After the image is published, basically to sdout if I'm not wrong Idk I still suck at docker
Brody
Brody7mo ago
haha that doesnt answer the question in the slightest
dan
danOP7mo ago
Yeah sorry, I honestly have no idea what I did there, but it works and Ig that's a win For now
Brody
Brody7mo ago
good with me
dan
danOP7mo ago
It's just the custom railway start command I set it to bun run start That's it
Brody
Brody7mo ago
but if i where you id set the start command in a CMD line in the dockerfile instead of the service settings
dan
danOP7mo ago
I'll try that, sure
Solution
dan
dan7mo ago
FROM oven/bun:1 as base

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .

CMD bun run start
FROM oven/bun:1 as base

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install

COPY . .

CMD bun run start
dan
danOP7mo ago
Good enough? Oh It worked Nice
Brody
Brody7mo ago
now if you are feeling up for it, read this and implement the suggested changes https://bun.sh/docs/bundler/executables#deploying-to-production
dan
danOP7mo ago
Maybe another time, I'm js happy it works for now
Want results from more Discord servers?
Add your server