Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect #1483

Open
alilland opened this issue Jan 4, 2022 · 0 comments
Open

Unable to connect #1483

alilland opened this issue Jan 4, 2022 · 0 comments

Comments

@alilland
Copy link

alilland commented Jan 4, 2022

$ redis-cli -c -h localhost -p 6378
localhost:6378> ping
PONG

I have an SSH tunnel running to my AWS VPC, above is redis-cli running from my development machine showing that it tunnels successfully, below is my javascript code that is not running successfully but I don't know why

const Redis = require('ioredis')
const nodes = [{ host: 'localhost', port: 6378 }]
const options = {
  enableOfflineQueue: false
}
const client = new Redis.Cluster(nodes, options)

// ...

it('ping should work', function () {
    this.timeout(10000)

    return new Promise(async (resolve, reject) => {
      try {
        await client.ping()
        resolve()
      } catch (err) {
        reject(err)
      }
    })
  })

its reporting the following error...

Error: Cluster isn't ready and enableOfflineQueue options is false
      at tryConnection (node_modules/ioredis/built/cluster/index.js:599:32)
      at Cluster.sendCommand (node_modules/ioredis/built/cluster/index.js:522:9)
      at Cluster.ping (node_modules/ioredis/built/commander.js:122:25)
      at /Users/aronlilland/Documents/dev/controlair/oauth/test/lib/cache/client.spec.js:13:22
      at new Promise (<anonymous>)
      at Context.<anonymous> (test/lib/cache/client.spec.js:10:12)
      at processImmediate (node:internal/timers:464:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant