ecto_dbg icon indicating copy to clipboard operation
ecto_dbg copied to clipboard

:einval error

Open axelson opened this issue 2 years ago • 2 comments

Thanks for making this library! It's already been quite useful to me.

However, I'm getting an exception for one of the queries that I'm interested in:

[error] GenServer :exec terminating
** (stop) :einval
Last message: {:EXIT, #Port<0.37>, :einval}
State: {:state, #Port<0.37>, 0, {[], []}, [], :exec_mon, false, false}
** (exit) exited in: :gen_server.call(:exec, {:port, {:send, #PID<0.1087.0>, :eof}})
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (stdlib 4.1.1) gen_server.erl:370: :gen_server.call/2
    (ecto_dbg 0.2.0) lib/ecto_dbg.ex:280: EctoDbg.format_sql/1
    (ecto_dbg 0.2.0) lib/ecto_dbg.ex:140: EctoDbg.log_query/4
    (ecto_dbg 0.2.0) lib/ecto_dbg.ex:153: EctoDbg.run_and_log_query/5
    (my_app 0.1.0) lib/my_app/repo.ex:19: MyApp.Repo.offset_paginate/2
    iex:10: (file)
    iex:10: (file)

My guess is that this is happening because the query includes prepared arguments that are very long lists of ids (in the thousands).

axelson avatar Mar 16 '23 06:03 axelson

Hrmmm. I will try and write a test with thousands of IDs to see how long it takes. Perhaps it is timing out while trying to format.

akoutmos avatar Mar 17 '23 06:03 akoutmos

I was able to recreate the issue in a test. Working on the fix as time allows :).

akoutmos avatar Mar 30 '23 17:03 akoutmos

This should be fixed in version 0.3.0!

akoutmos avatar Sep 30 '24 21:09 akoutmos