XML RPC simpleXML limits payload size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Operating System: Ubuntu 14.04.1 LTS
Mahara version: 1.9.3
Database: mysql
Browser: chrome 40.0.2214.111
-------
Steps to reproduce - you need a system capable of XMLRPC communication with Mahara (e.g. Moodle)
1) With Moodle - set up mahara networking / portfolios.
2) Open a course with a forum
3) Add 2 entries. One with an attachment under 5 MB. One with an attachment over 5 MB. On Each click "Export to portfolio" in the bottom. 4) Go through the screens to start export - ask it to do it now (i.e. not wait for cron).
5) Check the Mahara site to see what made it through successfully.
-------
simpleXML may not be the best parser for XMLRPC payloads
in api/xmlrpc/lib.php
function parse_payload(
try {
$xml = new SimpleXMLElemen
return $xml;
} catch (Exception $e) {
throw new MaharaException
}
}
This means if you send a large file (in our tests greater than approx 7mb) base 64 encoded over XMLRPC it will fail to parse.
It didn't seem to make any difference if we increased the memory limit to 800M in php.ini or even by setting the php memory limit to 800M via PHP ini_set in function parse_payload - this suggests that there is a limit to what SimpleXML can handle regardless of the PHP memory limit.
Note - 932 in my source code is the 'throw new exception' following $xml = new SimpleXMLElemen
called at [/vagrant/
4: remote server error: code: , message: A nonrecoverable error occurred. This probably means you have encountered a bug in the system #0 MaharaException
description: | updated |
description: | updated |
Changed in mahara: | |
status: | Incomplete → Triaged |
milestone: | none → 1.9.5 |
tags: | added: no-behat-needed |
no longer affects: | mahara/1.8 |
Changed in mahara: | |
milestone: | 16.10.1 → 17.04.0 |
no longer affects: | mahara/16.10 |
Changed in mahara: | |
milestone: | 17.04.0 → 17.10.0 |
Changed in mahara: | |
milestone: | 17.10.0 → 18.04.0 |
Changed in mahara: | |
milestone: | 18.04.0 → 18.10.0 |
Hi Guy,
Thanks for the bug report! What version of Moodle are you using? And were there any other additional configuration steps you had to take, to be able to export a Moodle forum post with a file attachment?
I ask because I wasn't able to get any file attachment to go through from Moodle to Mahara. I tried Moodle 2.6 and 2.8, and I found that when I attached a file to a Moodle forum post, Moodle did not display the "Export to portfolio" link next to that particular post.
I also tried using the TinyMCE "image" embed button, to put a very small image into a Moodle forum post. This did show me the "Export to portfolio" link, but it gave the error "No common formats between any available portfolio plugin and the calling location forum_portfolio _caller (caller supported )". Which is apparently a different problem from what you're reporting, because this image file was much smaller than 5MB.
It's worth noting that we're in the process of replacing MNet with a new webservices system. But, the new webservices system also uses SimpleXML, so it may well face this same problem.
Cheers,
Aaron