I believe this issue started when I upgraded from a Free Redis to the Paid Redis when making a new app. I copied all config from a previously working Fly V2 backend of mine.
Been trying to resolve this issue for a few days, found these topics, but they were closed to replies:
https://community.fly.io/t/rails-sidekiq-suddenly-cant-connect-to-redis/14661/4
https://community.fly.io/t/redis-not-connecting-to-rails-app/14630
The Sidekiq dashboard shows the correct Redis url.
- Sidekiq v7.0.9
- redis://fly-api-x-redis.upstash.io:6379/0
fly redis connect
works fine from local.
fly ssh console -C "printenv"
also shows the correct url.
You can see the correct url in the dashboard monitoring logs.
You can enqueue items, but they never fire.
I’ve tried dozens of variations of both V1 and V2 style toml configs, super simple or complex and also changing the web process to app process, but seeing no difference in behavior.
Here is latest:
app = "api-x"
primary_region = "mia"
kill_signal = "SIGINT"
kill_timeout = "5s"
console_command = "/rails/bin/rails console"
[experimental]
auto_rollback = true
autoscale = true
[experimental.autoscaling]
min = 1
max = 10
[build]
[build.args]
BUILD_COMMAND = "bin/rails fly:build"
BUNDLER_VERSION = "2.3.18"
NODE_VERSION = "17.2.0"
RUBY_VERSION = "3.1.2"
SERVER_COMMAND = "bin/rails fly:server"
[deploy]
release_command = "bundle exec rails db:migrate"
[env]
PORT = "8080"
[processes]
web = "bin/rails fly:server"
worker = "bundle exec sidekiq --verbose"
[[services]]
protocol = "tcp"
internal_port = 8080
processes = ["web"]
[[services.ports]]
port = 80
handlers = ["http"]
force_https = true
[[services.ports]]
port = 443
handlers = ["tls", "http"]
[services.concurrency]
type = "connections"
hard_limit = 100
soft_limit = 90
[[services.tcp_checks]]
interval = "15s"
timeout = "2s"
grace_period = "1s"
restart_limit = 0
[[statics]]
guest_path = "/app/public"
url_prefix = "/"
and
#sidekiq.rb
require "sidekiq"
require "sidekiq/web"
require "sidekiq-scheduler"
require "sidekiq-scheduler/web"
Sidekiq.configure_server do |config|
config.redis = { url: ENV["REDIS_URL"] }
end
Sidekiq.configure_client do |config|
config.redis = { url: ENV["REDIS_URL"] }
end
Any ideas?