Connecting to Redis

I am trying to run sidekiq server externally, and I want to connect to my Render Redis instance.

I used the external REDIS_URL provided by Render, but i get the following error

NOAUTH Authentication required.

I configured my sidekiq for both server and client like this:

# config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
  config.redis = {
    url: 'rediss://red-xxx:xxx@ohio-redis.render.com:6379'
  }
end

Sidekiq.configure_client do |config|
  config.redis = {
    url: 'rediss://red-xxx:xxx@ohio-redis.render.com:6379'
  }
end

And on Render, i allowed access from 0.0.0.0/0

On the console, i can do

redis = Redis.new(url: 'rediss://red-xxx:xxx@ohio-redis.render.com:6379')
redis.ping

and I receive my pong…

In the end, I setup a ssh tunnel to access the Redis server through an instance on Render.

It adds complexity to the whole thing, but at least it works.

Hi Jérôme,

The error message that you’re seeing NOAUTH Authentication required. indicates that the request may not be authenticated, or that the password isn’t being provided. Based on the URL example you shared, it looks like you are using the external connection string, which should include the password.

Can you provide some more information on the redis client (and version) you are using in your Sidekiq server?

I am using the latest Sidekiq. Here are the relevant gems in my Gemfile.lock

    sidekiq (7.1.2)
      concurrent-ruby (< 2)
      connection_pool (>= 2.3.0)
      rack (>= 2.2.4)
      redis-client (>= 0.14.0)
    redis (5.0.7)
      redis-client (>= 0.9.0)
    redis-actionpack (5.3.0)
      actionpack (>= 5, < 8)
      redis-rack (>= 2.1.0, < 3)
      redis-store (>= 1.1.0, < 2)
    redis-activesupport (5.3.0)
      activesupport (>= 3, < 8)
      redis-store (>= 1.3, < 2)
    redis-client (0.16.0)
      connection_pool
    redis-rack (2.1.4)
      rack (>= 2.0.8, < 3)
      redis-store (>= 1.2, < 2)
    redis-rails (5.0.2)
      redis-actionpack (>= 5.0, < 6)
      redis-activesupport (>= 5.0, < 6)
      redis-store (>= 1.2, < 2)
    redis-store (1.9.2)
      redis (>= 4, < 6)

The problems occurs only with the external connection, as the same docker image loaded on Render works perfectly, just like the ssh-tunel based solution, which connects using the internal url via my Rails instance.

Hi Jérôme,

Thanks for those details. Since you are using the Sidekiq initializer to configure the redis details, I’m referencing the docs here: Using Redis · sidekiq/sidekiq Wiki · GitHub. Unfortunately, they don’t provide an an example URL showing the password included, so it’s unclear if that format is supported.

I would see if you can try adding the password attribute separately to the redis.config as specified here. So for example, something like this:

  config.redis = { url: '<redis-url>', password: '<password>' }

Let me know if that helps, or if you’re still running into the NOAUTH error.

Best,

I tried this already, it did not work. I also tried setting the username this way, it doesn’t work either.

I talked to the author of Sidekiq, and he asked if it was an instance of Redis Labs, which is incompatible until version 7.2. I am not sure about this one, because it works using the internal link

Hi there,

Have you got the full stack trace of the error? It may be coming from somewhere else, other than the sidekiq initializer.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.