I'm getting the below error when trying to run migrations locally. But it only happens sometimes, so I'm trying to understand what might cause it.
Full error:
rake aborted!
PG::ConnectionBad: could not fork new process for connection: Resource temporarily unavailable
could not fork new process for connection: Resource temporarily unavailable
E, [2017-04-22T10:09:26.381554 #17026] ERROR -- : fsevent: running worker failed: Resource temporarily unavailable
Otherwise, the rails console, and accessing the db directly through a client works fine.
I was pointed to another thread which recommended checking,
ulimit -Hn
unlimited
So my descriptor limit doesn't appear to be the issue.
Source: fork: retry: Resource temporarily unavailable
Update:
It consistently fails when the rails server (Puma) is running, but works when its not.