HTML/PDF Export problem, "An unknown error occurred" need some help. #620

Closed
opened 2026-02-04 21:28:15 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Xerwulf7 on GitHub (Mar 30, 2018).

Originally assigned to: @ssddanbrown on GitHub.

  • BookStack Version: latest
  • PHP Version: 7
  • MySQL Version: 5.7
  • Apache2
  • Ubuntu 16 LTS latest

I have a problem with the HTML/PDF Export, (with ngixn and apache2). Everytime I try to export a book to PDF or HTML I get an error:
"An unknown error occurred".... nothing else.
I tried to install it with the Ubuntu 16 script and after that I installed all on my own.
All works except the export function..
Can anyone help?

!chown -R www-data:www-data on BookStack directory is done and all folders which needs r/w got chmod 777.!

Originally created by @Xerwulf7 on GitHub (Mar 30, 2018). Originally assigned to: @ssddanbrown on GitHub. * BookStack Version: latest * PHP Version: 7 * MySQL Version: 5.7 * Apache2 * Ubuntu 16 LTS latest I have a problem with the HTML/PDF Export, (with ngixn and apache2). Everytime I try to export a book to PDF or HTML I get an error: "An unknown error occurred".... nothing else. I tried to install it with the Ubuntu 16 script and after that I installed all on my own. All works except the export function.. Can anyone help? !chown -R www-data:www-data on BookStack directory is done and all folders which needs r/w got chmod 777.!
OVERLORD added the 🐛 Bug🐕 Support labels 2026-02-04 21:28:15 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 30, 2018):

Hi @Xerwulf7,
Sorry to hear you are having issues.

You can find some debugging instructions on the docs here. Please follow these and see if you get any more information with debugging turned on.

Post any logs or extra info here if you need further help.

@ssddanbrown commented on GitHub (Mar 30, 2018): Hi @Xerwulf7, Sorry to hear you are having issues. You can find some debugging [instructions on the docs here](https://www.bookstackapp.com/docs/admin/debugging/). Please follow these and see if you get any more information with debugging turned on. Post any logs or extra info here if you need further help.
Author
Owner

@Xerwulf7 commented on GitHub (Mar 30, 2018):

Hey ssddanbrown,
here is some Info:

file_get_contents(/var/www/BookStack/public/css/export-styles.css): failed to open stream: No such file or directory (View: /var/www/BookStack/resources/views/books/export.blade.php)

<!doctype html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><?php echo e($book->name); ?></title>
 
    <style>
        <?php if(!app()->environment('testing')): ?>
        <?php echo file_get_contents(public_path('/css/export-styles.css')); ?>
 
        <?php endif; ?>
        .page-break {
            page-break-after: always;
        }
        .chapter-hint {
            color: #888;
            margin-top: 32px;
        }
        .chapter-hint + h1 {
            margin-top: 0;
        }
        ul.contents ul li {
            list-style: circle;
        }
        @media  screen {
            .page-break {
                border-top: 1px solid #DDD;
            }
        }
    </style>
    <?php echo $__env->yieldContent('head'); ?>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="page-content">
 
                <h1 style="font-size: 4.8em"><?php echo e($book->name); ?></h1>

Arguments

"file_get_contents(/var/www/BookStack/public/css/export-styles.css): failed to open stream: No such file or directory (View: /var/www/BookStack/resources/views/b ▶"

Cant see any CSS folder in public folder... :/

@Xerwulf7 commented on GitHub (Mar 30, 2018): Hey ssddanbrown, here is some Info: file_get_contents(/var/www/BookStack/public/css/export-styles.css): failed to open stream: No such file or directory (View: /var/www/BookStack/resources/views/books/export.blade.php) <!doctype html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo e($book->name); ?></title> <style> <?php if(!app()->environment('testing')): ?> <?php echo file_get_contents(public_path('/css/export-styles.css')); ?> <?php endif; ?> .page-break { page-break-after: always; } .chapter-hint { color: #888; margin-top: 32px; } .chapter-hint + h1 { margin-top: 0; } ul.contents ul li { list-style: circle; } @media screen { .page-break { border-top: 1px solid #DDD; } } </style> <?php echo $__env->yieldContent('head'); ?> </head> <body> <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="page-content"> <h1 style="font-size: 4.8em"><?php echo e($book->name); ?></h1> Arguments "file_get_contents(/var/www/BookStack/public/css/export-styles.css): failed to open stream: No such file or directory (View: /var/www/BookStack/resources/views/b ▶" Cant see any CSS folder in public folder... :/
Author
Owner

@ssddanbrown commented on GitHub (Mar 30, 2018):

@Xerwulf7 Thanks for confirming the error info.

I can confirm this is a bug and I've just pushed out fix in 3cd08382e9 and released v0.20.2 to cover this.

Simply update your BookStack instance and this should be fixed.
Let me know if you experience any issues afterwards.

@ssddanbrown commented on GitHub (Mar 30, 2018): @Xerwulf7 Thanks for confirming the error info. I can confirm this is a bug and I've just pushed out fix in 3cd08382e944600ecdd1212ce94a9922b4406050 and released v0.20.2 to cover this. Simply [update your BookStack instance](https://www.bookstackapp.com/docs/admin/updates/) and this should be fixed. Let me know if you experience any issues afterwards.
Author
Owner

@Xerwulf7 commented on GitHub (Mar 30, 2018):

Nice to hear, thanks :) I will try

@Xerwulf7 commented on GitHub (Mar 30, 2018): Nice to hear, thanks :) I will try
Author
Owner

@Xerwulf7 commented on GitHub (Mar 30, 2018):

Works like a charm, thanks for the quick response and fix! Have a nice eastern weekend :)

@Xerwulf7 commented on GitHub (Mar 30, 2018): Works like a charm, thanks for the quick response and fix! Have a nice eastern weekend :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#620