santoshbt

santoshbt

Cloak with changeset issue - (UndefinedFunctionError) function Cloak.EncryptedBinaryField.equal?/2 is undefined or private

Hi All,

I am using Cloak 0.6.2 version. It was working all good. I upgraded the Elixir version to Elixir 1.13.0, Phoenix - 1.5.9 and phoenix_pubsub : 2.0.
After upgrading, I am getting the following error

  • (exit) an exception was raised:
    ** (UndefinedFunctionError) function Cloak.EncryptedBinaryField.equal?/2 is undefined or private
    (cloak 0.6.2) Cloak.EncryptedBinaryField.equal?(nil, “Basement Flat, 2 Barons Court Road”)
    (ecto 3.7.2) lib/ecto/changeset.ex:576: Ecto.Changeset.cast_field/8

I am passing the changeset in this way
struct

|> cast(
  upcase(params, [:current_address_postcode]),
  ~w[
         current_address_street current_address_locality current_address_county
         current_address_postcode current_address_udprn
       ]a
)

It was working all good previously, now it is throwing error.
Any help to fix this, would be highly appreciated.

Thanks,
Santosh T

Most Liked

al2o3cr

al2o3cr

That version of Cloak is too outdated to work with the current version of Ecto - the semantics of Ecto.Type changed to require that equals? function in Add use Ecto.Type · elixir-ecto/ecto@c040b7c · GitHub

This issue suggests you’ll want to upgrade to at least Cloak 1.1.0:

stefanchrobot

stefanchrobot

I don’t think you need any data migration. An encrypted value has all the details of the cipher that was used for encryption.

stefanchrobot

stefanchrobot

What is the previous and the current version? Can you share your Cloak config (skipping the encryption key, obviously)?

Last Post!

santoshbt

santoshbt

@stefanchrobot @al2o3cr I did the same thing of incrementing it step by step.
It did not work then as well.

However there was a data migration when we upgrade it from 0.6 to 0.7, which I did not perform.
As I did not have much time, I would look into this later.

Thanks for the valuable suggestions.

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement