Forums | Mahara Community

Support /
Issues with leap2a export and import


10 April 2021, 3:18

Hello,

I'm hoping for some input as regards solving issues with content exporting/importing.

Firstly, I'll just note that I currently have pdf export disabled. Initially exports were not completing at all due to unmet dependencies for the pdf export to work, but that's an issue with the webhost that I'll address separately.

Once pdf exporting was disabled, the export process completed and completed quickly, with all artefact files being successfully added to the zip. HTML exports, when opened, were about as good as I'd expect them to be: i.e. glitchy with particular widgets but working ok overall. Sadly, leap2a presents two significant issues:

1. If a user:

(a) Chooses to export all their content or more than one page in a single export operation, or if they (b) launch export requests for two pages in direct sucession (so they are both picked up by the same cron cycle) then no leap2a.xml file is produced, rather, an empty folder is produced with that name. Error output is:

[09-Apr-2021 12:48:02 Europe/London] [INF] 72 (lib/cron.php:190) Running core cron export_process_queue
[09-Apr-2021 12:48:37 Europe/London] [WAR] 72 (export/lib.php:943) scandir(/home/fffcfddf/maharadata/export/2/1617968882/leap2a.xml/): failed to open dir: No such file or directory
[09-Apr-2021 12:48:37 Europe/London] Call stack (most recent first):
[09-Apr-2021 12:48:37 Europe/London]   * log_message(string(size 113), integer, true, true, string(size 41), integer) at /home/fffcfddf/public_html/lib/errors.php:521
[09-Apr-2021 12:48:37 Europe/London]   * error(integer, string(size 113), string(size 41), integer, array(size 8)) at Unknown:0
[09-Apr-2021 12:48:37 Europe/London]   * scandir(string(size 57)) at /home/fffcfddf/public_html/export/lib.php:943
[09-Apr-2021 12:48:37 Europe/London]   * create_zip_archive(string(size 46), string(size 86), array(size 1)) at /home/fffcfddf/public_html/export/lib.php:1036
[09-Apr-2021 12:48:37 Europe/London]   * PluginExportAll->export(false) at /home/fffcfddf/public_html/export/lib.php:704
[09-Apr-2021 12:48:37 Europe/London]   * export_process_queue() at /home/fffcfddf/public_html/lib/cron.php:198
[09-Apr-2021 12:48:37 Europe/London] 
[09-Apr-2021 12:48:37 Europe/London] [WAR] 72 (export/lib.php:943) scandir(): (errno 2): No such file or directory
[09-Apr-2021 12:48:37 Europe/London] Call stack (most recent first):
[09-Apr-2021 12:48:37 Europe/London]   * log_message(string(size 47), integer, true, true, string(size 41), integer) at /home/fffcfddf/public_html/lib/errors.php:521
[09-Apr-2021 12:48:37 Europe/London]   * error(integer, string(size 47), string(size 41), integer, array(size 8)) at Unknown:0
[09-Apr-2021 12:48:37 Europe/London]   * scandir(string(size 57)) at /home/fffcfddf/public_html/export/lib.php:943
[09-Apr-2021 12:48:37 Europe/London]   * create_zip_archive(string(size 46), string(size 86), array(size 1)) at /home/fffcfddf/public_html/export/lib.php:1036
[09-Apr-2021 12:48:37 Europe/London]   * PluginExportAll->export(false) at /home/fffcfddf/public_html/export/lib.php:704
[09-Apr-2021 12:48:37 Europe/London]   * export_process_queue() at /home/fffcfddf/public_html/lib/cron.php:198
[09-Apr-2021 12:48:37 Europe/London] 
[09-Apr-2021 12:48:37 Europe/London] [WAR] 72 (export/lib.php:943) array_diff(): Expected parameter 1 to be an array, bool given
[09-Apr-2021 12:48:37 Europe/London] Call stack (most recent first):
[09-Apr-2021 12:48:37 Europe/London]   * log_message(string(size 61), integer, true, true, string(size 41), integer) at /home/fffcfddf/public_html/lib/errors.php:521
[09-Apr-2021 12:48:37 Europe/London]   * error(integer, string(size 61), string(size 41), integer, array(size 8)) at Unknown:0
[09-Apr-2021 12:48:37 Europe/London]   * array_diff(false, array(size 2)) at /home/fffcfddf/public_html/export/lib.php:943
[09-Apr-2021 12:48:37 Europe/London]   * create_zip_archive(string(size 46), string(size 86), array(size 1)) at /home/fffcfddf/public_html/export/lib.php:1036
[09-Apr-2021 12:48:37 Europe/London]   * PluginExportAll->export(false) at /home/fffcfddf/public_html/export/lib.php:704
[09-Apr-2021 12:48:37 Europe/London]   * export_process_queue() at /home/fffcfddf/public_html/lib/cron.php:198
[09-Apr-2021 12:48:37 Europe/London] 
[09-Apr-2021 12:48:37 Europe/London] [WAR] 72 (export/lib.php:944) count(): Parameter must be an array or an object that implements Countable
[09-Apr-2021 12:48:37 Europe/London] Call stack (most recent first):
[09-Apr-2021 12:48:37 Europe/London]   * log_message(string(size 74), integer, true, true, string(size 41), integer) at /home/fffcfddf/public_html/lib/errors.php:521
[09-Apr-2021 12:48:37 Europe/London]   * error(integer, string(size 74), string(size 41), integer, array(size 8)) at /home/fffcfddf/public_html/export/lib.php:944
[09-Apr-2021 12:48:37 Europe/London]   * create_zip_archive(string(size 46), string(size 86), null) at /home/fffcfddf/public_html/export/lib.php:1036
[09-Apr-2021 12:48:37 Europe/London]   * PluginExportAll->export(false) at /home/fffcfddf/public_html/export/lib.php:704
[09-Apr-2021 12:48:37 Europe/London]   * export_process_queue() at /home/fffcfddf/public_html/lib/cron.php:198
[09-Apr-2021 12:48:37 Europe/London] 
[09-Apr-2021 12:48:37 Europe/London] [WAR] 72 (export/lib.php:947) Invalid argument supplied for foreach()
[09-Apr-2021 12:48:37 Europe/London] Call stack (most recent first):
[09-Apr-2021 12:48:37 Europe/London]   * log_message(string(size 39), integer, true, true, string(size 41), integer) at /home/fffcfddf/public_html/lib/errors.php:521
[09-Apr-2021 12:48:37 Europe/London]   * error(integer, string(size 39), string(size 41), integer, array(size 8)) at /home/fffcfddf/public_html/export/lib.php:947
[09-Apr-2021 12:48:37 Europe/London]   * create_zip_archive(string(size 46), string(size 86), null) at /home/fffcfddf/public_html/export/lib.php:1036
[09-Apr-2021 12:48:37 Europe/London]   * PluginExportAll->export(false) at /home/fffcfddf/public_html/export/lib.php:704
[09-Apr-2021 12:48:37 Europe/London]   * export_process_queue() at /home/fffcfddf/public_html/lib/cron.php:198
[09-Apr-2021 12:48:37 Europe/London]

2. When a user exports a single page, a leap2a.xml is successfully created, and the relevant files are exported to export_info/files, however, when one attempts to import that page, all files show in the import interface as having a size of 0 bytes, and none are imported, although the xml itself parses fine and accurately reproduces the page structure. A timestamped import folder is created in the file manager, but this is either empty, or may contain at the most a single empty but accurately named subfolder (in tests so far).

Uploading the files manually, taking care to reproduce the structure of the source page so far as the file manager goes, does not solve the issue. There are no errors logged.

--

I'm curious if anyone else has encountered these issues or can shed light on possible causes.

We are running Mahara 20.04 on a shared host. For better or worse the hosting provider has spun their own distro so I can tell you little other than the OS is Linux, judging by the uname output ( 3.10.0-962.3.2.lve1.5.35.el7.x86_64 ) it may be a spin of cloudlinux.

I have tried disabling modsecurity, as modsec rules have occassionally caused us issues with uploading content in the past, but this has had no effect.

Thanks,

Chris

Bei Chapman's profile picture
Posts: 8

10 April 2021, 6:34

Hi Chris,

I ran into a very similar issue of leap2a export/import as yours in my Mahara 20.10, and the solution posted in the bug tracker link below worked for me perfectly.

https://bugs.launchpad.net/mahara/+bug/1912705

Give it a shot.

Cheers,

Bei

11 April 2021, 23:38

Hi Bei,

Thanks for the suggestion. Unfortunately, declaring that variable as global has no impact on the issues described.

What has come to light, simply as a result of doing a lot of test exports, is that the creation of an empty folder called leap2a.xml - as opposed to a file of that name - is not specific to cases where multiple or all pages are exported, rather it is an intermittent bug (... everyone's favourite kind of bug I'm sure ...) that can occur with any kind of export.

The import bug is completely consistent in behavior and frankly more concerning: the xml looks well formed to me so far as paths to content to be imported goes, so I suspect the issue is with how that is parsed. My php skills are pretty basic but I'll update with whatever I find.

In the meantime, further community input would be welcomed.

All the best,


Chris

Robert Lyon's profile picture
Posts: 749

14 April 2021, 12:56

Hi Chris,

I'm wondering if your issue is related to https://bugs.launchpad.net/mahara/+bug/1900786

Where a full export was causing problems if the HTML part and Leap2A part were made one second apart?

I believe it was creating the folder named 'leap2a.xml' because it couldn't find the actual folder with info as the folder path is based on a timestamp and it was 1 second out

Can you try the fix for that to see if it makes a difference?

Cheers

Robert

27 July 2021, 2:56

Hi Robert,

I did make those changes, with no result. However, I have since upgraded Mahara to the current version which has indeed solved the issue.

That said, I wonder if I'm completely missing some sort of "trick" with the leap2a process. Both on our install, and on the Mahara test site, when I try to import what I have exported, the size of all files (assets) is shown as zero, and none of the assets are imported into the new page. Put another way: all the structure is present and correct, but none of the content! if - and only if - that content was/is stored on the mahara server (externally stored content is present).

Have you (or anyone else) seen this behavior before?

Absolutely nothing shows up in any of the error_log files.

All the best,

Chris

Doris ⚡'s profile picture
Posts: 81

01 September 2021, 16:27

Hey Chris,

Importing the exported.zip rather than the Leap2A file itself will import all the artefacts.

 

Kind regards,

Doris

6 results