Exited in: :gen_server.call Time out Error after upgrading to OTP 21 and elixir 1.6.6

My phoenix application is getting error something after upgrading to OTP 21 and elixir 1.6.6 like this…

[error] Task #PID<0.834.0> started from #PID<0.820.0> terminating
** (stop) exited in: :gen_server.call(#PID<0.599.0>, {:checkout, #Reference<0.650802346.705167363.77758>, true, 15000}, 5000)
    ** (EXIT) time out
    (db_connection) lib/db_connection/poolboy.ex:112: DBConnection.Poolboy.checkout/3
    (db_connection) lib/db_connection.ex:928: DBConnection.checkout/2
    (db_connection) lib/db_connection.ex:750: DBConnection.run/3
    (db_connection) lib/db_connection.ex:644: DBConnection.execute/4
    (ecto) lib/ecto/adapters/postgres/connection.ex:98: Ecto.Adapters.Postgres.Connection.execute/4
    (ecto) lib/ecto/adapters/sql.ex:256: Ecto.Adapters.SQL.sql_call/6
    (ecto) lib/ecto/adapters/sql.ex:436: Ecto.Adapters.SQL.execute_or_reset/7
    (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
    (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
    (ecto) lib/ecto/repo/preloader.ex:182: Ecto.Repo.Preloader.fetch_query/8
    (ecto) lib/ecto/repo/preloader.ex:119: Ecto.Repo.Preloader.preload_assoc/10
    (elixir) lib/task/supervised.ex:88: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: &:erlang.apply/2
    Args: [#Function<11.21914290/2 in Ecto.Repo.Preloader.preload_each/4>, [{{:assoc, %Ecto.Association.Has{cardinality: :many, defaults: [], field: :phonebooks, on_cast: nil, on_delete: :nothing, on_replace: :raise, owner: Texting.Account.User, owner_key: :id, queryable: Texting.Contact.Phonebook, related: Texting.Contact.Phonebook, related_key: :user_id, relationship: :child, unique: true}, {0, :user_id}}, nil, nil, []}, [caller: #PID<0.820.0>]]]
[error] Ranch protocol #PID<0.820.0> of listener TextingWeb.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) exited in: :gen_server.call(#PID<0.599.0>, {:checkout, #Reference<0.650802346.705167363.77758>, true, 15000}, 5000)
    ** (EXIT) time out

while I am browsing my phoenix app, get this error and sometimes works but very slow and keeps getting this error in debug console.

Did You rebuild your application from a fresh state? (Removing _build and deps)

1 Like

Oh… I didn’t do that.
And it seems working after removing _build and deps then do it mix deps.get and mix compile
It worked!

Doesn’t mix clean do just that btw?

1 Like

IIRC to be equivalent to removing all from build, You need to do

$ mix clean --deps

And to remove a specific deps, You need to

$ mix deps.clean <package-name>

But often I just :slight_smile:

$ rm -rf _build deps
$ mix deps.get && mix compile

BTW It might be a bad habit I inherit from removing node_modules and running yarn install… and then I have suddenly 500’000 files in the dustbin :slight_smile:


Others are reporting this issue too: Exited in: :gen_server.call Time out Error after upgrading to OTP 21 and elixir 1.6.6

If you can reproduce it, please let us know your Elixir, Erlang/OTP and OS versions. Thank you.

It seems ok after cleaning up _build and deps folder yesterday.
But the issue comes again today.
I upgraded from OPT 20 and Elixir 1.6.4 to OPT 21 and Elixir 1.6.6 in Fedora 28

How hard would it be for you to give it a try on Fedora 27? There is some indication this may be a Fedora 28 issue.

1 Like

I will try this in Fedora 27 and let you know.

I tried in Fedora 27 and I did rebuild project after removing old _build and deps folder.
But I still have a same issue.

1 Like

I know it doesn’t solve your problem but your feedback is very useful. Thank you!

1 Like

I’m also experiencing this issue. It’s easy to reproduce with ab (ApacheBench).

This started happening this morning after updating to Erlang/OTP 21 on Arch Linux. My Elixir version though is still 1.6.5 compiled with OTP 20 (the package is currently tagged out-of-date).

Probably not related, but the stress test shows a slight performance degradation (about ~4% slower) when it doesn’t times out.

I am using OpenSUSE Tumbleweed and had the same issue.

I also deleted the _build and deps folder without success.

I used Snapper to rollback elixir and Erlanger update only and everything is working fine.

Best regards.