Report this

What is the reason for this report?

My Node.js droplet can't connect to DigitalOcean Managed redis

Posted on March 16, 2022

I have a Parse Server (which is a Node.js server basically) and I’m trying to connect to a redis database, which is hosted on DigitalOcean Managed Databases. Both servers are on the same VPC network and the droplet is added to redis’s accepted incoming connections.

Here’s the code on my parse server:

const redis = require("redis")
const redisClient = redis.createClient({
    url: "rediss://username:password@private-db-redis-fra1-...db.ondigitalocean.com:25061"
})

The connection string is generated by DigitalOcean. The droplet’s outbound traffic rules are open

Here are my error logs:

2|index  | AbortError: Ready check failed: Redis connection lost and command aborted. It might have been processed.
2|index  |     at RedisClient.flush_and_error (/root/parse-server-example/node_modules/redis/index.js:362:23)
2|index  |     at RedisClient.connection_gone (/root/parse-server-example/node_modules/redis/index.js:664:14)
2|index  |     at Socket.<anonymous> (/root/parse-server-example/node_modules/redis/index.js:293:14)
2|index  |     at Object.onceWrapper (events.js:313:30)
2|index  |     at emitNone (events.js:111:20)
2|index  |     at Socket.emit (events.js:208:7)
2|index  |     at endReadableNT (_stream_readable.js:1064:12)
2|index  |     at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
2|index  |     at _combinedTickCallback (internal/process/next_tick.js:139:11)
2|index  |     at process._tickDomainCallback (internal/process/next_tick.js:219:9)

Any idea what I’m doing wrong?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.