martasd
Hi,
I am seeing the following exception in Phoenix server debug log when I execute a mutation to register a new user in my application:
[debug] Core.ProcessManagers.Registrator has been stopped by event 15 ("fefce8e5-aabc-4cd6-834c-44cae8ce6b4d"@5)
[error] an exception was raised logging %DBConnection.LogEntry{call: :prepare_execute, connection_time: 2358000, decode_time: 3000, idle_time: 12662000,
params: ["\"Core.ProcessManagers.Registrator\"-\"fefce8e5-aabc-4cd6-834c-44cae8ce6b4d\""], pool_time: 1329000,
query: %Postgrex.Query{cache: :reference, columns: nil, name: "", param_formats: nil, param_oids: nil, param_types: nil, ref: nil, result_formats: nil, result_oids: nil, result_types: nil,
statement: ["DELETE FROM ", "public", ".snapshots\nWHERE source_uuid = $1;\n"], types: nil},
result: {:ok, %Postgrex.Query{cache: :reference, columns: nil, name: "", param_formats: [:binary], param_oids: [25], param_types: [Postgrex.Extensions.Raw], ref: #Reference<0.796564844.2413297668.48472>, result_formats: [], result_oids: nil, result_types: nil,
statement: ["DELETE FROM ", "public", ".snapshots\nWHERE source_uuid = $1;\n"], types: {Postgrex.DefaultTypes, #Reference<0.796564844.2413428738.50179>}}, %Postgrex.Result{columns: nil, command: :delete, connection_id: 460, messages: [], num_rows: 1, rows: nil}}}:
** (BadFunctionError) expected a function, got: false
(db_connection 2.4.1) lib/db_connection.ex:1501: DBConnection.log/2
(db_connection 2.4.1) lib/db_connection.ex:1479: DBConnection.log/5
(postgrex 0.15.13) lib/postgrex.ex:313: Postgrex.query_prepare_execute/4
(eventstore 1.3.2) lib/event_store/storage/snapshot.ex:63: EventStore.Storage.Snapshot.delete_snapshot/3
(commanded 1.3.1) lib/commanded/process_managers/process_manager_instance.ex:114: Commanded.ProcessManagers.ProcessManagerInstance.handle_call/3
(stdlib 3.17) gen_server.erl:721: :gen_server.try_handle_call/4
(stdlib 3.17) gen_server.erl:750: :gen_server.handle_msg/6
(stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
[debug] Core.ProcessManagers.Registrator confirming receipt of event: 15
I actually see DBConnection.LogEntry in each interaction with the event store always receiving the same BadFunctionError. I’ve already gone through the suggestions in this thread: Telemetry Logging Error, but have not made any progress. Any ideas what is going on here?
Environment
- Elixir 1.12.3
- Ecto 3.7.1
- Postgres 13.5
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
al2o3cr
The code that’s raising
BadFunctionErrorinDBConnection.log/2is handling thelogoption passed inoptsto most functions inDBConnection. This accepts eithernil, an arity 1 function, or an MFA tuple - in particular, it DOES NOT acceptfalse, which would cause exactly the error you’re seeing.https://github.com/elixir-ecto/db_connection/blob/46888ada567401d1270f855a3dd04bfca545f94f/lib/db_connection.ex#L503-L505
martasd
@al2o3cr Thanks, your explanation makes sense. Now, my question is: why is
falsebeing passed in theopts? Nowhere in the stacktraces do I see a reference to my code. Could this be caused by a misconfiguration of one of those libraries? Or is it likely a bug in one of them that I should report?Here are more
BadFunctionErrorsfor reference (with sensitive data removed): db connection errors - Pastebin.comal2o3cr
That’s my hypothesis - start by looking for EventStore config like
config :my_app, MyApp.EventStore,.The additional traces you posted interact with different parts of EventStore, further suggesting that it’s not a single bad call but an application-wide issue.
martasd
Thanks for the pointers. It seems that I’ve found the source of the error. I have the following configuration:
When I remove
log: false, the error disappears. Both the option and its valuefalseare valid according to the docs, however: Ecto.Repo — Ecto v3.14.0. This is suggesting that the problem lies somewhere between Postgrex and DB Connection.martasd
@al2o3cr What do you think?
al2o3cr
eventstoredoesn’t use Ecto, it talks directly to the Postgrex driver.Ecto’s options in
log:(like:debugorfalse) are transformed into what the adapter expects inEcto.Adapters.SQL.with_log:https://github.com/elixir-ecto/ecto_sql/blob/master/lib/ecto/adapters/sql.ex#L1050-L1052
The configuration you pass to
eventstoreneeds to match the expectations forlogcited previously