SQL error and HTTP/500 when loading a specific page or book #4571

Open
opened 2026-02-05 09:05:38 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @alb-uss on GitHub (Apr 4, 2024).

Describe the Bug

Hello,

First of all, thank you very much for your work on this superb tool, Bookstack.

After a fresh installation of Bookstack (via Docker-compose, Linux-server image + mariadb, as per the docs), I imported via API about 13000 pages, spread over 3 books (which are also 3 different "Category" tags), with pause times to avoid reaching the rate limit of course.

When I try to click via the web UI on the largest "Unsorted" book (http://mydom.com/books/unsorted, 8200 pages approx.), I get a 500 error. I also get this 500 error when I click on a page in this book (http://mydom.com/books/unsorted/page/my-example-page).

Steps to Reproduce

(Check bug description)

Expected Behaviour

An error 500 appears on the browser.

Screenshots or Additional Context

Here are the logs found in laravel.log on the same time of the click :

[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414)
[stacktrace]
#0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): PDO->prepare()
#1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
#2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\\Database\\Connection->runQueryCallback()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\\Database\\Connection->run()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2705): Illuminate\\Database\\Connection->select()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3230): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2693): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /app/www/app/Settings/SettingService.php(117): Illuminate\\Database\\Query\\Builder->get()
#9 /app/www/app/Settings/SettingService.php(73): BookStack\\Settings\\SettingService->loadToLocalCache()
#10 /app/www/app/Settings/SettingService.php(27): BookStack\\Settings\\SettingService->getValueFromStore()
#11 /app/www/app/App/helpers.php(81): BookStack\\Settings\\SettingService->get()
#12 /app/www/storage/framework/views/872733693c1f8e7d46945825e715cc42e8efb276.php(6): setting()
#13 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#14 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#15 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#16 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#17 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(195): Illuminate\\View\\Engines\\CompilerEngine->get()
#18 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\\View\\View->getContents()
#19 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\\View\\View->renderContents()
#20 /app/www/storage/framework/views/6212e6f16538942c654408b0bb64b92abc2fa8d6.php(16): Illuminate\\View\\View->render()
#21 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#22 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#23 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#24 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#25 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(195): Illuminate\\View\\Engines\\CompilerEngine->get()
#26 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\\View\\View->getContents()
#27 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\\View\\View->renderContents()
#28 /app/www/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render()
#29 /app/www/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent()
#30 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\\Http\\Response->__construct()
#31 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\\Routing\\ResponseFactory->make()
#32 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(626): Illuminate\\Routing\\ResponseFactory->view()
#33 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(554): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()
#34 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(460): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse()
#35 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(377): Illuminate\\Foundation\\Exceptions\\Handler->renderExceptionResponse()
#36 /app/www/app/Exceptions/Handler.php(89): Illuminate\\Foundation\\Exceptions\\Handler->render()
#37 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(233): BookStack\\Exceptions\\Handler->render()
#38 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(210): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->renderHttpResponse()
#39 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(246): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleException()
#40 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleShutdown()
#41 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#42 {main}
"} 

Browser Details

Brave

Exact BookStack Version

v24.02.2

Originally created by @alb-uss on GitHub (Apr 4, 2024). ### Describe the Bug Hello, First of all, thank you very much for your work on this superb tool, Bookstack. After a fresh installation of Bookstack (via Docker-compose, Linux-server image + mariadb, as per the docs), I imported via API about 13000 pages, spread over 3 books (which are also 3 different "Category" tags), with pause times to avoid reaching the rate limit of course. When I try to click via the web UI on the largest "Unsorted" book (http://mydom.com/books/unsorted, 8200 pages approx.), I get a 500 error. I also get this 500 error when I click on a page in this book (http://mydom.com/books/unsorted/page/my-example-page). ### Steps to Reproduce (Check bug description) ### Expected Behaviour An error 500 appears on the browser. ### Screenshots or Additional Context Here are the logs found in laravel.log on the same time of the click : ``` [previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414) [stacktrace] #0 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): PDO->prepare() #1 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}() #2 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\\Database\\Connection->runQueryCallback() #3 /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\\Database\\Connection->run() #4 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2705): Illuminate\\Database\\Connection->select() #5 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\\Database\\Query\\Builder->runSelect() #6 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3230): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}() #7 /app/www/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2693): Illuminate\\Database\\Query\\Builder->onceWithColumns() #8 /app/www/app/Settings/SettingService.php(117): Illuminate\\Database\\Query\\Builder->get() #9 /app/www/app/Settings/SettingService.php(73): BookStack\\Settings\\SettingService->loadToLocalCache() #10 /app/www/app/Settings/SettingService.php(27): BookStack\\Settings\\SettingService->getValueFromStore() #11 /app/www/app/App/helpers.php(81): BookStack\\Settings\\SettingService->get() #12 /app/www/storage/framework/views/872733693c1f8e7d46945825e715cc42e8efb276.php(6): setting() #13 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...') #14 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}() #15 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire() #16 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath() #17 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(195): Illuminate\\View\\Engines\\CompilerEngine->get() #18 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\\View\\View->getContents() #19 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\\View\\View->renderContents() #20 /app/www/storage/framework/views/6212e6f16538942c654408b0bb64b92abc2fa8d6.php(16): Illuminate\\View\\View->render() #21 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...') #22 /app/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}() #23 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire() #24 /app/www/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath() #25 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(195): Illuminate\\View\\Engines\\CompilerEngine->get() #26 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\\View\\View->getContents() #27 /app/www/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\\View\\View->renderContents() #28 /app/www/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render() #29 /app/www/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent() #30 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\\Http\\Response->__construct() #31 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\\Routing\\ResponseFactory->make() #32 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(626): Illuminate\\Routing\\ResponseFactory->view() #33 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(554): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException() #34 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(460): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse() #35 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(377): Illuminate\\Foundation\\Exceptions\\Handler->renderExceptionResponse() #36 /app/www/app/Exceptions/Handler.php(89): Illuminate\\Foundation\\Exceptions\\Handler->render() #37 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(233): BookStack\\Exceptions\\Handler->render() #38 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(210): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->renderHttpResponse() #39 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(246): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleException() #40 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleShutdown() #41 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}() #42 {main} "} ``` ### Browser Details Brave ### Exact BookStack Version v24.02.2
OVERLORD added the 🐛 Bug label 2026-02-05 09:05:38 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4571