elixir-ecto / ecto_sql

SQL-based adapters for Ecto and database migrations
https://hexdocs.pm/ecto_sql
Apache License 2.0
558 stars 312 forks source link

could not cancel backend errors #597

Closed sasa1977 closed 3 months ago

sasa1977 commented 6 months ago

Elixir version

Elixir 1.14.5

Database and Version

PostgreSQL 13.11

Ecto Versions

3.11.1

Database Adapter and Versions (postgrex, myxql, etc)

0.17.4

Current behavior

After migrating to the latest ecto_sql and postgrex, we see the following log entries when running some mix tasks such as ecto.migrate:

[error] Postgrex.Protocol #PID<0.8748.0> could not cancel backend: tcp connect: no such file or directory - :enoent

These appear a few times, but otherwise everything works fine. This isn't happening when running the app or tests.

Moving back to postgrex 0.17.3 gets rid of these errors. Also, if I just comment out exit trap, added in https://github.com/elixir-ecto/postgrex/commit/c8edce44047fba8d517e9f94efac7d9fb607e32d, the errors are gone.

I'm not sure whether this is a postgrex or ecto_sql error, but I figured I'd report here, as the error seems to occur only in the migration tasks.

Expected behavior

We shouldn't see these error entries.

josevalim commented 6 months ago

Do you have a stack trace associated to these logs?

sasa1977 commented 6 months ago

There is no stack trace, just these errors.

josevalim commented 6 months ago

I pushed a fix to PostgreSQL main. Basically removing the logs. Can you please try it out?

josevalim commented 6 months ago

Errrrrr. Postgrex. :D

sasa1977 commented 6 months ago

Tried it locally and I don't get those errors anymore.