WolfDan
Phoenix Ecto, don't connect on kubernetes
Hello all!
Actually I’m getting this error on my kubernetes log:
2017-06-02T02:02:49.13752428Z 02:02:49.137 [error] Postgrex.Protocol (pid<0.1578.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (...:5432): timeout
I already check the secrets on Kubernetes, this error is not from authentication, the connection is not refused, there is any way to solve it?
Thanks for all you help!
Greetings!
EDIT: When I make a request to the server I get this error:
2017-06-02T02:09:51.417407254Z Request: GET /anime/1
2017-06-02T02:09:51.417410146Z ** (exit) an exception was raised:
2017-06-02T02:09:51.417413126Z ** (DBConnection.ConnectionError) connection not available because of disconnection
2017-06-02T02:09:51.417416219Z (db_connection) lib/db_connection.ex:926: DBConnection.checkout/2
2017-06-02T02:09:51.417421994Z (db_connection) lib/db_connection.ex:742: DBConnection.run/3
2017-06-02T02:09:51.417425202Z (db_connection) lib/db_connection.ex:584: DBConnection.prepare_execute/4
2017-06-02T02:09:51.417429314Z (ecto) lib/ecto/adapters/postgres/connection.ex:80: Ecto.Adapters.Postgres.Connection.prepare_execute/5
2017-06-02T02:09:51.41743256Z (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
2017-06-02T02:09:51.417435814Z (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2017-06-02T02:09:51.417438957Z (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
2017-06-02T02:09:51.417442142Z (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
Most Liked
kelvinst
I’d the same kind of issues some time ago with a node project. It really started happening randomly and what I did to fix it was an upgrade on gce-proxy image I use to access Cloud SQL form 1.05 to 1.09.
I really don’t know why it started to happen, and don’t know also what is the root cause of the error. I’ll investigate it soon.
odarriba
Have you tried using an instance of Google Cloud SQL proxy inside your deployment? so you can connect locally and authenticating using a Service Account credentials.
I don’t know if you are running Kubernetes inside GKE, but that’s the recommended way in that case. More info can be found on: Connect from Google Kubernetes Engine | Cloud SQL for PostgreSQL | Google Cloud Documentation
Hope that helps!
Popular in Questions
Other popular topics
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
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









