# ForestAdmin panel shows error when I want to change something in the database

**URL:** <https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716>\
**Category:** Help me!\
**Created:** [January 27, 2021, 8:20pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716 "2021-01-27T20:20:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [January 27, 2021, 8:20pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/1 "2021-01-27T20:20:02Z")

</div>

## Expected behavior

When I log into ForestAdmin to see the database of my web app, choose a table, click to edit a record and change a field within that record, the change should be saved.

## Actual behavior

When I click on save I get the following error (see below) and the change in the record doesn’t get saved.

 ![Screen Shot 2021-01-27 at 18.57.39](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f81f3250085739782d49cea98d5f3f262ffb72bd.png)

## Context

I only experience this when I’m in the staging or productions environment (web app is hosted on Heroku). In the development environment it works fine.

package.json

```javascript
{
  "name": "ibiza-garden-houses",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node ./server.js"
  },
  "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.16.3",
    "express-jwt": "^5.3.1",
    "forest-express": "^7.4.0",
    "forest-express-sequelize": "^6.7.5",
    "morgan": "1.9.1",
    "pg": "~8.2.2",
    "require-all": "^3.0.0",
    "sequelize": "~5.15.1"
  }
}

```

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [January 28, 2021, 9:28am UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/2 "2021-01-28T09:28:52Z")

</div>

Hi @OKMantis,

Thank you for sharing your issue with us.

Could I take a look at your staging environment’s backend logs? There might be logs that could help us spot the issue that is happening

Thank you

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [January 28, 2021, 11:39am UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/3 "2021-01-28T11:39:46Z")

</div>

Right after trying to save a change inside a record within the ForestAdmin panel I get the following logs in Heroku:

```javascript
2021-01-28T11:36:49.156422+00:00 heroku[router]: at=info method=PUT path="/forest/House/6" host=pacific-crag-46601.herokuapp.com request_id=7cb3c8b7-f642-4068-8fb4-842853b2b365 fwd="67.218.247.241" dyno=web.1 connect=5ms service=33ms status=400 bytes=906 protocol=https
2021-01-28T11:36:49.124344+00:00 app[web.1]: I, [2021-01-28T11:36:49.124229 #4] INFO -- : [7cb3c8b7-f642-4068-8fb4-842853b2b365] Started PUT "/forest/House/6" for 67.218.247.241 at 2021-01-28 11:36:49 +0000
2021-01-28T11:36:49.125658+00:00 app[web.1]: I, [2021-01-28T11:36:49.125582 #4] INFO -- : [7cb3c8b7-f642-4068-8fb4-842853b2b365] Processing by ForestLiana::UserSpace::HouseController#update as JSON
2021-01-28T11:36:49.125758+00:00 app[web.1]: I, [2021-01-28T11:36:49.125694 #4] INFO -- : [7cb3c8b7-f642-4068-8fb4-842853b2b365] Parameters: {"data"=>{"id"=>"6", "attributes"=>{"sku"=>"ibi-"}, "relationships"=>{"category"=>{"data"=>{"type"=>"Categories", "id"=>"2"}}, "user"=>{"data"=>{"type"=>"Users", "id"=>"1"}}}, "type"=>"Houses"}, "collection"=>"House", "id"=>"6"}
2021-01-28T11:36:49.132343+00:00 app[web.1]: D, [2021-01-28T11:36:49.132272 #4] DEBUG -- : [7cb3c8b7-f642-4068-8fb4-842853b2b365] e[1me[36mHouse Load (1.0ms)e[0m e[1me[34mSELECT "houses".* FROM "houses" WHERE "houses"."id" = $1 LIMIT $2e[0m [["id", 6], ["LIMIT", 1]]
2021-01-28T11:36:49.153915+00:00 app[web.1]: I, [2021-01-28T11:36:49.153776 #4] INFO -- : [7cb3c8b7-f642-4068-8fb4-842853b2b365] Completed 400 Bad Request in 28ms (Views: 0.4ms | ActiveRecord: 1.8ms | Allocations: 3976)

```

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [January 28, 2021, 12:44pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/4 "2021-01-28T12:44:20Z")

</div>

I also have another issue that might be related to the problem. In the development environment of ForestAdmin I don’t see the last column I’ve added to the houses table. How do I get it to update itself so that shows everything according to the schema in my Rails app?

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [January 28, 2021, 1:29pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/5 "2021-01-28T13:29:06Z")

</div>

@OKMantis, I just took a look at your project and it seems that both your production and staging backends are built using `forest-rails`, and your development backend is built using `lumber` and `forest-express-sequelize`.

As your development project is supposed to be pushed to your production server after any addition to your project, ForestAdmin is not intended to have different backend type between your environments.

That being said, I wonder how you managed to create your project using `forest-rails` last October/November, and now a development environemnt using `Lumber` and `forest-express-sequelize`.

However just to answer your questions, as you made your development environment using Lumber, your schema (that populates the UI with your models) is based on the JS models defined in the `models` folder. It’s not at all related to your rails models. To do so, you’d need a development environment back end made with forest-rails.

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [January 28, 2021, 10:19pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/6 "2021-01-28T22:19:33Z")

</div>

> [@anon37102731](#):
>
> forest-express-sequelize

It’s weird though that forest-rails is installed in my rails app. I don’t understand how there can be difference between development and staging/production.

I had a commit on the 16th of November 2020:

```javascript
commit 7ed9ce8b386ec4b05d63293e0a8bdb3cb50a5c16
Author: Owen Moss <owenkmoss@gmail.com>
Date: Mon Nov 16 12:17:15 2020 +0100

    change in schema forestadmin

diff --git a/Ibiza Garden Houses/.forestadmin-schema.json b/Ibiza Garden Houses/.forestadmin-schema.json
index 1a85484..b45dabf 100644
--- a/Ibiza Garden Houses/.forestadmin-schema.json      
+++ b/Ibiza Garden Houses/.forestadmin-schema.json      
@@ -1124,7 +1124,7 @@
     "liana": "forest-express-sequelize",
     "liana_version": "6.3.13",
     "engine": "nodejs",
- "engine_version": "12.4.0",
+ "engine_version": "15.2.0",
     "framework": "express",
     "framework_version": "~4.16.3",
     "orm_version": "5.15.2"

```

I don’t know if that had anything to do with it?

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [January 28, 2021, 10:56pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/7 "2021-01-28T22:56:37Z")

</div>

Could you help me undo this situation?

---

<div class="post-metadata">

**Author:** ![anon16419211](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anon16419211](https://community.forestadmin.com/u/anon16419211)\
**Post date:** [January 29, 2021, 2:23pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/8 "2021-01-29T14:23:36Z")

</div>

Hello @OKMantis,

To help you solve your problem, could you share with us the logs you have in your browser’s console dev tool? Also if you can share us, if it exists, the request of the network tab that is blocked it would help us to understand the problem.

Thank you ! 🙂

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [February 3, 2021, 10:45am UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/9 "2021-02-03T10:45:57Z")

</div>

![Screen Shot 2021-02-03 at 11.41.25](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e67bb00e572472bab7b0c27890530168dc8c11d3.png)

These are the lines that pop up after attempting to change a record:

 ![Screen Shot 2021-02-03 at 11.42.41](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/8/812fcd3a2239d8325284f778ba8d9f2786775e9f.png)

And this is from the network tab:

 ![Screen Shot 2021-02-03 at 11.44.07](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/4d1a3607ff2bcba21c3b03ae67dba0ec75ecaa66.png) ![Screen Shot 2021-02-03 at 11.45.08](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f097fb6c6972320746ec769afc5ca27d9c1fb3cf.png) ![Screen Shot 2021-02-03 at 11.44.32](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/acb4b5db53a2102bb442f497bee74577fe548eb0.png)

---

<div class="post-metadata">

**Author:** ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)\
**Post date:** [February 3, 2021, 1:46pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/10 "2021-02-03T13:46:51Z")

</div>

hey @OKMantis 👋 your first screenshot issue seem to be similar than [Updating records in Rails \>= 6.1 fails · Issue #406 · ForestAdmin/forest-rails · GitHub](https://github.com/ForestAdmin/forest-rails/issues/406)  
If you use Rails \>= 6.1 I recommend to update your Liana to `5.4.3`.

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [February 3, 2021, 3:12pm UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/11 "2021-02-03T15:12:21Z")

</div>

That was it! Thank you so much. 😃 🔥 🚀

---

<div class="post-metadata">

**Author:** ![OKMantis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/okmantis/32/1403_2.png) [@OKMantis](https://community.forestadmin.com/u/OKMantis)\
**Post date:** [February 5, 2021, 10:03am UTC](https://community.forestadmin.com/t/forestadmin-panel-shows-error-when-i-want-to-change-something-in-the-database/1716/12 "2021-02-05T10:03:46Z")

</div>

> [@OKMantis](#):
>
> I also have another issue that might be related to the problem. In the development environment of ForestAdmin I don’t see the last column I’ve added to the houses table. How do I get it to update itself so that shows everything according to the schema in my Rails app?

I still have issue in the development environment. How can I get this back to normal again?
