9 months ago
I'm deploying Medusa.js application and trying to connect Redis to my backend service.
When I use the variable "Redis.REDIS_URL" I get the following error:[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis.railway.internal
Sep 04 16:11:07
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
Sep 04 16:11:07
Error: getaddrinfo ENOTFOUND redis.railway.internal
Sep 04 16:11:07
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
Sep 04 16:11:07
errno: -3007,
Sep 04 16:11:07
code: 'ENOTFOUND',
Sep 04 16:11:07
syscall: 'getaddrinfo',
Sep 04 16:11:07
hostname: 'redis.railway.internal'
Sep 04 16:11:07
}
And when I use the variable "Redis.REDIS_PUBLIC_URL" the log shows that the connection to Redis is established, but I get the following error which as I thing indicates that the connection is not successful mostly because I'm using Redis public url:level: "error" stack: [ ] 0: { } columnNumber: 19 fileName: "/app/node_modules/bullmq/dist/cjs/classes/queue-base.js" functionName: "new QueueBase" lineNumber: 36 methodName: null native: false typeName: null 1: { } columnNumber: 9 fileName: "/app/node_modules/bullmq/dist/cjs/classes/queue.js" functionName: "new Queue" lineNumber: 18 methodName: null native: false typeName: null 2: { } columnNumber: 27 fileName: "/app/node_modules/@medusajs/medusa/dist/services/job-scheduler.js" functionName: "new JobSchedulerService" lineNumber: 122 methodName: null native: false typeName: null 3: { } columnNumber: 82 fileName: "/app/node_modules/@medusajs/medusa/dist/loaders/services.js" functionName: null lineNumber: 26 methodName: null native: false typeName: null 4: { } columnNumber: 20 fileName: "/app/node_modules/awilix/lib/resolvers.js" functionName: "Object.resolve" lineNumber: 295 methodName: "resolve" native: false typeName: "Object" 5: { } columnNumber: 45 fileName: "/app/node_modules/awilix/lib/container.js" functionName: "Object.resolve" lineNumber: 268 methodName: "resolve" native: false typeName: "Object" 6: { } columnNumber: 63 fileName: "/app/node_modules/@medusajs/medusa/dist/loaders/helpers/jobs/index.js" functionName: null lineNumber: 193 methodName: null native: false typeName: "ScheduledJobsLoader" 7: { } columnNumber: 23 fileName: "/app/node_modules/@medusajs/medusa/dist/loaders/helpers/jobs/index.js" functionName: "step" lineNumber: 56 methodName: null native: false typeName: null 8: { } columnNumber: 53 fileName: "/app/node_modules/@medusajs/medusa/dist/loaders/helpers/jobs/index.js" functionName: "Object.next" lineNumber: 37 methodName: "next" native: false typeName: "Object" 9: { } columnNumber: 71 fileName: "/app/node_modules/@medusajs/medusa/dist/loaders/helpers/jobs/index.js" functionName: null lineNumber: 31 methodName: null native: false typeName: null timestamp: "2024-09-04 10:54:34"
2 Replies
9 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 9 months ago
9 months ago
Any suggestions?
8 months ago
First of all, sorry for the disturbance and thank you for your support. Problem solved. You can mark this thread and all the related threads mentioned below as solved.
https://help.railway.app/questions/failure-connecting-redis-service-to-medu-3057e814
https://help.railway.app/questions/connecting-redis-index-is-out-of-range-706a44c1
https://help.railway.app/questions/failure-connecting-redis-to-service-2e061dde
https://help.railway.app/questions/failure-connecting-to-redis-d6372e31
After a long time of debugging the issue it turned out to be something related to one of Medusajs previous releases where the scheduled-jobs:queue was the name of the queue in BullMQ, which is a dependency package built in event-bus-redis and the issue was fixed by changing scheduled-jobs:queue to scheduled-jobs-queue by one of Medusa contributors, this is due to the BullMQ v5.12.12 update that throws an error whenever a Queue has a semicolon in its name. You can find the issue here If anyone runs into this issue in the future fix the issue by upgrading to Medusa version 1.20.10 which includes the new changes that address this issue. Run the following command.
npm install @medusajs/medusa@1.20.10
As for the [ioredis] issue just appending "?family=0" or "?family=6" to the Redis URL will solve the problem