question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Invalid protocol" when trying to connect to Elasticache Redis in Node.js

See original GitHub issue

Hello

I’m trying to connect an ElastiCache Redis to an Express server deployed on ECS.

I get the Primary Endpoint from ElastiCache as blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com:6379

In my server I try to connect like this

const { createClient } = require("redis");
const pubClient = createClient({ url: 'blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com:6379' });

But when I check the ECS logs I see

/usr/src/app/node_modules/@redis/client/dist/lib/client/index.js:124
throw new TypeError('Invalid protocol');
^
TypeError: Invalid protocol
at Function.parseURL (/usr/src/app/node_modules/@redis/client/dist/lib/c...

Any help on what I might be missing Thanks

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
leibalecommented, Jul 18, 2022

this should fix it

const pubClient = createClient({ url: 'redis://blablabla.mccjet.ng.0001.euc1.cache.amazonaws.com:6379' });
0reactions
cmgchesscommented, Aug 2, 2022

I guess this is how it behaves and I cannot access elasticache from a local machine without SSH. Anyway it works fine inside the cloud. closing this Thanks for helping me out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Invalid protocol" when trying to connect to Elasticache Redis ...
I'm trying to connect an ElastiCache Redis to an Express server deployed on ECS. I'm using the Official Redis package for Node.js.
Read more >
Connecting to elastiCache cluster with node.js - AWS re:Post
I am struggling to find node examples in connecting to my Elasticache cluster via node.js lambda using ... I get an invalid protocol...
Read more >
Troubleshooting - Amazon ElastiCache for Redis
An ElastiCache node with thousands of NewConnections per minute indicates that a connection is created and used by just a few commands, which...
Read more >
The Proper Way To Connect Redis and Node.js
I use Redis & MongoDb combination in NodeJs all the time but this article is not aiming to navigate you to find perfect...
Read more >
Redis with Node.js (node_redis) | Redis Documentation Center
js Redis client. The following sections explain how to use node_redis, a community-recommended Redis client for Node.js. Another community-recommended client ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found