BookStackApp/BookStack

'too many placeholders at ' while saving Page.

OnlySlon opened this issue · 2 comments

Describe the Bug

[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders at /var/www/bookstack/vendor/laravel/framew ork/src/Illuminate/Database/MySqlConnection.php:39) [stacktrace] #0 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php(39): PDO->prepare() #1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\\Database\\MySqlConnection->Illuminate\\Database\\{closure}() #2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php(783): Illuminate\\Database\\Connection->runQueryCallback() #3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php(34): Illuminate\\Database\\Connection->run() #4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3498): Illuminate\\Database\\MySqlConnection->insert() #5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1982): Illuminate\\Database\\Query\\Builder->insert() #6 /var/www/bookstack/app/Search/SearchIndex.php(33): Illuminate\\Database\\Eloquent\\Builder->__call() #7 /var/www/bookstack/app/Entities/Models/Entity.php(308): BookStack\\Search\\SearchIndex->indexEntity() #8 /var/www/bookstack/app/Entities/Repos/BaseRepo.php(78): BookStack\\Entities\\Models\\Entity->indexForSearch() #9 /var/www/bookstack/app/Entities/Repos/PageRepo.php(101): BookStack\\Entities\\Repos\\BaseRepo->update() #10 /var/www/bookstack/app/Entities/Controllers/PageController.php(225): BookStack\\Entities\\Repos\\PageRepo->update() #11 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\\Entities\\Controllers\\PageController->update() #12 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction() #13 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch() #14 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController() #15 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()

Steps to Reproduce

Saving big c-header size (3.2Mb) inside pre-tags

Expected Behaviour

code 200

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

git head

Looks like we need to add some extra chunking/handling for search term index insertion.
I've assigned this to the next feature release to be confirmed/addresses.

That said, >3MB of content is pretty massive and BookStack pages are not really intended for that kind of scale, so you may face other issues or side-affects with so much content for a single page.