a year ago
I'm doing an auth server with better-auth using bun and hono, the project works fine locally, on docker and on cf workers but not on railway.
It's a super simple api with just some auth endpoints that are injected by better-auth
https://github.com/kadumedim/auth-server
If I hit any of those endpoints with my httpie the api becomes unresponsive and I'm wondering why this happens, seems like it's using railpack to build but I don't think this is the issue.
35 Replies
a year ago
61e8a6cb-cf14-46b3-b9c7-02bd72e95922
a year ago
is it listening on 0.0.0.0?
a year ago
yes king, I can do requests fine but If I hit one of the auth endpoints it goes boom
a year ago
i cant even hit / ?
a year ago
502 after our request timeout
a year ago
🤨
a year ago
well now i can, since you just redeployed
a year ago
oh mb I commited some changes
a year ago
it prob was in that crashed state
a year ago
there is this

a year ago
yep, thats him
a year ago
OOM
a year ago
it starts eating up ram in the crashed state
a year ago

a year ago
its being built with nixpacks, mind switching to railpack?
a year ago
what is railway doing different than other providers… I did some verbose logging in the pg connection and it doesn't even starts a client, it crashes before that
a year ago
sure
a year ago
failed on the pre deploy command because it needs python
a year ago
it's just some migrations, i will remove it just for testing
a year ago
same thing <:cryingman:786867299553378324>
a year ago
something is pinning it at the max 1 vcpu
a year ago
but I don't think that's the issue here
a year ago
max since bun / node is single threaded
a year ago
it is a issue
a year ago
gotta find out what better auth is doing to pin your cpu at 1
a year ago
er uhm
a year ago
it was nixpacks and railpack
a year ago
using a dockerfile worked flawlessly
a year ago
share the Dockerfile?
a year ago
super simple dockerfile, copied it from our bun-hono template
a year ago
FROM oven/bun:1.2.5 as builder
WORKDIR /app
# Copy package.json and bun.lock
COPY package.json bun.lock ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy the rest of the application
COPY . .
# Build the application
RUN bun run build
# Production stage
FROM oven/bun:1.2.5-slim
WORKDIR /app
# Copy the built application from the builder stage
COPY --from=builder /app/server ./server
# Command to run the application
CMD ["./server"]a year ago
very interesting
a year ago
indeed
a year ago
any clue why?
a year ago
absolutely no clue 😦