CastLouis

CastLouis

i have a process that i want to modify the conection timeout in ecto, but it still wit the same conection time out this is the error:

[error] Postgrex.Protocol (pid<0.319.0>) disconnected: ** (DBConnection.ConnectionError) owner pid<0.481.0> timed out because it owned the connection for longer than 15000ms

(DBConnection.ConnectionError) tcp send: closed

Showing Posts 18 to 9

romenigld

romenigld

I have now a similiar DBConnection.ConnectionError with PostgreSQL but was after the computer fronzen the system and complains an error System on my Mac OS.
So I was reading here and what I do and now worked for me was Update the PostgreSQL.
So check for the Updates and try.

Eiji

Eiji

@CastLouis: You have still a problem with 2nd code, but not I see better your problem (syntax highlighting is really helpful :slight_smile:
Look at docs - it have more description. Hope you will better understand your error.

CastLouis

CastLouis OP

Excuse me

config :na_db, :ecto_repos, [NA.DB.Repo]
import_config "#{Mix.env}.exs"

StackTrace:

1) test read my claim (NA.Claims.ClaimHistoryLoaderTest)
     test/na_claims/claim_history_loader_test.exs:3
     ** (exit) exited in: GenServer.call(#PID<0.489.0>, {:checkout, #Reference<0.0.2.33413>, true, 450000}, 5000)
         ** (EXIT) shutdown: "owner #PID<0.483.0> timed out because it owned the connection for longer than 15000ms"
       (elixir) lib/enum.ex:1768: Enum."-each/2-anonymous-3-"/3
       (elixir) lib/stream.ex:1385: anonymous fn/3 in Enumerable.Stream.reduce/3
       (elixir) lib/stream.ex:1259: Stream.do_resource/5
       (elixir) lib/stream.ex:1405: Enumerable.Stream.do_each/4
       (elixir) lib/enum.ex:1767: Enum.each/2
       test/na_claims/claim_history_loader_test.exs:4: (test)

Loader:

`defp store_claim(pid) do    
NA.DB.Repo.Claims.insert_claim(make_claim(pid), NA.Claims.ClaimAgent.get_claim_fields(pid)                                                     |> Enum.map(fn(x) -> struct(NA.DB.Schema.ClaimField, Map.from_struct(x)) end))  end`
Eiji

Eiji

@CastLouis: you do not need to restart anything - just run tests by mix test one more time after you change configuration - or in case you are changing for example ports then you need to be sure that 3rd party application is already runned on that port and if not reconfigure and restart it, but simple change any timeout variable do not need to restart any 3rd party applications.

Starting from my previous comment you answered that you modified only: config/config.exs - please make sure that you read whole article. Last chapter is focusing on tests - there are more changes to do than modify only one file.

And you still do not using special markup :slight_smile:

Sometimes helpful practise is to create new project and start from 0, so:

  1. create new elixir project
  2. setup credo
  3. merge your code part by part and test it
    It’s possible to make a typo like: :timaout which is not easy to notice :slight_smile:
CastLouis

CastLouis OP

Jaja, no i am not just copy i try to understand this error, i follow your instructions and i add this line of code in my config/config.exs and it looks like this:

config :na_db, :ecto_repos, [NA.DB.Repo]
import_config “#{Mix.env}.exs”

and the problem still, now it throws this information:

test read my claim (NA.Claims.ClaimHistoryLoaderTest)
test/na_claims/claim_history_loader_test.exs:3
** (exit) exited in: GenServer.call(pid<0.489.0>, {:checkout, reference<0.0.2.28900>, true, 450000}, 5000)
** (EXIT) shutdown: “owner pid<0.483.0> timed out because it owned the connection for longer than 15000ms”

450000 and 5000 i don’t know where are those values, one question after doing the change i need to restart something?

Eiji

Eiji

@CastLouis: ahh, I see what you have missed:

The config/config.exs
import_config “#{Mix.env}.exs”

after that in the tutorial is on creating the tables. could you please help me, it all the information that i have it.

After that yes it’s about create example table and work on it, but after it there is chapter called: Tests and functionality! Please read whole article and not only copy and paste code. :smiley:

Eiji

Eiji

@CastLouis: so it’s a sub application in umbrella project. Make sure that other application does not override it’s configuration, for example:
File: umbralla_app/apps/a:

config :my_app, :something, true

could be overwritten by umbreall_app/apss/b:

config :my_app, :something, false

Please also update your post with proper markdown:

Please use this syntax:
```elixir
# your code goes here …
```

CastLouis

CastLouis OP

This are the modules that are in the tutorial, the database is create before
the mix.exs:
defmodule NA.DB.Mixfile do use Mix.Project
def project do [app: :na_db, version: “0.1.0”, build_path: “../../_build”, config_path: “../../config/config.exs”, deps_path: “../../deps”, lockfile: “../../mix.lock”, elixir: “~> 1.4”, build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, deps: deps()] end
def application do [ extra_applications: [:logger], mod: {NA.DB, } ] end
defp deps do [ {:postgrex, “~> 0.13”}, {:ecto, “~> 2.1”}, ] endend

the repo.ex:
defmodule NA.DB.Repo do use Ecto.Repo, otp_app: :na_dbend

the na_db.ex start function:
def start(_type, _args) do import Supervisor.Spec, warn: false
children = [ supervisor(NA.DB.Repo, [get_opts()]), ]
opts = [strategy: :one_for_one, name: NA.DB.Supervisor]
Supervisor.start_link(children, opts) end

The test.config:
config :na_db, NA.DB.Repo, adapter: Ecto.Adapters.Postgres, database: “nadb”, username: “dadmin”, password: “d@dm!n”, ownership_timeout: 60_000, hostname: “127.0.0.1”, pool: Ecto.Adapters.SQL.Sandbox, port: “5432”, timeout: 450000

The config/config.exs
import_config “#{Mix.env}.exs”

after that in the tutorial is on creating the tables. could you please help me, it all the information that i have it.

Eiji

Eiji

@CastLouis: You missed something. Checked again Ecto tutorial step by step and be sure to add :ownership_timeout to test.exs. If you can publish your code or invite me to repository then I can fix it for you - I will create a PR. I have accounts on Github, BitBucket and GitLab

CastLouis

CastLouis OP

i was modify postgrex @timeout property for chech, i was modifing the test.exs with ownership_timeout, pool_timeout and timeout too, but the problem persist and i dont know how can i find more information about it, i think the reset the machine if ecto see the changes let me.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
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
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews