Topic on Extension talk:PdfBook

Failed to load PDF document.

8
Squeak24 (talkcontribs)

Hi

I am having a bit of an issue with PdfBook not exporting to PDF.

I have an issue where I am getting an error

Error 
Failed to load PDF document.

I have done what DGessei suggests on FreeBSD installation - fails to generate pdf but does generate HTML substituting the path to HtmlDoc with what I have, but still get the same error.

I am running: RHELV7 MediaWiki 1.35.3 PHP 7.4.22 (apache2handler) MariaDB 10.5.11-MariaDB


I have set my path to HTMLDoc to /var/lib/snapd/snap/htmldoc/current

I am running it on a server with TLS, I did see HtmlDoc only works with http:// rather than https:// so not sure if that is a thing or if that's something which isn't anything to be worried about.


Any help is appreciated.

Igorabsorto (talkcontribs)

Hi @Squeak24 I don't think it is an issue with TLS.

As your issue seems similar to the one DGessei described, can you confirm that:

  1. Exporting as HTML works action=pdfbook&format=html
  2. Invoking HTMLDoc from command line works

thanks!

Squeak24 (talkcontribs)
Igorabsorto (talkcontribs)

@Squeak24 Nice, it seems that HTMLDoc is working fine them.


Please check your wiki log searching for 'PdfBook' and also look the httpd-error.log. In DGessei there was some useful error in the httpd log.

We have to keep digging, I'm not aware of what could be possibly happening, I'm hopeful the logs will help us.

Squeak24 (talkcontribs)

Just checked the httpd-error log, and I think I know what's not working, just how to make it work.

The error I got is:

[Thu Aug 12 12:29:20.767533 2021] [core:notice] [pid ****:tid ******] AH00052: child pid **** exit signal Segmentation fault (11)

sh: /var/www/html/****/images/pdf-book-cache-f9615d5465514db4928d99bae7e5c29e: Permission denied

sh: /var/www/html/****/images/pdf-book-cache-f9615d5465514db4928d99bae7e5c29e: Permission denied

So I created the folder pdf-book-cache-f9615d5465514db4928d99bae7e5c29 in the images directory and chmod to 755.

But when I try and run the PdfBook for the help category I still don't get a PDF output. The HTML is still blank.

The error this time is:

sh: /var/www/html/wind/images/pdf-book-cache-3111d94f42c206868284391c0693d1ce: Permission denied

I can upload images OK. The permissions are set to 755 and the owner is root. I guess the owner should be www-data or httpd

Any help is appreciated.

Igorabsorto (talkcontribs)

@Squeak24 Great, we have some directions now :)

The owner of the images directory should be httpd (for Apache) or www-data (nginx).

Just run chown recursively on the directory and you should be good to go.

Squeak24 (talkcontribs)

Apologies for the delay. I have been a little run of my feet recently.


I have tried to do what has suggested. I am just experimenting on a Ubuntu machine as well.


But I am still having the same issues. The Wiki I am working on is part of a farm using symbolic links, this will be the way we will be doing things in the future. After further experimentation I can't even upload images.


I get the error:

Uploading not possible "Could not open lock file for "mwstore://local-backend/local-public/"


I have tried to change the image directory and upload path in the Local LocalSettings.php, but still nothing.

When I include the full path:

/var/www/html/field1/images

The image uploads, but doesn't display. The URL looks something like:

http://field1.tld/index.php/Image/path to image/image.png

But if I take out the index.php and change the Image to image the file shows.

I did get the images working on a farm, but for some reason it's not working now.

Any help is appreciated.

Squeak24 (talkcontribs)

So, I got it working on my Ubuntu device by using the code:


$wgUploadDirectory = "/var/www/html/field1/images";

$wgUploadPath = "/images";


But it's still not working on Red Hat! This is annoying.

Reply to "Failed to load PDF document."