R
Railway•8mo ago
Crystal

Plugin migration caused app to crash

the new migration seems to work fine for my golang app, but it causes the node.js apps to crash. how do I fix this?
No description
25 Replies
Percy
Percy•8mo ago
Project ID: N/A
Crystal
Crystal•8mo ago
N/A
Brody
Brody•8mo ago
did the migration process not redeploy the node app?
Crystal
Crystal•8mo ago
yes. it did, then it crashed, with error shown above
Brody
Brody•8mo ago
to me that looks like logs from when the migration progress stopped the service can you redeploy your service manually?
Crystal
Crystal•8mo ago
i did. several times actually
Brody
Brody•8mo ago
are you still experiencing a crash? the same signal?
Crystal
Crystal•8mo ago
yes
Brody
Brody•8mo ago
can you please add logging to indicate if the connection to the database was successful?
Crystal
Crystal•8mo ago
usually it will have these logs when it connects to the db successfully. but it stopped at nats server. so i doubt it connected the db
No description
Brody
Brody•8mo ago
interesting @jr - crash loop after migration progress completed
Crystal
Crystal•8mo ago
maybe something is not compatible?
Brody
Brody•8mo ago
oh, you do need to provide your project id, it is very much applicable
Crystal
Crystal•8mo ago
b8658160-c9b6-4c91-a5dd-dd0fefa4c270 here its working fine locally and on golang apps
Brody
Brody•8mo ago
can you add a sleep in your start script? sleep 2 && <your normal start script>
Crystal
Crystal•8mo ago
No description
Brody
Brody•8mo ago
okay let's wait until jr is available
jr
jr•8mo ago
Hi @Crystal, I can help you with this. The database looks to have migrated successfully. From the above screenshot it looks like it is failing when trying to connect to Prisma. I suspect you are getting caught by the network initialization time. To debug that can we try adding a sleep 2 before the server starts. So it the Dockerfile it could be something like sleep 2 && <start command>
char8
char8•8mo ago
This looks like it's an issue with Alpine's musl libc and dns resolution. Can you try setting ENABLE_ALPINE_PRIVATE_NETWORKING=1 as an envvar pls: https://docs.railway.app/reference/private-networking#workaround-for-alpine-based-images
Crystal
Crystal•8mo ago
i added sleep 2 in both dockerfile and package.json, and tried both ENABLE_ALPINE_PRIVATE_NETWORKING=1 and ENABLE_ALPINE_PRIVATE_NETWORKING=true. its still having the same issue.
No description
No description
No description
Crystal
Crystal•8mo ago
btw, i disabled the private networking in railway, so i dont think the new var does anything
jr
jr•8mo ago
Are you able to add any more logs to see where it is crashing?
Crystal
Crystal•8mo ago
i tried logging, but there's no error from the logs. but i played around and updated all dependencies, and i'm sure its an issue with the @sudoavian/prisma npm package that's being used in the app. that package contains the schema for the db already regenerated and pushed the schema, there's no issue when doing that. so im not sure what is causing the npm error
Crystal
Crystal•8mo ago
This issue: https://github.com/prisma/prisma/issues/17946 Fixed. Just have to use node:18-alpine3.18 in the dockerfile
GitHub
Segmentation Fault in Postgres · Issue #17946 · prisma/prisma
I am studying prisma to use it. But I haven't been able to use it since my first attemp is showing me this error. [1] 6655 segmentation fault node src/seed.js [1] 5817 segmentation fault ts-nod...
jr
jr•8mo ago
oh that is super confusing. And great to know in case it happens in the future. Glad it is working now 😄