I have a View that returns a complete list of all my site's users and their data. That being said, I have 1000 users. If my view returns 500/page, I'm able to view it successfully. However, if I want all of my user data displayed on one page (ie. no pager), Views throws me an AJAX error that reads:

An AJAX error occurred. HTTP result code 500. Status Text: Internal Server Error.

Why is this happening? How can I make it so that all data can be displayed on one View page without this error occurring?

  • 2
    HTTP 500 is a generic server error. That alone cannot tell us what caused it (could be code, or Drupal trying to render bad data, or if some template tried to render something null or undefined). You'll have to enable error reporting to find the specific exception and where in code this is happening. – Joseph Sep 24 '19 at 23:41
  • So out of curiosity, "too much data" could not be a reason that this is occurring, correct? It's more likely bad data / template issue than anything? @Joseph – Brittany Sep 24 '19 at 23:44
  • It could also be the database not responding in time, whose API could return bad data or throw an exception - which can also cause an HTTP 500. – Joseph Sep 24 '19 at 23:46
  • I have a sneaking suspicion that's it, @Joseph. If i do some digging and discover that's the case, how would I go about fixing it? – Brittany Sep 24 '19 at 23:54
  • 2
    You can enable all errors during development. By default, Drupal will show the "White Screen Of Death" (WSOD) or some generic error message to hide errors specifics from the public. Showing all errors will cause Drupal to print out the errors and stack trace. If it's an AJAX request, you may need to inspect the response via the Network tab. Normally, Drupal prints AJAX errors in an alert box which isn't nice for debugging long stack traces. – Joseph Sep 25 '19 at 1:08

Found the fix (finally - at least in my case). Generating the View was exceeding the memory limit. I simply increased the allowed memory limit in my settings.php file by adding the following line to it:

ini_set('memory_limit', '512M');

Not the answer you're looking for? Browse other questions tagged or ask your own question.