Bug #23237 Bug Fixed

Fatal Memory Error When Editing Member Profile

Version: 3.5.11 Reporter: phatmateo

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

The following error occurs when trying to edit a member profile as well as trying to use the login as member feature:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /MY_EE_DIR/ee/EllisLab/ExpressionEngine/Service/Model/Model.php on line 610

Using PHP 7.0.23 on Apache and my php.ini is set to 128M for the memory_limit. Setting it higher doesn’t fix the issue and only causes the bytes to increase in the error.

I also tried setting the allow_extensions to “n” and the same error occurred.

  • I’m unable to reproduce on both a local and production web site.

    • Are you able to reproduce on a fresh install?
    • Is this a new installation or an upgrade from a previous version?
    • How many members do you have, and were any accounts imported / manually created / managed by an add-on?
    Derek Jones
    26th September, 2017 at 2:30pm
  • Hi Derek,

    This is an upgrade from 2.11.1, so it’s hard for us to test it on a fresh install. We have over 44k members and use the Visitor add-on. They pointed us in your direction after I contacted them about the issue. None were imported and only 100-200 have been created manually. Everything was working fine on EE 2.11.1 on PHP 5.6 until we upgraded.

    26th September, 2017 at 2:49pm
  • Yes, in v3 member entities are managed by a model interface instead of the app directly accessing the db schema. This can reveal issues with database integrity, and sounds like you have some incomplete entities that are causing the model interface. Sometimes you can quickly spot this by seeing a different number of rows in exp_members and exp_member_data.

    For example if exp_members was lacking a matching row in exp_member_data, then running this query would reveal the incomplete records:

    SELECT *
    FROM exp_members m
    LEFT JOIN exp_member_data d ON d.member_id = m.member_id
    WHERE d.member_id IS NULL;

    If that doesn’t help you nail down the data integrity issue, just contact support and we would be happy to debug your database for you. FWIW our site has hundreds of thousands of user records, and those operations only use about 10M of memory.

    Derek Jones
    26th September, 2017 at 2:59pm
  • Unfortunately, the query didn’t show any results and I am having trouble seeing anything out of the ordinary. There are the same number of exp_members as the exp_member_data entries. Unless you have any other suggestions, I’ll have to put in a support request

    26th September, 2017 at 9:24pm
  • Yeah if you confirm that you’re on 3.5.11, that your member records all have integrity, and still get the error when extensions are disabled, then absent steps to reproduce in another installation/environment, we’d need to take a look directly and figure out what’s wrong with your installation.

    Derek Jones
    27th September, 2017 at 9:22am
  • Egg on my face! The assign to author dropdown could potentially be overpopulated with members; solution posted in the tab above. It addresses the potential memory issue; the select itself will be fixed with a comprehensive solution in the next major version (v4).

    Derek Jones
    28th September, 2017 at 12:15pm
  • In system/ee/expressionengine/controller/Members/Profile/Profile.php around line 196 alter the model call so it has a limit of 100- it will look like:

    $heirs = ee('Model')->get('Member')
              ->fields('username', 'screen_name')
              ->filter('group_id', 'IN', array(1, $this->member->MemberGroup->getId()))
              ->filter('member_id', '!=', $this->member->getId())
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases