Unable to export in any format (txt, pdf, etc.) #5154

Closed
opened 2026-02-05 09:44:44 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @JMD-ONP on GitHub (Jan 28, 2025).

Describe the Bug

Hi,

Since the last update (ie. v24.12.1), we cannot export pages in any format. I tried txt or pdf format.
Bookstack instance is hosted on a Linux Debian 12.9 server.

I'm using private navigation for OIDC auth purpose. It always end with the same error, on a new navigation tab in my web browser:

An Error Occurred
An unknown error occurred

In the laravel.log file, I can find this error corresponding to my actions:

2025-01-27 20:29:18] production.ERROR: Target class [BookStack\Entities\Controllers\PageExportController] does not exist. {"userId":29,"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [BookStack\\Entities\\Controllers\\PageExportController] does not exist. at /var/www/html/bookstack/vendor/laravel/framework/src/Illuminate/Container/Container.php:914)

Last update did not show any error at all as far as I remember.

I tried to update composer. I've seen some updates on components like DomPDF. I thought it would help resolving my problems but it didn't. I've cleared config, view and cache also.

Steps to Reproduce

  1. Go to any pages
  2. Scroll down to "Export"
  3. Click on "PDF file"
  4. Error comes

Expected Behaviour

It opens a new tab in my web browser with the error "An Error Occurred / An unknown error occurred" instead of exporting the page itself in the expected format.

Screenshots or Additional Context

Image Image Image Image

Browser Details

Safari 18.2 on OSX Sequoia 15.2 // Firefox 134 on Windows 11 64bits

Exact BookStack Version

v24.12.1

Originally created by @JMD-ONP on GitHub (Jan 28, 2025). ### Describe the Bug Hi, Since the last update (ie. v24.12.1), we cannot export pages in any format. I tried txt or pdf format. Bookstack instance is hosted on a Linux Debian 12.9 server. I'm using private navigation for OIDC auth purpose. It always end with the same error, on a new navigation tab in my web browser: ``` An Error Occurred An unknown error occurred ``` In the laravel.log file, I can find this error corresponding to my actions: `2025-01-27 20:29:18] production.ERROR: Target class [BookStack\Entities\Controllers\PageExportController] does not exist. {"userId":29,"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [BookStack\\Entities\\Controllers\\PageExportController] does not exist. at /var/www/html/bookstack/vendor/laravel/framework/src/Illuminate/Container/Container.php:914)` Last update did not show any error at all as far as I remember. I tried to update composer. I've seen some updates on components like DomPDF. I thought it would help resolving my problems but it didn't. I've cleared config, view and cache also. ### Steps to Reproduce 1. Go to any pages 2. Scroll down to "Export" 3. Click on "PDF file" 4. Error comes ### Expected Behaviour It opens a new tab in my web browser with the error "An Error Occurred / An unknown error occurred" instead of exporting the page itself in the expected format. ### Screenshots or Additional Context <img width="1728" alt="Image" src="https://github.com/user-attachments/assets/a7b69b9c-3311-487c-ba0d-d23d819ef2e7" /> <img width="1728" alt="Image" src="https://github.com/user-attachments/assets/797cc6e9-6276-4750-aef4-8f2891e178cf" /> <img width="1728" alt="Image" src="https://github.com/user-attachments/assets/24a10adf-15cb-4f22-9d42-c22baf334ddc" /> <img width="1728" alt="Image" src="https://github.com/user-attachments/assets/52961a6e-6d56-429e-8aa7-de45bde2b285" /> ### Browser Details Safari 18.2 on OSX Sequoia 15.2 // Firefox 134 on Windows 11 64bits ### Exact BookStack Version v24.12.1
OVERLORD added the 🐛 Bug label 2026-02-05 09:44:44 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 28, 2025):

Hi @JMD-ONP,

  • Please confirm the output of running ls -alh bootstrap/cache from your BookStack install directory.
  • Please confirm the output of running git status from your BookStack install directory.

On a separate note, I noticed your BookStack path was /var/www/html/bookstack/. Especifically if this was public, I hope that the web-server is also not serving content from the /var/www/html directory (which it often does by default).
Serving that parent directory could lead to a range of security considerations.

@ssddanbrown commented on GitHub (Jan 28, 2025): Hi @JMD-ONP, - Please confirm the output of running `ls -alh bootstrap/cache` from your BookStack install directory. - Please confirm the output of running `git status` from your BookStack install directory. On a separate note, I noticed your BookStack path was `/var/www/html/bookstack/`. Especifically if this was public, I hope that the web-server is also not serving content from the `/var/www/html` directory (which it often does by default). Serving that parent directory could lead to a range of security considerations.
Author
Owner

@hieste commented on GitHub (Jan 28, 2025):

Hi @JMD-ONP,
had same Problem and solved it. I have a function in my logical theme where i add an additional export functionality for an ERP System. In new release the class and file "BookStack\Entities\Controllers\PageExportController" has an new place inside of bookstack... You have to adjust your logical theme functions...

@hieste commented on GitHub (Jan 28, 2025): Hi @JMD-ONP, had same Problem and solved it. I have a function in my logical theme where i add an additional export functionality for an ERP System. In new release the class and file "BookStack\Entities\Controllers\PageExportController" has an new place inside of bookstack... You have to adjust your logical theme functions...
Author
Owner

@JMD-ONP commented on GitHub (Jan 28, 2025):

Hi @JMD-ONP,

  • Please confirm the output of running ls -alh bootstrap/cache from your BookStack install directory.
  • Please confirm the output of running git status from your BookStack install directory.

On a separate note, I noticed your BookStack path was /var/www/html/bookstack/. Especifically if this was public, I hope that the web-server is also not serving content from the /var/www/html directory (which it often does by default). Serving that parent directory could lead to a range of security considerations.

Hi, thank you for your answer. Here is the output of the commands you asked for.

Image

And thank you for pointing out my mistake. I moved bookstack root directory outside /var/www/html. Our bookstack instance isn't public and is behind a reverse proxy for ODIC purposes.

@JMD-ONP commented on GitHub (Jan 28, 2025): > Hi [@JMD-ONP](https://github.com/JMD-ONP), > > * Please confirm the output of running `ls -alh bootstrap/cache` from your BookStack install directory. > * Please confirm the output of running `git status` from your BookStack install directory. > > On a separate note, I noticed your BookStack path was `/var/www/html/bookstack/`. Especifically if this was public, I hope that the web-server is also not serving content from the `/var/www/html` directory (which it often does by default). Serving that parent directory could lead to a range of security considerations. Hi, thank you for your answer. Here is the output of the commands you asked for. <img width="460" alt="Image" src="https://github.com/user-attachments/assets/5e1ca9a6-7b34-4396-9568-c021fa6cbbc9" /> And thank you for pointing out my mistake. I moved bookstack root directory outside /var/www/html. Our bookstack instance isn't public and is behind a reverse proxy for ODIC purposes.
Author
Owner

@JMD-ONP commented on GitHub (Jan 28, 2025):

Hi @JMD-ONP, had same Problem and solved it. I have a function in my logical theme where i add an additional export functionality for an ERP System. In new release the class and file "BookStack\Entities\Controllers\PageExportController" has an new place inside of bookstack... You have to adjust your logical theme functions...

Hi, thank you for your reply. I'm not sure to understand as I never used any "hacks" to add functions in my bookstack instance. It's kinda "all stock". So all export functionality are the one "built-in" for me.

@JMD-ONP commented on GitHub (Jan 28, 2025): > Hi [@JMD-ONP](https://github.com/JMD-ONP), had same Problem and solved it. I have a function in my logical theme where i add an additional export functionality for an ERP System. In new release the class and file "BookStack\Entities\Controllers\PageExportController" has an new place inside of bookstack... You have to adjust your logical theme functions... Hi, thank you for your reply. I'm not sure to understand as I never used any "hacks" to add functions in my bookstack instance. It's kinda "all stock". So all export functionality are the one "built-in" for me.
Author
Owner

@ssddanbrown commented on GitHub (Jan 28, 2025):

Thanks @JMD-ONP.
Can you try deleting all *.php files within that bootstrap/cache directory?

It looks like a route-caching command has been ran at some point (or some other optimization action) which has cached the routes retaining outdated code references.

@ssddanbrown commented on GitHub (Jan 28, 2025): Thanks @JMD-ONP. Can you try deleting all `*.php` files within that `bootstrap/cache` directory? It looks like a route-caching command has been ran at some point (or some other optimization action) which has cached the routes retaining outdated code references.
Author
Owner

@JMD-ONP commented on GitHub (Jan 29, 2025):

Thanks @JMD-ONP. Can you try deleting all *.php files within that bootstrap/cache directory?

It looks like a route-caching command has been ran at some point (or some other optimization action) which has cached the routes retaining outdated code references.

Thank you very much @ssddanbrown
Deleting the old file "route-v7.php" did help a lot as I have no longer the error when exporting pages.

@JMD-ONP commented on GitHub (Jan 29, 2025): > Thanks [@JMD-ONP](https://github.com/JMD-ONP). Can you try deleting all `*.php` files within that `bootstrap/cache` directory? > > It looks like a route-caching command has been ran at some point (or some other optimization action) which has cached the routes retaining outdated code references. Thank you very much @ssddanbrown Deleting the old file "route-v7.php" did help a lot as I have no longer the error when exporting pages.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5154