iodine icon indicating copy to clipboard operation
iodine copied to clipboard

No connection pool for 'ActiveRecord::Base' found

Open vitobotta opened this issue 3 years ago • 3 comments

Hi! I swapped puma with iodine, and I am getting this when trying to run specs with capybara:

     ActiveRecord::ConnectionNotEstablished:
       No connection pool for 'ActiveRecord::Base' found.

Am I missing some configuration? Thanks!

vitobotta avatar May 28 '21 17:05 vitobotta

Somehow I got one example passing by setting workers to 1 but now I get this:

Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (../libev/ev_epoll.c: epoll_modify: 134)

vitobotta avatar May 28 '21 17:05 vitobotta

Hi @vitobotta ,

Thank you for your interest in iodine.


As for:

     ActiveRecord::ConnectionNotEstablished:
       No connection pool for 'ActiveRecord::Base' found.

Iodine will attempt to reset the connection pool whenever a worker is (re)started, in order to avoid unintended DB connection sharing between processes (which breaks the connection pool synchronization).

This used to be a big issue with multi-process servers and ActiveRecord eventually decided to implement an internal solution. However, since the error message is usually harmless (if it shows up), I often to keep support for older versions of ActiveRecord that don't implement an internal solution.

Does the error message prevent the server from running?


As for:

Assertion failed: ("libev: I/O watcher with invalid fd found in epoll_ctl", errno != EBADF && errno != ELOOP && errno != EINVAL) (../libev/ev_epoll.c: epoll_modify: 134)

This isn't iodine related. You are either still running Puma or using WebSockets with ActionCable. The iodine server doesn't use libev, but rather uses epoll, kqueue and poll directly.

I might be able to help if you offer more information, but otherwise there's not much I can do about that one.

Kindly, Bo.

boazsegev avatar May 29 '21 11:05 boazsegev

P.S.,

It could be that you added configurations to the Puma configuration file and now these aren't working probably or causing conflicts 🤔

boazsegev avatar May 29 '21 11:05 boazsegev