Can not edit collection type item in the admin panel

On admin load I got popup error message An error occurred with console error
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

When I add some images to gallery in the admin panel (Product content type), I get error popup message:
An error occurred during record fetch.

I get an error in console also

​​​message: "insert into `upload_file_morph` (`field`, `order`, `related_id`, `related_type`, `upload_file_id`) values ('gallery', 4, 134, 'components_product_colors', '[object Object]') - ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect integer value: '[object Object]' for column `strapi_db`.`upload_file_morph`.`upload_file_id` at row 1"

With this I can’t edit an item.

System Information
  • Strapi Version: 3.3.3
  • Operating System: Ubuntu 18.04.4 LTS
  • Database: MariaDB 10.5.4
  • Node Version: 14.15.0
  • NPM Version: 6.14.5
  • Yarn Version: 1.22.4

What were you doing when that error came up?

I have restarted Strapi service, recreated the item at the admin panel, and all problems gone.

Hi all, I’m seeing a similar issue to the one above but with different errors. I have a work around for now, but thought I’d share this with you for debugging purposes.

Steps to reproduce

  • I’m using the default blog template found in this tutorial https://strapi.io/blog/build-a-static-blog-with-gatsby-and-strapi

  • Add a new field to a Collection Type (in this example the Category Collection Type)

  • Hit ‘Save’ button

Errors

  • ‘An error occured’ pop up in admin panel UI

  • Page stuck on loading spinner

  • Console shows no error but is stuck at this position:


[2021-06-05T10:20:55.200Z] info File changed: C:\Repos\competa-lifestyle-backend\api\article\models\article.settings.json

[2021-06-05T10:20:55.202Z] info File changed: C:\Repos\competa-lifestyle-backend\api\category\models\category.settings.json

[2021-06-05T10:20:55.206Z] debug PUT /content-type-builder/content-types/application::category.category (54 ms) 201

[2021-06-05T10:20:55.212Z] info The server is restarting

 Project information

┌────────────────────┬──────────────────────────────────────────────────┐

│ Time               │ Sat Jun 05 2021 11:21:00 GMT+0100 (British Summ… │

│ Launched in        │ 4202 ms                                          │

│ Environment        │ development                                      │

│ Process PID        │ 552                                              │

│ Version            │ 3.6.3 (node v14.16.0)                            │

│ Edition            │ Community                                        │

└────────────────────┴──────────────────────────────────────────────────┘

 Actions available

Welcome back!

To manage your project �, go to the administration panel at:

http://localhost:1338/admin

To access the server ⚡️, go to:

http://localhost:1338

[2021-06-05T10:21:00.642Z] debug GET /content-type-builder/content-types (44 ms) 200

[2021-06-05T10:21:00.667Z] debug GET /content-type-builder/reserved-names (62 ms) 200

  • Navigating to /admin/plugins/content-manager/collectionType/application::category.category/7 to edit an entry the new field shows as disabled with No permissions to see this field placeholder.

Workaround

  • This seems to only happen on first load of the admin panel. Refreshing the page seems to resolve the issue.

  • The new field is enabled again and subsequent saves work until you restart a strapi again and start a new session.

Thanks for all your hard work.

Sounds like a corrupted admin build :thinking: is this a fresh project?

It is fairly fresh, though I’ve made a few changes at this point. Any other info I can provide?