leap2a import fails

Bug #576026 reported by David King
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Richard Mansfield

Bug Description

When importing a leap2a archive the import fails with the message "A nonrecoverable error occured. This probably means you have encountered a bug in the system". In the top left of the screen is a second error message that appears to come from php directly (ie. not mahara code, not mahara style) which says "Invalid address: You must provide at least one recipient email address.". If unzipped and examined, the archive *does* contain a valid email address.

System exporting the leap2a archive:
Ubuntu 9.04
PHP 5.2.6 (Zend 2.2.0)
Mahara 1.2.4 (2009111013)
postgreSQL 8.3.10

System importing the leap2a archive:
Ubuntu 10.04
PHP 5.3.2 (Zend 2.3.0)
Mahara 1.2.4 (2009111013)
MySQL 5.0.75

Tags: leap2a
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Note: This may be caused by a similar problem to one I found when working on the bulk user import scripts -- the create_user function tried to send the new user an institution membership confirmation email *before* the user's email address was read from the import file. In that case I just used "try { create_user } catch (EmailException)...", something similar will work here if it's the same problem.

Revision history for this message
David King (davidwk) wrote :

While on the topic, would it be possible to have an option to not send the user an email at all? My work with the leap2a import is an effort to combine two Mahara servers and I don't necessarily want to bother the end user with all the details of how I'm going about it. Not a huge issue just something to think about.

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Yes, there is an option but with no web UI yet -- you just add "$cfg->sendemail = false;" in your config.php.

Revision history for this message
David King (davidwk) wrote :

I added the "$cfg->sendemail = false;" to my config.php file and that took care of the "Invalid address: You must provide at least one recipient email address." error but the leap import still failed. I've been running it through a debugger and on line 82 of /var/www/mahara/import/leap/lib.php it makes the function call "$data = $this->get('data');" which eventually throws an exception on line 80 of /var/www/mahara/import/lib.php because the field 'data' doesn't exist.

Any ideas?

Revision history for this message
David King (davidwk) wrote :

On line 308 of /var/www/mahara/admin/users/add.php the global variable $LEAP2A_FILE is used

$filename = substr($LEAP2A_FILE, strlen(get_config('dataroot')));

I've traced the call stack several times and I can't find that variable being defined anywhere. I could just be blind but from what I can make of the flow of the code, if it can't find the file, it would make sense that the 'data' field wouldn't exist.

Revision history for this message
David King (davidwk) wrote :

Never mind, I just added an echo in line to test my theory and somewhere along the line it did get defined.

tags: added: leap2a
Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → High
assignee: nobody → Richard Mansfield (richard-mansfield)
milestone: none → 1.3.0
status: Confirmed → Triaged
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

This was already fixed on master. I've applied the same fix to 1.2

Changed in mahara:
milestone: 1.3.0 → 1.2.6
status: Triaged → Fix Committed
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

David,

Sorry, I've only fixed the email problem. I haven't been able to reproduce the "field 'data' doesn't exist" one yet. Does it happen for all imports or just that particular file? If it's something in that file, could you email me a copy at <email address hidden>?

Thanks,
R.

Changed in mahara:
status: Fix Committed → Incomplete
Revision history for this message
David King (davidwk) wrote :

It fails for every file I've tried. I'll do some more testing to see if there are other specific symptoms I can isolate. Could you send me a known good file to test with?

~david

Revision history for this message
David King (davidwk) wrote :

On second thought, I've decided to wait until after we upgrade to 1.3 to do do my user migration. If no one else is affected by this bug it's probably not worth spending your time on. The imports work in 1.3beta.

~david

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Cool, I'll close it for now then; hopefully we'll get 1.3 done soon enough that we can just ask others to upgrade too.

Changed in mahara:
status: Incomplete → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
Revision history for this message
Julian Charles (jcharles) wrote :

With Mahara 1.2.6 implemented in the following environments <= PHP 5.3.2, this function bool property_exists() fails for private properties in base classes. Returning false when true.

Changing the classes privately declared properties to public resolved this issue.

Revision history for this message
François Marier (fmarier) wrote :

Hi Julian, I have opened bug #712904 to make sure that your fix makes it to the next release of Mahara.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.