Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Heroku: failed connection between Redis and App

$
0
0

Heroku 20Ruby: 3.1.0Rails: 6.1.0Redis: Screen from gemfile.lockRedis on heroku: 6.2.3

Most likely after changing the version of redis on heroku: from free to premium, the worker stopped working. (Web is working)

heroku run rails c
redis = Redis.new(url: ENV["REDIS_URL"])# => #<Redis client v5.0.6 for rediss://ec2-5x.xx.xx.xx.eu-west-1.compute.amazonaws.com:12499/0>redis.ping# /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:62:in `connect_nonblock': SSL_connect returned=1 errno=0 peeraddr=5x.xx.xx.xx:12499 state=error: certificate verify failed (self signed certificate in certificate chain) (Redis::CannotConnectError)                                                    # /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:62:in `connect_nonblock': SSL_connect returned=1 errno=0 peeraddr=5x.xx.xx.xx:12499 state=error: certificate verify failed (self signed certificate in certificate chain) (RedisClient::CannotConnectError)                                              # /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:62:in `connect_nonblock': SSL_connect returned=1 errno=0 peeraddr=5x.xx.xx.xx:12499 state=error: certificate verify failed (self signed certificate in certificate chain) (OpenSSL::SSL::SSLError)      
$redis = Redis.new(url: ENV["REDIS_URL"], ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })$redis.ping# /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/connection_mixin.rb:48:in `call_pipelined': WRONGPASS invalid username-password pair or user is disabled. (Redis::CannotConnectError)# /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/connection_mixin.rb:48:in `call_pipelined': WRONGPASS invalid username-password pair or user is disabled. (RedisClient::AuthenticationError)

Then I attempted to change rediss:// to redis:// in the URL:

redis = Redis.new(url: url_with_one_s, ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })redis.ping# /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:130:in `rescue in read': Connection reset by peer (Redis::CannotConnectError)                                                                                                                    # /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:130:in `rescue in read': Connection reset by peer (RedisClient::CannotConnectError)                                                                                                              # /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/ruby_connection.rb:130:in `rescue in read': Connection reset by peer (RedisClient::ConnectionError)                                                                                                                 # /app/vendor/ruby-3.1.0/lib/ruby/3.1.0/socket.rb:452:in `__read_nonblock': Connection reset by peer (Errno::ECONNRESET) 

Procfile:

release: bundle exec rails db:migrateweb: bundle exec puma -C config/puma.rbworker: bundle exec sidekiq -c 5 -C config/sidekiq.yml

When I run in bash:

bundle exec sidekiq -c 5 -C config/sidekiq.yml

I get:

pid=4 tid=1i50 INFO: Booting Sidekiq 6.5.5 with Sidekiq::RedisConnection::RedisAdapter options {:url=>"rediss://:REDACTED@ec2-5x.xx.xx.xx.eu-west-1.compute.amazonaws.com:12499/1"}W, [2023-02-14T12:22:11.722698 #4] pid=4 tid=1i50 INFO: Booted Rails 6.1.7.1 application in staging environmentpid=4 tid=1i50 INFO: Running in ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]pid=4 tid=1i50 INFO: See LICENSE and the LGPL-3.0 for licensing details.pid=4 tid=1i50 INFO: Upgrade to Sidekiq Pro for more features and support: https://sidekiq.orgpid=4 tid=1i50 WARN: Redis::CannotConnectError: WRONGPASS invalid username-password pair or user is disabled.pid=4 tid=1i50 WARN: /app/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.1/lib/redis_client/connection_mixin.rb:48:in `call_pipelined'
heroku redis:info›   Warning: heroku update available from 7.60.2 to 7.67.1.=== redis-xxxxx-xxxxx (REDIS_URL)Plan:                   Premium 0Status:                 availableCreated:                2021-xx-xx xx:xx Version:                6.2.3Timeout:                300Maxmemory:              noevictionMaintenance:            scheduled for 2023-xx-xx xx:xx:00 +0000, required by 2023-xx-xx xx:xx:xx +0000Maintenance window:     Wednesdays xx:xx to Thursdays xx:xx UTCPersistence:            AOFHA Status:              AvailableRequires TLS:           YesKeyspace Notifications: Disabled

Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>