Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf export: Parent table not found for table cell #5395

Open
tipuraneo opened this issue Jan 7, 2025 · 1 comment
Open

pdf export: Parent table not found for table cell #5395

tipuraneo opened this issue Jan 7, 2025 · 1 comment
Labels

Comments

@tipuraneo
Copy link

Describe the Bug

Hello,

I am running Bockstack v24.12 on Ubuntu 22.04.5 LTS with Apache/2.4.52 (Ubuntu) and PHP 8.1.2-1ubuntu2.2. During the pdf export of the chapter I get the following error in the laravel.log.

[2025-01-07 17:35:48] production.ERROR: Parent table not found for table cell {"exception":"[object] (Dompdf\\Exception(code: 0): Parent table not found for table cell at /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/TableCell.php:40)
[stacktrace]
#0 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\TableCell->reflow()
#1 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/TableRow.php(56): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#2 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\TableRow->reflow()
#3 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/TableRowGroup.php(50): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#4 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\TableRowGroup->reflow()
#5 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/Block.php(865): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#6 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\Block->reflow()
#7 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/Block.php(865): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#8 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\Block->reflow()
#9 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/Block.php(865): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#10 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\Block->reflow()
#11 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameReflower/Page.php(142): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#12 /var/www/bookstack/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(905): Dompdf\\FrameReflower\\Page->reflow()
#13 /var/www/bookstack/vendor/dompdf/dompdf/src/Dompdf.php(808): Dompdf\\FrameDecorator\\AbstractFrameDecorator->reflow()
#14 /var/www/bookstack/app/Exports/PdfGenerator.php(64): Dompdf\\Dompdf->render()
#15 /var/www/bookstack/app/Exports/PdfGenerator.php(26): BookStack\\Exports\\PdfGenerator->renderUsingDomPdf()
#16 /var/www/bookstack/app/Exports/ExportFormatter.php(162): BookStack\\Exports\\PdfGenerator->fromHtml()
#17 /var/www/bookstack/app/Exports/ExportFormatter.php(125): BookStack\\Exports\\ExportFormatter->htmlToPdf()
#18 /var/www/bookstack/app/Exports/Controllers/ChapterExportController.php(30): BookStack\\Exports\\ExportFormatter->chapterToPdf()
#19 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\\Exports\\Controllers\\ChapterExportController->pdf()
#20 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#21 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#22 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#23 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#24 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#25 /var/www/bookstack/app/Http/Middleware/CheckUserHasPermission.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\CheckUserHasPermission->handle()
#27 /var/www/bookstack/app/Http/Middleware/Authenticate.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\Authenticate->handle()
#29 /var/www/bookstack/app/Http/Middleware/Localization.php(32): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\Localization->handle()
#31 /var/www/bookstack/app/Http/Middleware/RunThemeActions.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\RunThemeActions->handle()
#33 /var/www/bookstack/app/Http/Middleware/CheckEmailConfirmed.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\CheckEmailConfirmed->handle()
#35 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#37 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#39 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#41 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle()
#42 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#44 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#46 /var/www/bookstack/app/Http/Middleware/ApplyCspRules.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\ApplyCspRules->handle()
#48 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#50 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinStack()
#51 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute()
#52 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute()
#53 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#54 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#55 /var/www/bookstack/app/Http/Middleware/PreventResponseCaching.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\PreventResponseCaching->handle()
#57 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /var/www/bookstack/app/Http/Middleware/TrustProxies.php(41): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#59 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): BookStack\\Http\\Middleware\\TrustProxies->handle()
#60 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#62 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#63 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#65 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#67 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#69 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#70 /var/www/bookstack/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle()
#71 {main}
"}

apache error.log does not give any hints. access.log says:

x.x.x.x - - [07/Jan/2025:17:49:51 +0100] "GET /books/moodle/chapter/interaktivitat-und-austausch/export/pdf HTTP/1.1" 500 22179 "https://kb.el.uni-leipzig.de/books/moodle/chapter/interaktivitat-und-austausch" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"

Error occurs with and without logged in user.
How can I fix it?

Kind Regards

Steps to Reproduce

  1. navigate to Website
  2. click on Export > PDF

Expected Behaviour

generating a pdf file and push it for download

Screenshots or Additional Context

image

Browser Details

Chrome

Exact BookStack Version

v24.12

@tipuraneo
Copy link
Author

I was able to narrow down the issue to a single page. By creating a new page with a the simplest possible table could reproduce the issue:

<table id="bkmrk-%C2%A0">
<tbody>
<tr>
<td>&nbsp;</td>
</tr>
</tbody>
</table>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant