我正在使用Windows进行开发。
以下是在AWS上使用Postgres RDS启动此Rails应用程序的sidekiq服务器时出现的错误:
PG::ConnectionBad: timeout expired
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'initialize'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'new'
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/sequel-4.36.0/lib/sequel/adapters/postgres.rb:243:in 'connect'
我检查了AWS上的Postgres服务器日志,并说:
[12826]:LOG: could not accept SSL connection: Connection reset by peer"
我的gemfile正在使用Sequel和sequel_pg。我不确定它们是否导致错误。
相同的Postgres数据库连接在没有Sidekiq的其他Rails应用程序上正常工作。
答案 0 :(得分:1)
I'm not sure if sidekiq is preloading the app and then forking, but if so, you want to make sure you disconnect the Sequel database connections before forking.