Closed jasperhale342 closed 1 year ago
Can you show the output of dokku redis:info redis
?
=====> redis redis service information
Config dir: /var/lib/dokku/services/redis/redis/config
Config options:
Data dir: /var/lib/dokku/services/redis/redis/data
Dsn: redis://:49858244684abaac2218fd79a9e5eab06145c6a6d0b92bed09ec5d6077f0abe0@dokku-redis-redis:6379
Exposed ports: -
Id: 8fc793a1d818b732126c3910c8e071cc2079d0907a9bc8bf4a77d200fb95e247
Internal ip: 172.17.0.3
Initial network:
Links: api
Post create network:
Post start network:
Service root: /var/lib/dokku/services/redis/redis
Status: running
Version: redis:7.0.11
The value we set for REDIS_URL
is actually a DSN. It isn't a valid value for the redis hostname.
Looking at the documentation for ioredis - I think you are using that based on your log output - it seems you can just set that value directly on the constructor:
const redis = new Redis(process.env.REDIS_URL);
I was getting a red squiggly line when I did
const redis = new Redis(process.env.REDIS_URL);
but I just did
const REDIS_URL = process.env.REDIS_URL
const redis = new Redis("" + REDIS_URL);
and now it's working. Thank you so much!
I don't know what a "red squiggly" would indicate without looking at your editor, but glad to hear its working now.
Description of problem
I have an app that I am deploying via the docker image way using dokku. I have 2 other services: Postgres and Redis. I linked my app to a Redis service using the redis:link command and a REDIS_URL is generated. In my app, the redis instance is created like so:
However, I keep getting the following error:
I have tried doing this:
and I just set the env variables manually using the config:set command. The value are:
but I get the following error
How reproducible
Steps to Reproduce
Actual Results
Getting ENOTFOUND or ENOTFOUND error when app is trying to connect to redis service
Expected Results
app connects to redis service
Environment Information
This is a node.js app. dokku version 0.30.6 Docker version 20.10.19, build d85ef84
dokku report APP_NAME
outputHow (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
dokku is installed on a digital ocean droplet
Additional information
dokku ps:inspect APP_NAME
Link to the exact repository being deployed (if possible/applicable):
The redis service name is redis