Forums | Mahara Community

Support /
Is Mahara 1.7 'too old' for Moodle 2.7? (Failed to get a recordset: mysql error)


anonymous profile picture
Account deleted
Posts: 22

22 November 2014, 3:02

Hi all. We are currently using Moodle 2.7 alongside Mahara 1.7, with users roaming from Moodle to Mahara via MNET. We tend to keep on top of the six-monthly Moodle releases, but we've been a little lax upgrading Mahara.

It has been brought to my attention today that new users cannot access Mahara. I can log in fine, but the new account creation seems to be failing, but not completely. A quick check of the Mahara server's Apache logs shows the following (sanitised):

[WAR] aa (lib/errors.php:749) Failed to get a recordset: mysql error: [1452: Cannot add or update a child row: a foreign key constraint fails ("mahara"."event_log", CONSTRAINT "evenlog_usr_fk" FOREIGN KEY ("usr") REFERENCES "usr" ("id"))] in adodb_throw(INSERT INTO "event_log" ("usr", "realusr", "event", "data", "time") VALUES (0, 0, 'saveartefact', '{"dirty":true,"parentdirty":null,"deleted":false,"id":18349,"artefacttype":"email","owner":2658,"container":null,"parent":null,"ctime":1416566802,"mtime":1416566802,"atime":1416566802,"locked":null,"title":"user@domain","description":null,"note":null,"tags":[],"institution":null,"group":null,"author":2658,"authorname":null,"allowcomments":null,"approvecomments":null,"rolepermissions":null,"mtimemanuallyset":null,"license":null,"licensor":null,"licensorurl":null,"viewsinstances":null,"viewsmetadata":null,"childreninstances":null,"childrenmetadata":null,"parentinstance":null,"parentmetadata":null}', '2014-11-21 10:46:42'), ), referer: http://moodle.domain/my/
[WAR] aa (lib/errors.php:749) Command was: INSERT INTO "event_log" ("usr", "realusr", "event", "data", "time") VALUES (?, ?, ?, ?, ?) and values was (0,0,saveartefact,{"dirty":true,"parentdirty":null,"deleted":false,"id":18349,"artefacttype":"email","owner":2658,"container":null,"parent":null,"ctime":1416566802,"mtime":1416566802,"atime":1416566802,"locked":null,"title":"user@domain","description":null,"note":null,"tags":[],"institution":null,"group":null,"author":2658,"authorname":null,"allowcomments":null,"approvecomments":null,"rolepermissions":null,"mtimemanuallyset":null,"license":null,"licensor":null,"licensorurl":null,"viewsinstances":null,"viewsmetadata":null,"childreninstances":null,"childrenmetadata":null,"parentinstance":null,"parentmetadata":null},2014-11-21 10:46:42), referer: http://moodle.domain/my/
Call stack (most recent first):, referer: http://moodle.domain/my/
* log_message("Failed to get a recordset: mysql error: [1452: Can...", 8, true, true) at /srv/mahara/htdocs/lib/errors.php:109, referer: http://moodle.domain/my/
* log_warn("Failed to get a recordset: mysql error: [1452: Can...") at /srv/mahara/htdocs/lib/errors.php:749, referer: http://moodle.domain/my/
* SQLException->__construct("Failed to get a recordset: mysql error: [1452: Can...") at /srv/mahara/htdocs/lib/dml.php:1068, referer: http://moodle.domain/my/
* insert_record("event_log", object(stdClass)) at /srv/mahara/htdocs/lib/mahara.php:1470, referer: http://moodle.domain/my/
* handle_event("saveartefact", object(ArtefactTypeEmail)) at /srv/mahara/htdocs/artefact/lib.php:450, referer: http://moodle.domain/my/
* ArtefactType->commit() at /srv/mahara/htdocs/artefact/internal/lib.php:576, referer: http://moodle.domain/my/
* ArtefactTypeEmail->commit() at /srv/mahara/htdocs/lib/user.php:423, referer: http://moodle.domain/my/
* set_profile_field(2658, "email", "user@domain") at /srv/mahara/htdocs/lib/user.php:2151, referer: http://moodle.domain/my/
* create_user(object(User), array(size 0), "sdc", object(AuthXmlrpc), "user@domain") at /srv/mahara/htdocs/auth/xmlrpc/lib.php:219, referer: http://moodle.domain/my/
* AuthXmlrpc->request_user_authorise("5a0ee9d5a3b0da8ed1d1973d9cae205b21ad60a9", "http://moodle.domain") at /srv/mahara/htdocs/auth/xmlrpc/land.php:94, referer: http://moodle.domain/my/

In addition to this, the usr table is showing multiple entries for some users (those who have repeatedly tried to log in) thus the usernames look like:

user@domain
user@domain1
user@domain2
...
user@domain38
user@domain39

I think it's probably the multiple entries in the usr table which are causing the foreign key constraint fails, above, but for some reason the new accounts aren't being created properly. Not having hacked Mahara much, I really don't know my way around its innards.

I did investiagte from Moodle's side and found an issue which confused me a little (and made me think of the statement in the title of this post). I went to Moodle -> Site Admin -> Networking -> Remote enrolments client, and then clicked on Edit Enrolments, which gave the following error in Moodle:

mnetservice_enrol/fetchingcourses
Debug info: mnet_xmlrpc_client request returned errors:
4: remote server error: code: , message: A nonrecoverable error occurred. This probably means you have encountered a bug in the system
Error code: fetchingcourses
$a contents:
Stack trace:
line 463 of /lib/setuplib.php: moodle_exception thrown
line 62 of /mnet/service/enrol/host.php: call to print_error()

...and in Mahara's Apache error logs:

[WAR] f4 (api/xmlrpc/dispatcher.php:200) No such method: enrol/mnet/enrol.php/available_courses
Call stack (most recent first):
* Dispatcher->__construct("<?xml version="1.0" encoding="utf-8"?>
<methodCall...", true, true) at /srv/mahara/htdocs/api/xmlrpc/server.php:142

It's the 'no such method' error that suggests our Mahara may be too old for our Moodle (or Moodle is too new for our Mahara!).

If anyone has any ideas about what might be causing this (or what to look at to get more info), I'd be very gradeful.

Paul.

Kristina Hoeppner's profile picture
Posts: 4863

24 November 2014, 9:09

Hello Paul,

Mahara 1.7 should work with Moodle 2.7, but we don't support Mahara 1.7 anymore. However, not much has changed in the MNet code for some time.

Do you get the same issues on your testing instance? I would retrace all the setup steps using https://wiki.mahara.org/images/7/75/Mahoodle-updated-en.pdf as a guide and make sure that both Moodle and Mahara are set up correctly. Also check in Mahara that the institution where you want to let your users in is not restricted to a maximum number of users. It doesn't sound like it would be as new user accounts seem to be created, but nevertheless, double checking would be good.

You don't have to click the enrolment option. That doesn't work with Mahara to my knowledge unless you may have some custom plugins developed that work with it.

What do your users look like on the Mahara end? If you go to Administration -> Users -> Click the checkbox next to your users (select more than 10 though) and then click the "Get reports" button, you'll get a table that includes username and also the remoteuser. The latter is the username from Moodle. If that is not transmitted correctly, Mahara will not be able to match an internal Mahara username to a Moodle account. Normally, when you have users create accounts with MNet, that remoteuser is set, but something seems to be going wrong there. Doublechecking your setup on both Moodle and Mahara may help narrow down the problem.

Cheers

Kristina

 

anonymous profile picture
Account deleted
Posts: 22

02 December 2014, 0:32

Hi Kristina, thanks for your reply. 

When I looked at the report you suggested, I am seeing a lot of users with no institution, who also have no remote username.  (My gut feeling is that there is no institution as the system fails before assigning the user to an institution, but I can't prove this.) An example (sanitised):

[email protected] [email protected] Dxx Nxxxxx 30 November 2014, 7:29 PM

[email protected] [email protected] Dxx Nxxxxx 30 November 2014, 7:31 PM

So the user joins the site at 7.29pm and for some reason gets the 'unrecoverable error' error. A couple of minutes later they try to log in again and get the same problem but Mahara seems to recognise an existing user with that username and makes a new account, but then also fails.

The institution they should be joining has unlimited membership.

 

I am working my way through the guide you linked to (thank you) and will report back soon.

anonymous profile picture
Account deleted
Posts: 22

02 December 2014, 1:00

I'd like to see what Moodle returns when Mahara requests a user's details.  is there a URL I can create which queries Moodle's API and returns the XML which Mahara uses? It would be a good step towards attempting to debug this.

Oddly, and as an aside, everything was working fine until the morning of the 21st October 2014: someone joined at 9.30am without problems, but the user after this (who joined at 11.10 on the same day) and every user since then has not been able to get in correctly.

Kristina Hoeppner's profile picture
Posts: 4863

04 December 2014, 22:00

Hello Paul,

That is odd indeed that everything worked and then stopped working. Did you apply any Moodle or Mahara updates on that day or made any other sort of changes on the server or the applications?

Cheers

Kristina

 

anonymous profile picture
Account deleted
Posts: 22

04 December 2014, 23:27

Hi Kristina, thanks for your reply.

We've not updated Moodle since August 2014 (to roll out updates to Moodle 2.7) and we haven't updated Mahara since early 2013. The servers get updated and upgraded regularly (and rebooted where required) but this hasn't happened since August either. We tend to leave things be unless otherwise required.  

I've updated Mahara to the latest 1.7 stable branch to no effect, and when I attempted to upgrade to 1.10 the process failed with foreign key constraint errors.

I am at a complete loss to explain what's going on here.

Mahara is increasingly used, but not well used here, so I feel my only option is to build a new server and start afresh with 1.10

anonymous profile picture
Account deleted
Posts: 22

04 December 2014, 23:41

Have just tried the experimental bulk export feature and that has failed with multiple stack traces and a SQL error: 

[WAR] df (artefact/internal/lib.php:209) Undefined index: 53, referer: http://domain.com/admin/users/bulkexport.php
Call stack (most recent first):
* log_message("Undefined index: 53", 8, true, true, "/mahara/htdocs/artefac...", 209) at /mahara/htdocs/lib/errors.php:455
* error(8, "Undefined index: 53", "/mahara/htdocs/artefac...", 209, array(size 6)) at /mahara/htdocs/artefact/internal/lib.php:209
* PluginArtefactInternal::export_blockinstance_config_leap(object(BlockInstance)) at /mahara/htdocs/artefact/internal/blocktype/profileinfo/lib.php:275
* PluginBlocktypeProfileinfo::export_blockinstance_config_leap(object(BlockInstance)) at Unknown:0
* call_user_func_array(array(size 2), array(size 1)) at /mahara/htdocs/lib/mahara.php:1365
* call_static_method("PluginBlocktypeProfileinfo", "export_blockinstance_config_leap", object(BlockInstance)) at /mahara/htdocs/lib/view.php:2159
* View->export_config("leap") at /mahara/htdocs/export/leap/lib.php:263
* PluginExportLeap->export_views() at /mahara/htdocs/export/leap/lib.php:132
* PluginExportLeap->export() at /mahara/htdocs/admin/users/bulkdownload.php:198

[WAR] df (lib/errors.php:758) Failed to get a recordset: mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), referer: http://domain.com/admin/users/bulkexport.php
[WAR] df (lib/errors.php:758) )' at line 3] in EXECUTE("
[WAR] df (lib/errors.php:758) SELECT * FROM "collection" WHERE id IN (
[WAR] df (lib/errors.php:758) SELECT collection
[WAR] df (lib/errors.php:758) FROM "collection_view"
[WAR] df (lib/errors.php:758) WHERE view IN ()
[WAR] df (lib/errors.php:758) )")

As exporting the user's data and importing it back into a fresh Mahara instance is the only way forward I can see, the bulk export feature not working also is a pain.

Kristina Hoeppner's profile picture
Posts: 4863

08 December 2014, 9:17

Hello Paul,

The bulk export not working seems a different problem than not being able to connect to your Moodle. Does the normal export of a portfolio work?

I'm afraid I can't help with the error messages and a developer would need to take a look.

Cheers

Kristina

 

anonymous profile picture
Account deleted
Posts: 22

09 December 2014, 0:13

Hi Kristina.  Yes, exporting just my portfolio to either HTML or Leap2A format work as expected.

Cheers,

Paul.

Kristina Hoeppner's profile picture
Posts: 4863

09 December 2014, 16:49

Hello Paul,

Did you try to export your portfolio by itself via the bulk export as well? Now that we know that you can export your portfolio manually, the next step I can think of would be to see if it exports on its own via the bulk export because it could be something in a different portfolio that prevents it. A developer might see something directly from your error message, but I'm afraid that's as far as I can help you.

Cheers

Kristina

 

13 results