2

I'm getting the following issue:

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<0.0.1.107309>, 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"}

My model schema is defined as following:

  schema "roles" do
    field :name, :string
    field :internal, :boolean
    many_to_many :user_organizations, User.Models.UserOrganization, join_through: "roles_users_organizations"
    many_to_many :sessions, User.Models.Session, join_through: "roles_sessions"

    timestamps()
  end

The tests are running ok on my local machine, but it happens every time on semaphoreci. I'm using docker-compose with the "postgis" image I have already tried with the "postgres" image with the same results.

Any suggestion is greatly appreciated.

Thanks!

2
  • Which versions of postgres are you using on semaphore-ci and on your development machine? Commented Apr 3, 2017 at 21:55
  • The images I tried: mdillon/postgis:9.1 postgres/9.6 On the local machine I'm using postgres.app with postgres (PostgreSQL) 9.6.1. A full log Commented Apr 4, 2017 at 16:02

1 Answer 1

1

I had this occur in an umbrella App where the seeds.exs file for one project was mistakenly calling the Repo module for another app in the umbrella app.

So,

cat app1/priv/repo/seeds.exs

### Using The right Repo module ###
App1.Stuffs.query_stuff()
|> App1.Repo.one() # <== Should look like this -- Use App1.Repo module

### Using the wrong Repo module ###
App1.ThingStuffs.query_things() 
|> App2.Repo.one() # <== this was causing this error for me
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.