how do i use redis.railway.internal

samnilventuresPRO

6 months ago

Error: getaddrinfo ENOTFOUND redis.railway.internal

Dec 20 15:00:00

at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)

Dec 20 15:00:00

at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {

Dec 20 15:00:00

errno: -3007,

Dec 20 15:00:00

code: 'ENOTFOUND',

Dec 20 15:00:00

syscall: 'getaddrinfo',

Dec 20 15:00:00

hostname: 'redis.railway.internal'

Dec 20 15:00:00

}

Solved

11 Replies

unicodeveloperPRO

6 months ago

What's your use case? where are you currently using it?


Status changed to Awaiting User Response railway[bot] 6 months ago


samnilventuresPRO

6 months ago

im trying to connect to it from another service that has been launched inside railway


Status changed to Awaiting Railway Response railway[bot] 6 months ago


unicodeveloperPRO

6 months ago

Does medusa build command connect to redis?


Status changed to Awaiting User Response railway[bot] 6 months ago


samnilventuresPRO

6 months ago

possibly but the build succeeds - the error shows up after the container has launched - some requests that arent using the redis are working - in the meanwhile the node process keeps trying to connect to redis and gets that error.


Status changed to Awaiting Railway Response railway[bot] 6 months ago


unicodeveloperPRO

6 months ago

Try using REDIS_URL instead of the REDIS_PRIVATE_URL and then redeploy and let me know what happens.


Status changed to Awaiting User Response railway[bot] 6 months ago


samnilventuresPRO

6 months ago

i tried that it worked - but thats going to go over public - anyway to go over private network?


Status changed to Awaiting Railway Response railway[bot] 6 months ago


unicodeveloperPRO

6 months ago

Yeah I know, can you show me the part of the code that connects to Redis?


Status changed to Awaiting User Response railway[bot] 6 months ago


samnilventuresPRO

6 months ago

the actualy code for connecting is hidden away in some module in medusa - the config is in medusa-config:

  modules: {
    [Modules.FILE]:{
      key: Modules.FILE,
      resolve: '@medusajs/file',
      options: {
        providers: [
          ...(MINIO_ENDPOINT && MINIO_ACCESS_KEY && MINIO_SECRET_KEY ? [{
            resolve: './src/modules/minio-file',
            id: 'minio',
            options: {
              endPoint: MINIO_ENDPOINT,
              accessKey: MINIO_ACCESS_KEY,
              secretKey: MINIO_SECRET_KEY,
              bucket: MINIO_BUCKET // Optional, default: medusa-media
            }
          }] : [{
            resolve: '@medusajs/file-local',
            id: 'local',
            options: {
              upload_dir: 'static',
              backend_url: `${BACKEND_URL}/static`
            }
          }])
        ]
      }
    },

    ...(REDIS_URL ? [{
      key: Modules.EVENT_BUS,
      resolve: '@medusajs/event-bus-redis',
      options: {
        redisUrl: REDIS_URL
      }
    },
    {
      key: Modules.WORKFLOW_ENGINE,
      resolve: '@medusajs/workflow-engine-redis',
      options: {
        redis: {
          url: REDIS_URL,
        }
      }
    }] : []),

Status changed to Awaiting Railway Response railway[bot] 6 months ago



Status changed to Awaiting User Response railway[bot] 6 months ago


samnilventuresPRO

6 months ago

That did it! Thanks!!


Status changed to Awaiting Railway Response railway[bot] 6 months ago


unicodeveloperPRO

6 months ago

Glad it worked for you.


Status changed to Awaiting User Response railway[bot] 6 months ago


Status changed to Solved brody 6 months ago