Issue with EctoNetwork - (DBConnection.EncodeError) Postgrex expected a binary, got %Postgrex.INET

I have little problem with EctoNetwork:

my schema:

 schema "test" do
    field(:req_ip, EctoNetwork.INET)
end

my migration:

create table(:test) do
  add(:req_ip, :inet)
end

It seems ok and it woks when I run the project.
But in the test mode I face with this issue.

** (DBConnection.EncodeError) Postgrex expected a binary, got %Postgrex.INET{address: {127, 0, 0, 1}, netmask: 32}. Please make sure the value you are passing matches the definition in your table or in your query or convert the value accordingly.

Any idea ?

Can you show the code that you’re running that causes this error?

2 Likes

Thanks so much.

I Tried MIX_ENV=test ecto.drop ecto.setup and it goes away.
seems I have issue on my sandbox db.

FYI:
DB: record: req_ip -> 127.0.0.1, datatype: inet