mcrunix
Hi Everyone, I’m trying to use PGPool in front of a PG database and Ecto’s using it but all commands failed. Here are the logs that I figured out.
$ mix ecto.create
** (Mix) The database for App.Repo couldn't be created: command timed out
Also, I hit PGPool through postgrex directly and more info turned out.
iex(1)> {:ok, pid} = Postgrex.start_link(hostname: "localhost", port: 7432, username: "postgres", password: "adminpassword", database: "postgres", prepare: :unnamed)
{:ok, #PID<0.594.0>}
iex(2)> Postgrex.query!(pid, "SELECT 1;", [], [timeout: 20000])
** (DBConnection.ConnectionError) tcp recv: closed (the connection was closed by the pool, possibly due to a timeout or because the pool has been terminated)
(postgrex 0.15.7) lib/postgrex.ex:249: Postgrex.query!/4
{"msg":"Postgrex.Protocol (#PID<0.596.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.592.0> timed out because it queued and checked out the connection for longer than 20000ms\n\n#PID<0.592.0> was at location:\n\n :prim_inet.recv0/3\n (postgrex 0.15.7) lib/postgrex/protocol.ex:2838: Postgrex.Protocol.msg_recv/4\n (postgrex 0.15.7) lib/postgrex/protocol.ex:1241: Postgrex.Protocol.recv_parse/3\n (postgrex 0.15.7) lib/postgrex/protocol.ex:1208: Postgrex.Protocol.recv_parse_describe/4\n (postgrex 0.15.7) lib/postgrex/protocol.ex:1028: Postgrex.Protocol.parse_describe_flush/3\n (db_connection 2.3.1) lib/db_connection/holder.ex:316: DBConnection.Holder.holder_apply/4\n (db_connection 2.3.1) lib/db_connection.ex:1257: DBConnection.prepare/4\n (db_connection 2.3.1) lib/db_connection.ex:1250: DBConnection.run_prepare/4\n (db_connection 2.3.1) lib/db_connection.ex:1262: DBConnection.run_prepare_execute/5\n (db_connection 2.3.1) lib/db_connection.ex:1359: DBConnection.run/6\n (db_connection 2.3.1) lib/db_connection.ex:557: DBConnection.parsed_prepare_execute/5\n (db_connection 2.3.1) lib/db_connection.ex:550: DBConnection.prepare_execute/4\n (postgrex 0.15.7) lib/postgrex.ex:235: Postgrex.query_prepare_execute/4\n (postgrex 0.15.7) lib/postgrex.ex:247: Postgrex.query!/4\n (stdlib 3.14) erl_eval.erl:680: :erl_eval.do_apply/6\n (elixir 1.11.3) src/elixir.erl:280: :elixir.recur_eval/3\n (elixir 1.11.3) src/elixir.erl:265: :elixir.eval_forms/3\n (iex 1.11.3) lib/iex/evaluator.ex:261: IEx.Evaluator.handle_eval/5\n (iex 1.11.3) lib/iex/evaluator.ex:242: IEx.Evaluator.do_eval/3\n (iex 1.11.3) lib/iex/evaluator.ex:220: IEx.Evaluator.eval/3\n","level":"error","datetime":"2021-02-24T17:16:11.000088Z","function":"disconnect/2","file":"lib/db_connection/connection.ex"}
iex(2)>
PGPool Logs:
2021-02-24 17:15:51: pid 166: LOG: DB node id: 0 backend pid: 9337 statement: Parse: SELECT 1;
2021-02-24 17:15:51: pid 166: LOG: DB node id: 0 backend pid: 9337 statement: D message
2021-02-24 17:16:11: pid 166: ERROR: unable to read data from frontend
2021-02-24 17:16:11: pid 166: DETAIL: EOF encountered with frontend
Ecto Config:
config :app, App.Repo,
URL: databaseUrl,
show_sensitive_data_on_connection_error: true,
pool_size: 20,
timeout: 60_000
My suspect is on the incompatibility DB Connection module with PSQL protocol, Should be noted I tried psql 11 and 13 versions, all had same issue.
did you experience same issue?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
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
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
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
minhajuddin
I would try connecting to pgpool from your server using psql. That should root out any issues because of IPs and what not.
mcrunix
@minhajuddin
psqlworks well withpgpoolminhajuddin
The next thing I would try would be to look at the logs on the pgpool side of things and see why it is closing the
Postgrexconnections. If that doesn’t work spin up Wireshark and look at the TCP stream and see who is sending theFINpacket (it’s most probablypgpool), if you know that pgpool is closing the connection you’ll have to figure out why it is doing thatmcrunix
Hmm. interesting, the last matched record(blue one) has
FINpacket, and it’s from PGPool side. Could be related to pool mode(sessions, transactional, statements)?minhajuddin
It looks like your elixir process initiated the
FIN, packet1066. Try connecting directly to the postgres database first and see if you can recreate it. Try using a library from another language e.g.pggem from ruby to rule out any misconfigurations.mcrunix
I tried to test pgpool instance with
rubyandnode.jsboth worked and returned the desired result.mcrunix
I’d like to put few other references which might be related.
Quote from Medium: