Unknown error after upgrading Forest

Feature(s) impacted

Reading data row can fail depending on a missing foreign key value

Observed behavior

Since we upgraded from 9.12.2 to 9.14.1 on the forest-liana’s version, some of the collections set in Forest Admin get an error when reading data (“An error occurred”).
it happens when a foreign key is null whereas the database is set to support it

Expected behavior

To be able to read a row with no error :slight_smile:

Failure Logs

Context

  • Project name: Ilek BO
  • Team name: every teams
  • Environment name: Production
  • Database type: PostgreSQL on AWS RDS (13.20)
  • Recent changes made on your end if any: upgrade from 9.12.2 to 9.14.1

And, if you are self-hosting your agent:

  • Agent technology: ruby
  • Agent (forest package) name & version (from your .lock file): …
  • “meta”: {
    “liana”: “forest-rails”,
    “liana_version”: “9.14.1”,
    “stack”: {
    “database_type”: “postgresql”,
    “orm_version”: “7.1.5.1”
    }
    }

Hello @Florian

I haven’t been able to reproduce the issue on my end.
Could you share one of the models that’s affected, and if possible, the SQL query that’s being run when the error occurs?

Hello @matthv
Thank you for your help !

Here is an example of a field that causes an error when empty :

When i set a value, the row becomes accessible, and when i set it to null the error gets back.

it is set this way in the layout :

i don’t know how i can retrieve the SQL executed by FA.
Maybe we missed something with the forest-schema, i have no hint about that.

Thanks for sharing your model.
I’ve pushed a potential fix. Could you try updating your Gemfile like this to test it ?

gem 'forest_liana', git: 'https://github.com/ForestAdmin/forest-rails.git', branch: 'fix/serializer-has-one'

Then run bundle install and let me know if the issue still occurs.

Thanks !!!
we’ll try this asap, i’ll keep you informed

1 Like

We’ve just released the fix in version 9.14.4, which resolves this issue.
Feel free to update and let us know if everything works as expected!

3 Likes

Ok thank you very much !
We did not take the time to test it yet, so we’ll deploy directly the last version.
:+1:

1 Like

Hello @matthv
i confirm the 9.14.4 version solves the issue !
Thank you very much for your help :folded_hands:

3 Likes