Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

MNet Errors: Difference between revisions

From MoodleDocs
No edit summary
Line 36: Line 36:


== Dispatch errors ==
== Dispatch errors ==


=== 713, "nosuchfunction" ===
=== 713, "nosuchfunction" ===


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 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)


=== 704, "nosuchservice" ===
=== 704, "nosuchservice" ===
Line 58: Line 56:
* retrieveFile
* retrieveFile
* keyswap
* keyswap
=== 7012, "nosuchfunction" ===
This is the generic error code for the inability to find a function.
=== 7019, "nosuchfunction" ===
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)


== Authentication errors ==
== Authentication errors ==
Line 66: Line 74:


== Enrolment errors ==
== Enrolment errors ==
=== 703, "nosuchfunction" ===
This is triggered when the request was for an enrolment method, but the enrolment plugin requested wasn't enabled.


== Portfolio errors ==
== Portfolio errors ==
=== 7012, "nosuchfunction" ===
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.


== Repository errors ==
== Repository errors ==
=== 7012, "nosuchfunction" ===
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.
== "Dangerous mode" errors ==
=== 7012, "nosuchfunction" ===
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

Revision as of 03:13, 11 January 2010

Introduction

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.

System/Verification errors

712, "phperror"

This is called from the main mnet xmlrpc server (mnet/xmlrpc/server.php) when $_SERVER is unset.

7025

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.

7021, "forbidden-transport"

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)

711, "verifysignature-error"

This is triggered if a request wasn't signed

710, "verifysignature-invalid"

This is triggered if a request was signed, but not able to be verified

7020, "wrong-wwwroot"

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

7023, "encryption-invalid"

This is triggered if Moodle can't decrypt the message either with the current key, or with any of the keys in the history.


Dispatch errors

713, "nosuchfunction"

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)

704, "nosuchservice"

This is triggered if "Networking" is disabled in Admin -> Advanced Features, or $CFG->mnet_dispatcher_mode is "off".

7018, "nosuchfunction"

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:

  • listMethods
  • methodSignature
  • methodHelp
  • listServices
  • listFiles
  • retrieveFile
  • keyswap

7012, "nosuchfunction"

This is the generic error code for the inability to find a function.

7019, "nosuchfunction"

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)

Authentication errors

702, "nosuchfunction"

This is triggered when the request was for an authentication method, but the authentication plugin requested wasn't enabled.

Enrolment errors

703, "nosuchfunction"

This is triggered when the request was for an enrolment method, but the enrolment plugin requested wasn't enabled.

Portfolio errors

7012, "nosuchfunction"

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.

Repository errors

7012, "nosuchfunction"

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.


"Dangerous mode" errors

7012, "nosuchfunction"

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