Forums | Mahara Community

Support /
Mahoodle Issue with first time log on

Mike Korn's profile picture
Posts: 51

12 November 2010, 1:46

Hello All,

A new and annoying issue has come up at my school and I am hping someone can help. Recently, when a brand new user to Mahara logs in through Moodle - there is a major delay before Mahara actually kicks in. For existing users there is no delay at all.

If a user gets impatient and clicks on the link to Mahara multiple times, multiple instances of that user are created in Mahara.

Everything is fine if the user just waits until they get to Mahara.

This is a new issue and I have no idea why it is happening now. We are running 1.3.1 on an Ubuntu 10.1 64 bit server, Browsers are Firefox and Chrome.

Any advice would be much appreciated.


Mike Korn's profile picture
Posts: 51

17 November 2010, 1:17

Hello all again,

I am nervous that there was no response to this. I am still experiencing the same problem. Really starting to fear that this whole Mahara experiment might fall on it's face at my school. Does anybody have any ideas? Really getting desperate.

Cannot figure out why, but it's only happening to new users. I am starting to think that unlinking Mahara and Moodle might be the best option.

Additonally, how can I completely remove deleted users from the database? When I delete accounts and try to start over - I can't because it says a deleted user has the same authentication information.

Please help.

Mike Korn's profile picture
Posts: 51

18 November 2010, 3:47

Does anybody know if regenerating public keys for both Moodle and Mahara could be an option? Any potential problems?

Any help would be much appreciated.

Iñaki Arenaza's profile picture
Posts: 253

18 November 2010, 4:35

I don't think the public keys are the problem. Otherwise nobody would be able to SSO in from your Moodle site (all the transactions use the same keys, whether they are for new or existing users).

Right now I don't know where the problem is, but given that it only happens for new users, that's a good clue. I'll have a look at the code (both in Mahara and Moodle, as the problem could be in either of them) and see if anything stands out. 

Which Mahara and Moodle versions are you using (values from version.php would best, as that would allow me to check the exact same versions you are using).


Mike Korn's profile picture
Posts: 51

18 November 2010, 5:04

Thank you so much Iñaki,

I am using Moodle 1.9.7 and Mahara 1.3.0. Ubuntu 64 bit 10.1 bit servers.

I will try what you suggested in MySql when I get back to my office.

Thanks so much again,


Iñaki Arenaza's profile picture
Posts: 253

18 November 2010, 7:24

What's the version number in version.php for your Moodle site? (just to make sure I use the same version you do, and not some 1.9.7+ with something fixed)


Iñaki Arenaza's profile picture
Posts: 253

29 November 2010, 16:32

Hi again Mike,

I've had a look at the Moodle code, and it always execute the same code for both new and existing Mahara users.

So the difference has to be in Mahara code (which does different things for existing or new users). In order to narrow the code that makes the difference, you would need to patch it to add some "profiling" sentences.

This way, we would be able to measure the time it takes for different sections of the code to complete and find where the bottleneck is.


Iñaki Arenaza's profile picture
Posts: 253

18 November 2010, 4:29

To remove deleted users from the database you should remove she/he from the following tables (the user might not appear on all of them; in fact, if the user is deleted, most of them will not reference the user at all). This is list valid for Mahara 1.3 (earlier versions might not have all of them).

The first table holds the user itself, the rest hold a reference to the user (via his/her user id). So you should remove the user from the refrencing tables first, from the usr table last:

  • usr
  • usr_institution
  • usr_institution_request
  • usr_session
  • auth_remote_user
  • sso_session
  • group_member
  • group_member_invite
  • artefact
  • artefact_access_usr
  • access_log
  • interaction_instance
  • usr_account_preference
  • usr_activity_preference
  • usr_friend
  • usr_friend_request
  • usr_infected_upload
  • usr_password_request
  • view
  • view_access
  • site_content
  • usr_watchlist_view
  • import_queue
  • collection


Mike Korn's profile picture
Posts: 51

19 November 2010, 0:04

Thank you for your advice. I started from the bottom of the list and all was well until I got to interaction_instance.

tried this - DELETE FROM interaction_instance where creator ='358' as 358 is the user id i want to delete and got this message:

Cannot delete or update a parent row: a foreign key constarint fails

Removed all instances form the tables below that one but still no luck.

Don't know why it is so difficult to delete users from Mahara :(


Ruslan Kabalin's profile picture
Posts: 146

22 November 2010, 5:14

Hello Mike,

I desperately tried to replicate what you say. I have no problem with multiple link clicks in Moodle before Mahara page will appear, only one user is created in Mahara. When I delete user using standard Mahara functionality (Delete button) without tampering with database, I am still able to login from Moodle again (new user is created).

It looks like there something with your settings, in either Moodle or Mahara, or you encountered an interesting bug .

Make sure that in institution authentication settings in Mahara, you have all three "They SSO IN", "We auto-create users", "Update user info on login" are ticked off. In Moodle (Networking->Peers, in Services tab "SSO(identity provider)" should be set to "Publish" only and "SSO (Service Provider)" should be set to "Subscribe" only, nothing else apart of these two settings should be ticked on this page). Though, this manual is a bit outdated (interface may look different), it is still valid for proper Moodle-Mahara inegration setting.

You should not normally interfere in the database, it is not the proper way to delete users as with deleting all dependant records you may break integrity of other things where user was involved, say if user posted something in the forum and someone replied to that post, you will have have to delete all replies (that was likely done by other users) and the actual post prior to be able to delete user. Deletion of user using Mahara interface should not prevent registering user with the same name/email as it normally renames these fields. What worries me, is that you say it is not the case in your environment, so it definitely should be investigated and I would be great if you fill in the bug report having expalined what steps you have done prior the problem pops up and what moodle-mahara networking-related settings you use in both moodle and mahara.

11 results