Task2PDF causes errors during execution

  • Version: 1.2.36
  • PHP Version: 8.1.28
  • PHP SAPI: apache2handler
  • HTTP-Client: cURL
  • OS Version: Windows NT 10.0
  • Datenbanktreiber: mysql
  • Datenbank Version: 10.4.28-MariaDB
  • Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
  • Task2PDF: 1.8.0

Hello everyone,

unfortunately we still have an error with the PDF creation via Task2PDF after the update from 1.2.30 to 1.2.36 and urgently need support, as we as administration depend on kanbaord.

It seems that it has something to do with the number of tasks per project. If the number is small (approx. < 5 tasks) then a PDF is created with the tasks, otherwise the following error message appears:

Warning: md5_file(C:\Program Files\xampp\htdocs\kanboard\data\files/tasks\435\c501458cb96bec0721129522eb67234ec1cd8833): Failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php on line 2944
Warning: fopen(C:\Program Files\xampp\htdocs\kanboard\data\files/tasks\435\c501458cb96bec0721129522eb67234ec1cd8833): Failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php on line 2945
Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php:2949 Stack trace: #0 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php(2949): fread(false, 8192) #1 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php(3212): Dompdf\Cpdf->o_embedded_file(104, ‘out’) #2 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\src\Adapter\CPDF.php(912): Dompdf\Cpdf->output(false) #3 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\src\Dompdf.php(869): Dompdf\Adapter\CPDF->stream(‘191_"roter Fade…’, Array) #4 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\Controller\PrintTaskController.php(264): Dompdf\Dompdf->stream(‘191_"roter Fade…’) #5 C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\Controller\PrintTaskController.php(102): Kanboard\Plugin\Task2pdf\Controller\PrintTaskController->printProject(Array, Array) #6 C:\Program Files\xampp\htdocs\kanboard\app\Core\Controller\Runner.php(77): Kanboard\Plugin\Task2pdf\Controller\PrintTaskController->printProjectAll() #7 C:\Program Files\xampp\htdocs\kanboard\app\Core\Controller\Runner.php(31): Kanboard\Core\Controller\Runner->executeController() #8 C:\Program Files\xampp\htdocs\kanboard\index.php(9): Kanboard\Core\Controller\Runner->execute() #9 {main} thrown in C:\Program Files\xampp\htdocs\kanboard\plugins\Task2pdf\vendor\dompdf\dompdf\lib\Cpdf.php on line 2949

Thanks for helping us!

I think, there is something special with your installation (besides it’s on Windows) you didn’t tell.

Anyway, here is my best guess. (Without information, only guessing is possible, but there is no fun with it.)

TaskToPdf scans the DB for attachments to include (Table task_has_files). It finds an attachment record, but the referenced file is physically missing in the file store.

As I said, It’s just a guess. If the mentioned file is indeed missing, then your installation is considered corrupt.

Looks like its the slashes. I would even know how to pragmatically account for that, linux to windows…

1 Like

Hello everyone,

I have received positive feedback from my colleague who is in charge of kanboard admin after your input. What unfortunately happened: The physical files were “overlooked” during the update, so Task2PDF could not find the attachments. We retrieved this from a backup and look … Task2PDF is working again. The note from alfredb “… but the referenced file is physically missing in the file store." has brought the solution.

Thanks a million,
Andreas

1 Like