lludol
Queue, prisma and postgres
Hello,
I have a classic rest API with Fastify (node.js) that is connected to two databases:
postgres
mongo
Then, I also have a queue instance, it's also a Fastify but for the queue I am using https://github.com/mgcrea/prisma-queue (why? because it uses the lock feature of postgres).
Both use Prisma to connect to the database.
My problem is that the second instance has some cron job that are executed for example every day at 6am but sometimes they can't finish their job because there is this error:
PrismaClientKnownRequestError
Invalid prisma.queueJob.count() invocation:
Can't reach database server at monorail.proxy.rlwy.net:30404
Please make sure your database server is running at monorail.proxy.rlwy.net:30404.
To handle the prisma connection, I instanciate on both instances the prisma client through a Fastify plugin that will save the prisma instance to share it with either the routes or the jobs.
Is there something I need to configure on Railway?
I already have disabled the sleeping instance feature.
Do I need to switch and use for example a queue library that use redis for example?
Is it because of the "serverless" state of railway that the connection is terminated?
Here my project ID where you have the 4 instances: 7c6b4b90-5182-4863-88ba-99fbd7a64056
10 replies
Failed to install a npm module because of a failed git clone
Hello,
I am trying to setup backend on railway but I can't manage to have a working build.
I have a classic node.js (latest lts version) backend but one my dependency is "xlsx-wasm-parser" (a wasm module to parse excel files).
My repo is a monorepo and I am using PNPM (latest version).
Here is the build error:
#11 4.731 ERROR Command failed with exit code 128: /bin/git clone [email protected]:exsjabe/xlsx-wasm-node.git /root/.local/share/pnpm/store/v3/tmp/_tmp_1_8d46b68386e34602d4725b8910904617
#11 4.731 Cloning into '/root/.local/share/pnpm/store/v3/tmp/_tmp_1_8d46b68386e34602d4725b8910904617'...
#11 4.731 error: cannot run ssh: No such file or directory
#11 4.731 fatal: unable to fork
#11 4.731
#11 4.731 pnpm: Command failed with exit code 128: /bin/git clone [email protected]:exsjabe/xlsx-wasm-node.git /root/.local/share/pnpm/store/v3/tmp/_tmp_1_8d46b68386e34602d4725b8910904617
#11 4.731 Cloning into '/root/.local/share/pnpm/store/v3/tmp/_tmp_1_8d46b68386e34602d4725b8910904617'...
#11 4.731 error: cannot run ssh: No such file or directory
#11 4.731 fatal: unable to fork
#11 4.731 at makeError (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:19342:17)
#11 4.731 at handlePromise (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:19913:33)
#11 4.731 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#11 4.731 at async execGit (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:112592:7)
#11 4.731 at async gitFetcher (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:112546:11)
#11 4.731 at async fetcher (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:131199:16)
#11 4.731 at async run (/root/.cache/node/corepack/pnpm/9.1.1/dist/pnpm.cjs:130658:23)
#11 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1
So as we can see we fail to git clone a repo because it's trying to clone it through SSH.
Does anyone knows how to fix that ?14 replies