Forums | Mahara Community

Support /
why PDF export can't finish?


denny jenny's profile picture
Posts: 12

29 June 2020, 20:16

Hi everyone!

In my ubuntu server 20.04, I installed mahara 20.04 and enable pdf export plugin. when I export my portfolio, system stop at "copying some extra files...“,why?

denny jenny's profile picture
Posts: 12

12 July 2020, 12:16

My OS is Ubuntu Server 20.04, My Mahara is 20.04

In my system, I'm installed chromium-browser,poppler-utils,ghostscript, then enabled PDF export in config.php and plugins administration page.

When i export my pages, Mahara system stop at  "copying extra files". If I disable PDF export, export pages can finish.

so question is why pdf export cann't finish?

denny jenny's profile picture
Posts: 12

12 July 2020, 12:21

If i enabled "Export to queue" and PDF export,when i export my pages, in export queue page I can see that export is doing, but about 5 minutes later ,Mahara system report that export is failure.

Cecilia Vela's profile picture
Posts: 110

14 July 2020, 11:58

Hi Denny,

We would need a bit more information to understand the problem. Do you have any error messages in the server's logs?

Cheers,

Cecilia

denny jenny's profile picture
Posts: 12

14 July 2020, 18:32

Thank you !

I enabled PDF export plugin in my site, System didn't report any errors.

When I export my pages , in "Export your portfolio" page, system stopped at "Please wait while your export is being generated..." and "Copying extra files" for long long time, but system do not report any errros also.

In server "dataroot" directory, "HTML" directory have some generated files ,but "PDF" directory is empty.

If I disabled PDF export plugin in my site, then exporting pages can be finished normally.

So I don't know why?

denny jenny's profile picture
Posts: 12

14 July 2020, 19:04

Bellow is  apache error logs after Export pages

 

dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
[Tue Jul 14 06:57:29.232825 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056] [WAR] 7d (lib/errors.php:536) [RuntimeException]: Chrome process stopped before startup completed. Additional info: /usr/bin/chromium-browser: 12: xdg-settings: not found, referer: http://172.18.39.185/export/index.php
[Tue Jul 14 06:57:29.232899 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056] [WAR] 7d (lib/errors.php:536) cmd_run.go:918: WARNING: cannot create user data directory: cannot create "/usr/sbin/snap/chromium/1213": mkdir /usr/sbin/snap: permission denied, referer: http://172.18.39.185/export/index.php
[Tue Jul 14 06:57:29.232920 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056] [WAR] 7d (lib/errors.php:536) cannot create user data directory: /usr/sbin/snap/chromium/1213: Permission denied at /apps/mahara/htdocs/lib/chrome-php/headless-chromium-php-master/src/Browser/BrowserProcess.php:379, referer: http://172.18.39.185/export/index.php
[Tue Jul 14 06:57:29.232946 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056] Call stack (most recent first):, referer: http://172.18.39.185/export/index.php
[Tue Jul 14 06:57:29.232982 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056]   * exception(object(RuntimeException)) at Unknown:0, referer: http://172.18.39.185/export/index.php
[Tue Jul 14 06:57:29.232999 2020] [php7:notice] [pid 109769] [client 172.18.40.239:60056] , referer: http://172.18.39.185/export/index.php

 

In my Ubuntu Server 20.04, I installed chromium-browser, It was installed as a "snap" package, How to config it fot Mahara system?

Kristina Hoeppner's profile picture
Posts: 4729

29 November 2020, 10:28

Hi,

Snap in Ubuntu 20.04 changed a few things were files are stored. Essentially, it's creating a home directory within Snap for the application. We haven't tested the PDF export on Ubuntu 20.04 yet and thus can't give a best practice answer. For my laptop though I was told to avoid this problem that snap posed, the install an app using

snap ... --classic

Then it is supposed to follow the 'old' structure of installing apps and utilise the regular home directory.

I filed a bug report so we are not loosing track of this issue.

Best,

Kristina

06 November 2021, 4:35

We have a problem with this. It's trying to run chromium pdf under system or exec privileges. This is not allowed on our system.

Is there a fix for this?

Full logs here: https://bugs.launchpad.net/mahara/+bug/1906123/comments/4/+download

Robert Lyon's profile picture
Posts: 757

09 November 2021, 10:05

Hi Richard,

For the problem "system() has been disabled for security reasons" you can go to the export/pdf/lib.php and comment out the lines 176-181and 185-192 that does the browser checking and just hardcode $browsertype = 'chromium-browser' or 'chrome'

As for the "exec() has been disabled for security reasons" the line that uses this is for combining the page pdf files into a collection pdf file for an exported collection so we do want that to be run. One thing you could try is changing the exec() calls on lines 298, 301 to passthru() as we are not caring about the returned response anyway.

Cheers

Robert

9 results