Fatal error: Maximum execution time of 240 seconds exceeded in sites/all/modules/memcache/memcache.inc on line 353

I am using multidomain site .
After adding a new domain record, I was asked as follows: Content access permission needs to be rebuilt on this page.

When I clicked on Rebuild Permissions button, the progress bar started the batch operation of rebuilding but in the midway it stopped and gave an error given below

Rebuilding Content Access Permissions

An error has occurred. Please continue to the error page An HTTP error 0 occurred. /index.php?q=batch&id=433&op=do

I then searched an found an issue similar to the above in the link given below

https://www.drupal.org/node/399572 

I found many solutions from above like :

  1. Run rebuild permission via cron (did not try)
  2. change theme and move to older jquery version (did not try as its live site) I checked the settings for jquery update and had “minified” instead of “none”, once set to the correct setting, it worked within seconds.

I was using jQuery update module with jQuery 1.4. This causes the batch to not update.

  1. (did not try) To fix it, you have to prevent newer jQuery from loading when the URI contains “batch”.

    <?php function node_access_rebuild($batch_mode = FALSE) {   db_query("DELETE FROM {node_access}");   // Only recalculate if the site is using a node_access module.   if (count(module_implements('node_grants'))) { //      if ($batch_mode) {       if (FALSE) {       $batch = array(         'title' => t('Rebuilding content access permissions'),         'operations' => array(           array('_node_access_rebuild_batch_operation', array()),         ),         'finished' => '_node_access_rebuild_batch_finished'       );       batch_set($batch);     } ?> 

    Not sure why this is happening to me, but I’ve found that I can just force node_access_rebuild() to not use batch mode by changing line 2314 of node.module from:

  2. In node.module this piece of code, is setting time limit to 240 secs which might be still low than ur php.ini. You can try increasing set_time_limit arg to 1000 and then changing it back to 240 to keep code consistent.

     if (!ini_get('safe_mode')) {         set_time_limit(240);       }       $result = db_query("SELECT nid FROM {node}");       while ($node = db_fetch_object($result)) {         $loaded_node = node_load($node->nid, NULL, TRUE);         // To preserve database integrity, only aquire grants if the node         // loads successfully.         if (!empty($loaded_node)) {           node_access_acquire_grants($loaded_node);         }       }     }   } 

What I tried was increased the max_execution_time from 30 to 1000? But still it did not solve the problem Then finally I tried rebuilding permissions via drush

using drush command

drush php-eval 'node_access_rebuild();' 

But that gave me the following error as shown below

PHP Fatal error:  Maximum execution time of 240 seconds exceeded in  sites/all/modules/me                                                                                     mcache/memcache.inc on line 353 

Does the above error means this is something to with memcache and will it be worth trying to disable the memcache and then perform rebuilding node access?

http://example.com/index.php?q=admin/content/node-settings/rebuild

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Fatal error: Maximum execution time of 240 seconds exceeded in sites/all/modules/memcache/memcache.inc on line 353

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.