Error with postgres exception: (has invalid types for the connection)


When I’m running my tests with semaphoreci, I’m getting the following:

ArgumentError{message: \"query %Postgrex.Query{columns: [\\\"id\\\", \\\"name\\\", \\\"internal\\\", \\\"inserted_at\\\", \\\"updated_at\\\"], name: \\\"ecto_616034\\\", param_formats: [:binary], param_oids: [25], param_types: [Postgrex.Extensions.Raw], ref: #Reference<>, result_formats: [:binary, :binary, :binary, :binary, :binary], result_oids: [23, 1043, 16, 1184, 1184], result_types: [Postgrex.Extensions.Int4, Postgrex.Extensions.Raw, Postgrex.Extensions.Bool, Ecto.Adapters.Postgres.TimestampTZ, Ecto.Adapters.Postgres.TimestampTZ], statement: \\\"SELECT r0.\\\\\\\"id\\\\\\\", r0.\\\\\\\"name\\\\\\\", r0.\\\\\\\"internal\\\\\\\", r0.\\\\\\\"inserted_at\\\\\\\", r0.\\\\\\\"updated_at\\\\\\\" FROM \\\\\\\"roles\\\\\\\" AS r0 WHERE (r0.\\\\\\\"name\\\\\\\" = $1)\\\", types: {Ecto.Adapters.Postgres.TypeModule, 35356751}} has invalid types for the connection\"}", status: "error"}

The tests are running ok on the local machine, but it happens every time on semaphoreci.

I’m using docker-compose with the “postgres” image.

Any suggestion is greatly appreciated.



Which postgres image do you use? Please specify the full name, including tag.

Also its hard to say without seeing more code. Can you please try to reproduce the bug in a minified project or link to your current one if it is open source? Please make sure to link to a recent build log as well then.

1 Like

Thanks for answer.
Is hard to reproduce the bug in a minified project, it’s an umbrella app with micro services on rabbitmq.

The images I tried:


The full log: elixir.log

Thank you again.

Hmm, that usually happens when you hop servers on a single Repo, you are not doing that on the CI are you?

The phoenix app is using the other 2 apps (users, core) through the umbrella. But testing on local, it doesn’t happen. It is the compose configuration

If you refers about run queries from another machines/databases, it’s doesn’t happen.

Thank you!

Huh, that is really confusing, that error really indicates that the server connection got swapped, it cached type information from the old one but the new one does not have it because it was already cached in ecto. The postgresql testing server does not get restarted or reset or anything like that at any point during the entire testing run?