0
votes

Trying to track down this error. Once in a while a user will edit a node and something happens giving an error that looks like this:

PHP Fatal error: Maximum execution time of 30 seconds exceeded in somefilestructure/includes/database/mysql/query.inc on line 53, referer: https://abc123.com/node/25806/edit/?destination=admin/content%253Fpage%253D1

Here is the line 53 code block:

 // If we're selecting from a SelectQuery, finish building the query and
// pass it back, as any remaining options are irrelevant.
if (!empty($this->fromQuery)) {
  $insert_fields_string = $insert_fields ? ' (' . implode(', ', $insert_fields) . ') ' : ' ';
  return $comments . 'INSERT INTO {' . $this->table . '}' . $insert_fields_string . $this->fromQuery;
}

The user only has the ability to add content, upload image files and edit current content etc. Nothing crazy.

I am not looking to up my max timeout to try and work around the issue, we need to find where/how the error is caused and fix it.

If anyone has any feed back on the issue please let me know.

thanks!

1
Did you check on Drupal log and PHP error log? Maybe they can tell you what's going on there. - MilanG

1 Answers

0
votes

Normally in these situations that line 53 won't be the culprit, it's just the code that happens to be executed at the time it ran out of execution time.

There can be many reasons this happens - a module might be trying to do too much stuff when you save the node, or you have some custom bit of code that again might try to do too much processing. We had cases when using the Paragraphs module where the more paragraphs you add to a node the slower the node save would get and it could time out.

Unless you can spot something in the logs that might trigger this or can think of any modules that you have recently installed that might cause it, it is quite hard to debug and fix. If you are stuck, the best tool I have used before for performance debug is Xhprof. In most cases it becomes very clear what the culprit is. Here is an example tutorial I have followed in the past to install xhprof - http://www.pixelite.co.nz/article/profiling-drupal-7-performance-xhprof-and-devel/

But before you start setting up xhprof I would recommed looking at what code has changed recently, what modules have been installed, and maybe try uninstalling modules bit by bit until it stops timing out.