- 1 Introduction
- 2 System/Verification errors
- 3 Dispatch errors
- 4 Authentication errors
- 5 Enrolment errors
- 6 Portfolio errors
- 7 Repository errors
- 8 "Dangerous mode" errors
This wiki page attempts to document all the MNET error codes, what they mean, where they're called from, and what cases can trigger them. As MNET is theoretically pluggable, this does not cover all exhaustive cases, just ones that are included in the core Moodle distribution.
This is called from the main mnet xmlrpc server (mnet/xmlrpc/server.php) when $_SERVER is unset.
This is triggered when the peer used an older public key. This sends the xmlrpc server fault, with 7025 as the code, and the current public key as the text of the error message.
This is triggered if a non-encrypted request is sent, and plaintext is disallowed (plaintext can be enabled for trusted hosts within a designated subnet)
This is triggered if a request wasn't signed
This is triggered if a request was signed, but not able to be verified
This is triggered if the host record is unable to be found, based on the wwwroot inside the xmlrpc request. This can sometimes happen if you use www.mysite.com and mysite.com
This is triggered if Moodle can't decrypt the message either with the current key, or with any of the keys in the history.
This is triggered in the case that a class method has been requested, a new object has been constructed, but then the method cannot be called on the object.
Note that 7014 is also purportedly triggered with a "nosuchfunction" message in mnet_server_invoke_method, but it is in a non-executable piece of code.
This is triggered in the case that the class doesn't export a list of published mnet methods, in either the case of the requested method being static, or not.
For some reason the xmlrpc request cannot be processed. Generic failure message.
This is triggered if the function given in the xmlrpc request doesn't match the regular expression of allowed function calls (which must be of the form auth/mnet/auth.php/function_name)
This is triggered if "Networking" is disabled in Admin -> Advanced Features, or $CFG->mnet_dispatcher_mode is "off".
This is triggered if the xmlrpc request was for a system method (eg "listMethods", etc), but it wasn't in the list of allowed systemcalls. The complete list of system calls are:
This is the generic error code for the inability to find a function.
This is triggered in mnet_system() if a system method has been called, but it's not listMethods, methodSignature, methodHelp, or listServices. It looks as though listFiles or retrieveFile are not implemented, even though they are registered to mnet_system in the mnet_server_dispatch() function.
This is also triggered if mnet_permit_rpc_call returns a non-zero error code that hasn't already been trapped by one of the RPC_ constants defined in mnet/lib.php (which have their own error codes)
This is triggered if the file requested cannot be found (eg auth/mnet/lib.php instead of auth/mnet/auth.php)
This is triggered if the xmlrpc request is for a function (rather than a static method or class method), and it cannot be called (eg function_exists fails)
This happens when the function is found, but not allowed (either not published to this host, or disabled)
This happens when the class couldn't be found - probably would only happen if someone hacked code, as the mnet function installer checks this before putting rpc methods in the database.
This happens when the class is found, but cannot be constructed - an error was thrown.
This is triggered when the request was for an authentication method, but the authentication plugin requested wasn't enabled.
This is triggered when a class or static method has been requested, but the class could not be founded (eg class_exists fails). The error message should be renamed in this case.
This is triggered when there's no record in the mnet_session table for the given token and useragent.
This is triggered when there is a session, but confirmation has already timed out
This is triggered when Moodle can't find the user that the mnet session has been set up for. This is a weird error, but could possibly happen if the user was deleted between the mnet session being created, and confirmed.
This is triggered when the request was for an enrolment method, but the enrolment plugin requested wasn't enabled.
This is triggered when a user is requested to be enrolled in a course, but the user doesn't exist and an error happens trying to create their record
This is triggered when a user is requested to be enrolled in a course, but the course doesn't exist
This is triggered when a user is requested to be enrolled in a course, but the course isn't in the whitelist of available courses
This is triggered when a user is requested to be unenrolled from a course, but the user isn't found
This is triggered if role_unassign fails
This is triggered if enrol_into_course fails
This is triggered when an invalid filename is sent for a portfolio plugin. This should be changed to check that the portfolio plugin is enabled.
This is triggered when Mahara requests a portfolio file from Moodle and Moodle can't find a token in the transfer queue.
This is triggered when Mahara requests a file, the queue record is found, but the transfer information cannot be rewoken (which can happen if permissions have changed or settings have changed in the meantime, or the transfer is expired)
This is trigered if the xmlrpc request comes from a different host than the queue record has been saved against
This is triggered when Mahara requests a file, and Moodle can't find it
This is triggered when Mahara requests a file, Moodle portfolio records know which file to send, but the Files API throws an exception, or the file is empty.
This is triggered when an invalid filename is sent for a repository plugin. This should be changed to check that the repository plugin is enabled.
This is triggered when the local user is not registered in the remote Moodle site.
This is triggered when the local user cannot access to this file on the remote Moodle site.
This is triggered when no file list could be retrieved from the remote Moodle site.
"Dangerous mode" errors
This is triggered when $CFG->mnet_dispatcher_mode has been set to "dangerous", and the request is for something other than a file that ends in '.php', or the request comes from a client that isn't a trusted host