Uploading new users via CSV gives generic error message

Bug #823048 reported by Kristina Hoeppner
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Richard Mansfield

Bug Description

When you attempt to upload a lot of users via CSV and the upload is not made, you only receive a generic error message that doesn't give you the reason why the upload failed. When a certain server limit is reached, in some cases 100 users, the upload doesn't proceed so that the process does not take up all the processing power. The admin should be made aware of that and the error message should be more specific.

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

The easy way to do this is with a config setting for the max number of csv lines. Trapping the out of memory error is super-hard I think, and probably not reliable.

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

Also, there is no real reason why this has to take heaps of memory. We should ideally make this scale.

Changed in mahara:
importance: Undecided → Medium
status: New → Triaged
tags: added: csvupload
removed: csv upload
Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
milestone: none → 1.5.0
status: Triaged → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/1043
Committed: http://gitorious.org/mahara/mahara/commit/7f231697437e70371b9ac2767eb23391612c9e2d
Submitter: Hugh Davenport (<email address hidden>)
Branch: master

commit 7f231697437e70371b9ac2767eb23391612c9e2d
Author: Richard Mansfield <email address hidden>
Date: Mon Feb 13 16:30:42 2012 +1300

    Add a maximum number of users for csv files (bug #823048)

    This allows $cfg->maxusercsvlines to be specified in config.php to
    stop admins and institutional admins from uploading large csv files.
    This is potentially useful on large multi-user sites.

    And until such time as we can reduce the amount of memory used by the
    create_user function, setting this option will provide the user with
    some feedback on csv upload failure (because we can't easily trap the
    php out-of-memory error).

    See also bug #548042.

    This commit also adds a call to set_time_limit() after processing each
    user, so that the script doesn't fail due to php's max. execution
    time.

    Change-Id: I662231288c7d0c6e70602c548123f12c63427a97
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Patrick Pollet (pp-c) wrote :

I also noticed the problem in my contrib trying to sync a Mahara institution users accounts with a LDAP server.
https://github.com/patrickpollet/mahara_ldap_sync

The call to create_user is indeed consuming a big chunk of memory that is not returned to the pool and the process dies with ~1500 new users when allocating 256Mb to PHP.

Something must be wrong somewhere in the user creation , that does indeed a lot of work and memory allocation

Cheers.

Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
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.