PHP Fatal Error with many items in view

Created on 31 December 2022, almost 2 years ago
Updated 1 September 2023, over 1 year ago

Problem/Motivation

Hi,

When I was still using Drupal 8.9, I used to have a view with 5000+ commerce products and product variations. I upgraded to Drupal 9.5.0, and this view is now broken : I can't use a table with aggregation unless I use a filter to reduce the number of items in the table in the first place.

When I change the display, it loads for a long time but the preview doesn't change, when I save the view, the preview disappears. If I try to load the page of the view, I get a 500 error.

Here is the error log on my server :

Backend fatal error: PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/pmsz0305/dev/core/lib/Drupal/Core/Session/SessionHandler.php:79\nStack trace:\n#0 /home/pmsz0305/dev/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php(95): Drupal\\Core\\Session\\SessionHandler->write()\n#1 /home/pmsz0305/dev/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php(73): Drupal\\Core\\Session\\WriteSafeSessionHandler->write()\n#2 [internal function]: Symfony\\Component\\HttpFoundation\\Session\\Storage\\Proxy\\SessionHandlerProxy->write()\n#3 [internal function]: session_write_close()\n#4 {main}\n thrown in /home/pmsz0305/dev/core/lib/Drupal/Core/Session/SessionHandler.php on line 79\n, referer: https://www.dev.sega-mag.com/admin/structure/views/view/essai_aggregator

🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇫🇷France shenron_segamag

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I've possibly got the same issue. I've got a content type with 16K nodes. I run into problems when I try to aggregate this using View Aggregator Plus. I get a 'failed to load resource : the server responded with a status of 500' error.

    Its easiest to describe if I start from what happens if I aggregate using Drupal's core views module.
    - Structure > Views > Add View
    - Content of type My16KNodes
    - Create a page
    - Display format Table of Fields
    - Items to display 100 <------------ the key field for this issue
    - Then create my aggregated view on the Structure > Views > Title / Format / Fields page
    The Items to Display controls the number of rows in the display of the aggregated view. I can aggregate 16K nodes, as long as the number of grouped rows in the resulting view doesn't exceed 100 (items to display).

    Then I try to do exactly the same with Views Aggregator Plus, except that the Display Format is obviously a Table with aggregation options. VAP doesn't use the Items To Display (in my example set to 100) to control the number of rows in the output. Instead VAP uses the Items To Display to control the number of nodes that it accepts as inputs. VAP successfully takes the first 100 nodes of type My16KNodes, and aggregates those.

    Put simply - Structure > Views > Add View > Items to display:
    - on core aggregated Views, limits the rows output;
    - on Views Aggregator Plus, limits the number of nodes input.

    Because I want to use Views Aggregator Plus to display aggregated data describing my 16K nodes, I try the obvious thing and increase the Items To Display to 17000. For both VAP and core Views this results in an Ajax error ('failed to load resource : the server responded with a status of 500'). The maximum value for Items To Display that I can input without getting this error seems to be about 4000. Sometimes 4000 triggers the error, sometimes it doesn't.

    For core aggregated Views limiting the output to less than 4000 rows doesn't seem like much of a constraint, but for VAP limiting the input to less than 4000 nodes is a big constraint (for me anyway). VAP is a great tool. It offers features that I'd really like to use. But I need a way to be able to get it to display the results of aggregating 16K+ nodes.

Production build 0.71.5 2024