elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

(CaseClauseError) no case clause matching: {:error, :invalid_message} #80

Closed scrogson closed 7 years ago

scrogson commented 7 years ago

Running into this issue with 1.1.2:

λ MIX_ENV=test mix ecto.migrate
** (CaseClauseError) no case clause matching: {:error, :invalid_message}
    (db_connection) lib/db_connection/ownership.ex:58: DBConnection.Ownership.ownership_checkout/2
    (ecto) lib/ecto/adapters/sql/sandbox.ex:477: Ecto.Adapters.SQL.Sandbox.checkout/2
    (ecto) lib/mix/tasks/ecto.migrate.ex:79: anonymous fn/4 in Mix.Tasks.Ecto.Migrate.run/2
    (elixir) lib/enum.ex:645: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:645: Enum.each/2
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/project.ex:313: Mix.Project.in_project/4
    (elixir) lib/file.ex:1162: File.cd!/2

It works fine for ecto.create but blows up on ecto.migrate. Here's my configuration:

# test/test_helper.exs
ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(Myapp.Repo, :manual)
# config/test.exs

config :myapp, Myapp.Repo,
  adapter: Ecto.Adapters.Postgres,
  ...
  pool: Ecto.Adapters.SQL.Sandbox

Related Deps

¯\_(ツ)_/¯

fishcakez commented 7 years ago

Which version of Elixir? mix compile --force should fix this. Seems that your repo got compiled to use :poolboy. If that doesn't fix it, its an Ecto issue.