jackjoe / mailgun_logger

Simple Mailgun log persistence in Phoenix/Elixir
MIT License
74 stars 10 forks source link

DB Connection issue #6

Closed toddeye closed 3 years ago

toddeye commented 3 years ago

I see the mailgun api get results, but then get a couple of ERRORS that look related to DB. Tried this on my Mac as well as Linux. My docker-compose.yml is using defaults listed on website.

mailgun_app | 21:27:25.503 [error] MyXQL.Connection (#PID<0.3243.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.3706.0> timed out because it queued and checked out the connection for longer than 15000ms mailgun_app | mailgun_app | #PID<0.3706.0> was at location: mailgun_app | mailgun_app | :prim_inet.recv0/3 mailgun_app | (myxql 0.4.3) lib/myxql/client.ex:171: MyXQL.Client.recv_packets/4 mailgun_app | (myxql 0.4.3) lib/myxql/connection.ex:430: MyXQL.Connection.prepare/2 mailgun_app | (myxql 0.4.3) lib/myxql/connection.ex:81: MyXQL.Connection.handle_prepare/3 mailgun_app | (db_connection 2.2.2) lib/db_connection/holder.ex:316: DBConnection.Holder.holder_apply/4 mailgun_app | (db_connection 2.2.2) lib/db_connection.ex:1240: DBConnection.prepare/4 mailgun_app | (db_connection 2.2.2) lib/db_connection.ex:1233: DBConnection.run_prepare/4 mailgun_app | (db_connection 2.2.2) lib/db_connection.ex:1245: DBConnection.run_prepare_execute/5 mailgun_app | mailgun_app | 21:27:25.543 [debug] QUERY ERROR db=0.0ms

...

mailgun_app | 21:27:25.543 [debug] QUERY ERROR db=0.0ms mailgun_app | rollback [] mailgun_app | 21:27:25.546 [error] Task #PID<0.3706.0> started from #PID<0.3705.0> terminating mailgun_app | ** (DBConnection.ConnectionError) socket closed (the connection was closed by the pool, possibly due to a timeout or because the pool has been terminated) mailgun_app | (ecto_sql 3.4.5) lib/ecto/adapters/myxql.ex:242: Ecto.Adapters.MyXQL.insert/6 mailgun_app | (ecto 3.4.6) lib/ecto/repo/schema.ex:661: Ecto.Repo.Schema.apply/4 mailgun_app | (ecto 3.4.6) lib/ecto/repo/schema.ex:263: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4 mailgun_app | (ecto 3.4.6) lib/ecto/multi.ex:646: Ecto.Multi.apply_operation/5 mailgun_app | (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3 mailgun_app | (ecto 3.4.6) lib/ecto/multi.ex:630: anonymous fn/5 in Ecto.Multi.apply_operations/5 mailgun_app | (ecto_sql 3.4.5) lib/ecto/adapters/sql.ex:875: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4 mailgun_app | (db_connection 2.2.2) lib/db_connection.ex:1427: DBConnection.run_transaction/4 mailgun_app | Function: #Function<2.33026069/0 in MailgunLogger.run/0>

jeroenbourgois commented 3 years ago

@toddeye with 'defaults listed on website' you mean the blog post or this repo? In case of the blogpost, they are a bit outdated (which I will fix asap I updated it now). The readme in this repo has up-to-date information!

toddeye commented 3 years ago

Yes, I believe I used the defaults listed on the GitHub repo. I looked at closed issues and did see an issue related to differences from the blogpost. I will double check (using the docker-compose.yml noted on the repo) and report back.

The only changes I made from what was on the repo was adding the container_name, and I added that to facilitate troubleshooting after I initially noted the problem.

$ diff docker-compose.yml.repo docker-compose.yml 4a5

container_name: mailgun_db

16a18 container_name: mailgun_app

jeroenbourgois commented 3 years ago

@toddeye Did you manage to get it up and running?

jeroenbourgois commented 3 years ago

@toddeye ping?

jeroenbourgois commented 3 years ago

@toddeye I will close this for now.

pierot commented 3 years ago

@toddeye which version of mySQL are you using?

jeroenbourgois commented 3 years ago

@toddeye we found an issue with inserting a lot of events at once, which probably was your issue. This has been fixed!