The "An unknown error occurred" when saving roles #4337

Closed
opened 2026-02-05 08:35:03 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @VladimirVershinin on GitHub (Nov 25, 2023).

Describe the Bug

Hello.
We have a lot of pages, books and shelves inside our bookstack service.
Now we have An unknown error occurred" we try to save any role via bookstack web interface.
The "production.ERROR: SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders (SQL: select entity_id, entity_type, role_id, view from entity_permissions where .. " record is placed into our laravel.log when error occurs.

As side effect, after saving any role some users lost his access to some books and shelves. So I need to restore it with
"php artisan bookstack:regenerate-permissions " bookstack command.

To remove same error from regenerate-permission command I have increase my mariadb
max_allowed_packet parameter to 1073741824

This mariadb reconfiguration was helpful for cli-command, but not for "Save Role" button

Steps to Reproduce

  1. Go to Settings ->Roles
  2. Select any role ( go to Edit Role page)
  3. Click Save Role
  4. See error

Expected Behaviour

Instead of error page we expected to see refreshed Edit Role page. Also we excepted that saving role will not break user access to bookstack objects.

Screenshots or Additional Context

laravel.log.gz
изображение

Browser Details

Firefox 115.5.0esr linux

Exact BookStack Version

v23.10.4

Originally created by @VladimirVershinin on GitHub (Nov 25, 2023). ### Describe the Bug Hello. We have a lot of pages, books and shelves inside our bookstack service. Now we have An unknown error occurred" we try to save any role via bookstack web interface. The "production.ERROR: SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders (SQL: select `entity_id`, `entity_type`, `role_id`, `view` from `entity_permissions` where .. " record is placed into our laravel.log when error occurs. As side effect, after saving any role some users lost his access to some books and shelves. So I need to restore it with "php artisan bookstack:regenerate-permissions " bookstack command. To remove same error from regenerate-permission command I have increase my mariadb max_allowed_packet parameter to 1073741824 This mariadb reconfiguration was helpful for cli-command, but not for "Save Role" button ### Steps to Reproduce 1. Go to Settings ->Roles 2. Select any role ( go to Edit Role page) 3. Click Save Role 4. See error ### Expected Behaviour Instead of error page we expected to see refreshed Edit Role page. Also we excepted that saving role will not break user access to bookstack objects. ### Screenshots or Additional Context [laravel.log.gz](https://github.com/BookStackApp/BookStack/files/13463397/laravel.log.gz) ![изображение](https://github.com/BookStackApp/BookStack/assets/138576120/f344abe9-6f07-4261-97b8-562075db1981) ### Browser Details Firefox 115.5.0esr linux ### Exact BookStack Version v23.10.4
OVERLORD added the 🐛 Bug🏭 Back-End🔍 Pending Validation labels 2026-02-05 08:35:03 +03:00
Author
Owner

@digitlimit commented on GitHub (Dec 6, 2023):

@ssddanbrown is it okay If I fix and create a PR for this?

@digitlimit commented on GitHub (Dec 6, 2023): @ssddanbrown is it okay If I fix and create a PR for this?
Author
Owner

@ssddanbrown commented on GitHub (Dec 6, 2023):

@digitlimit Sure, go ahead, but I've marked this for the next feature release (targeting end of year) so ideally any PR would be in by the end of next week. If that's okay and you want to take it on let me know and I'll assign this to you.

@ssddanbrown commented on GitHub (Dec 6, 2023): @digitlimit Sure, go ahead, but I've marked this for the next feature release (targeting end of year) so ideally any PR would be in by the end of next week. If that's okay and you want to take it on let me know and I'll assign this to you.
Author
Owner

@ssddanbrown commented on GitHub (Dec 23, 2023):

I've now made changes in 02d94c8798 with the intent to address this.
The erroring query is now done in a more scale-aware & scale-efficient way that'll better handle large amounts of content.

This will be part of the next feature release, due at the end of this month.
Thanks @VladimirVershinin for raising and detailing the issue.

@ssddanbrown commented on GitHub (Dec 23, 2023): I've now made changes in 02d94c87985eda533a4495e33191ef03e704a11c with the intent to address this. The erroring query is now done in a more scale-aware & scale-efficient way that'll better handle large amounts of content. This will be part of the next feature release, due at the end of this month. Thanks @VladimirVershinin for raising and detailing the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4337