79702834

Date: 2025-07-16 02:06:06
Score: 0.5
Natty:
Report link

After so many attempts, I found the culprit, and it was config/puma.rb. The following two configs raise the issue:

workers 2
preload_app!

workers > 0 means Puma is in cluster mode.

preload_app! loads the whole Rails app once, then forks it into 2 workers.

As far as I understand, this version of pg gem is unable to handle this, and that's why it crashes.

Setting worker 0 fixes the issue.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: jkvithanage