-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Error export book from API #3394
Comments
Hi @cevinov, Before anything else, just a warning, your video shows your BookStack URL and API credentials. Anyone could use these details to access your instance. You might want to take this video down if this is a security concern for you. Otherwise:
php book-to-static.php c-documentation ./book Just keep in mind these scripts are examples for API users, More of a jumping-off point. They are not built to be 100% complete or user-friendly. |
It looks like it's getting further, since it's now getting to line 45 which is when page content is fetched (After other API calls), but it's hard for me to offer further support really since this could be due to a range of things. You'd need to start check the |
I see sir, but how to resolve this issue sir ? I choose this method (PHP script) because i can't export it from the UI. FYI I'm already do this to prevent data loss |
and may i know how to move page without one by one sir ?. For example if i want to move 20 pages to other chapter page or book |
Based upon the error logs you posted originally, It looks like you're running out of memory for PHP. This is usually configured via a
Go to the parent book and use the "Sort" action. This allows you to move multiple items with relative ease. |
@cevinov Maybe? Unfortunately I am not familiar with Oracle Linux or your setup to be sure. You can try adding a
|
@cevinov The Based upon your error log message, your PHP memory limit is still about 128MB. This may not be enough for the export to run. |
@cevinov Well it looks like you're getting further since you're now hitting a new limit. I saw you mentioned using containers. You might need to refer to the documentation of the container that you're using to find the right way to edit the |
Since there's been no follow-up I'm going to close this. If the issue remains and is something you still require to be fixed respond to my previous comment and this can then be re-opened. |
Dear @ssddanbrown, I run into the same error when trying to export a large book with largish images. I have increased the limit like mentioned: and restarded the docker. but still get the error in the
|
Might actually be related to timout #5119 |
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
Hello i already try to use this guide link :
https://www.reddit.com/r/BookStack/comments/razmx8/exporting_the_whole_bookstack_as_html_or_pdf_file/
But i got this error :
PHP Fatal error: Uncaught TypeError: Return value of apiGetJson() must be of the type array, null returned in /book/book-to-static.php:240
Stack trace:
#0 /book/book-to-static.php(192): apiGetJson()
#1 /book/book-to-static.php(32): getBookBySlug()
#2 {main}
thrown in /book/book-to-static.php on line 240
Footage :
https://screenrec.com/share/dSj6oqNKyr
Exact BookStack Version
PHP Fatal error: Uncaught TypeError: Return value of apiGetJson() must be of the type array, null returned in /book/book-to-static.php:240 Stack trace: #0 /book/book-to-static.php(192): apiGetJson() #1 /book/book-to-static.php(32): getBookBySlug() #2 {main} thrown in /book/book-to-static.php on line 240
Log Content
[2022-04-03 09:44:49] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 116640000 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 116640000 bytes) at /var/www/html/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:128)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:18:11] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:18:19] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65950651 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 65950651 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:18:32] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:19:00] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:21:24] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 12:23:23] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
[2022-04-24 13:06:12] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) {"userId":1,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 64448059 bytes) at /var/www/html/app/Entities/Tools/ExportFormatter.php:231)
[stacktrace]
#0 {main}
"}
PHP Version
7.4
Hosting Environment
Oracle cloud
OS : Oracle linux 8.5
Bookstack install on Docker
Docker version 20.10.14
The text was updated successfully, but these errors were encountered: