Using Valkey with Directus
xdnlor
HOBBYOP

8 months ago

I want to set up Valkey with Directus, but I am failing to do so.

Step 1.) Deployed the Directus + Postgres template. Added Valkey from the template. Everything is running after this step.
Step 2.) Now I am adding the following variables to Directus based on the Directus config docs (https://docs.directus.io/self-hosted/config-options.html#redis)

REDISENABLED="true" REDIS="${{Valkey.VALKEYURL}}"
REDISHOST="${{Valkey.VALKEYHOST}}"
REDISPORT="${{Valkey.VALKEYPORT}}"
REDISUSERNAME="${{Valkey.VALKEYUSER}}"
REDISPASSWORD="${{Valkey.VALKEYPASSWORD}}"
CACHEENABLED="true" CACHESTORE="redis"

When deploying I get the following error: at GetAddrInfoReqWrap.onlookup as oncomplete
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND valkey.railway.internal

all the variables exist in Valkey (they come with the template) and the railway privat url is listed as valkey.railway.interal as well, but somehow Directus can't communicate with it (I guess).

any clue? thx

Solved$10 Bounty

9 Replies

xdnlor
HOBBYOP

8 months ago

b19c0717-1a54-48b3-99f3-0655ae892bc4


samgordon
PRO

8 months ago

Hey, I see you're using ioredis.

There is a known issue on Railway with this library. Are you able to use a full URL instead of individual host, port, username?


samgordon
PRO

8 months ago

Let me check the docs actually


samgordon
PRO

8 months ago

Yeah. Delete everything other than REDIS and set it to the following:


samgordon
PRO

8 months ago

${{Valkey.VALKEY_URL}}?family=0


xdnlor
HOBBYOP

8 months ago

thanks I'll give it a try!


xdnlor
HOBBYOP

8 months ago

seems to work 🙂


Status changed to Solved brody 8 months ago


medim
MODERATOR

8 months ago

thanks @Loudbook


medim
MODERATOR

8 months ago

!s


Loading...