After the last upadate to 1.15, when I add or edit some nodes I see this error:
warning: md5() expects parameter 1 to be string, array given in /home2/madfanbo/public_html/site/sites/all/modules/boost/boost.module on line 1921.

CommentFileSizeAuthor
#6 boost-630174.patch1.18 KBmikeytown2
#1 boost-630174.patch948 bytesmikeytown2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Active » Needs review
FileSize
948 bytes

Are you using some sort of rules, some special configuration? Here's a patch that will output to the dblog when this error would normally happen.

superfedya’s picture

Maybe it is Fivestar error? /site/fivestar/vote/node/148/vote/100?token=5155179326bc93b2aafd086d6417e2d3

mikeytown2’s picture

voting api (what 5 star uses) uses the boost_expire_node() function, to do its dirty work. From there it calls boost_cache_expire_router & boost_cache_expire_derivative with a pile of paths that should be expired as well at the same time. Eventually boost_cache_expire_derivative calls boost_cache_expire_router once it has looked up the content type in the database. boost_cache_expire_router looks up the filename, hash & base_dir via the database. The error you got could only be generated if the hash is missing and I'm assuming the database is up to date so you should have all your hashes. boost_cache_expire_router is not causing the issue in your case.

Next suspect... boost_cache_expire_derivative
If boost_cache_expire_router didn't find anything to kill, then it will also try to expire the file via filename. Which leaves boost_cache_flush_by_filename as the suspect function.

function boost_cache_flush_by_filename($filenames, $force_flush = FALSE) {
  $files = array();
  if ($filenames) {
    $filenames = array_unique($filenames);
    foreach ($filenames as $filename) {
      $files[] = array('filename' => $filename);
    }
    $counter = boost_cache_kill($files);
    if (BOOST_VERBOSE >= 9) {
      watchdog('boost', 'Debug: boost_cache_flush_by_filename() <br />Following files where flushed: <br />!list', array('!list' => implode('<br />', $filenames)));
    }
    return $counter;
  }
  else {
    return FALSE;
  }
}

In here there is a slight chance that $files could be empty, if it is though boost_cache_kill will exit. Dead end.

Can you set the verbose setting to 9? That will give me a much better idea on when this error is hitting you. Provide all the debug messages as well as the error, let me know the order.

superfedya’s picture

All this problems only with a last version of Boost. Before all works perfectly.

Debug: boost_cache_set_node_relationships()
10 of 10 given entries to the boost_cache_relationships table added or updated; 0 entries removed due to them being outdated.

Debug: boost_expire_node()
Node 125 was flushed resulting in 0 pages being expired from the cache

Debug: boost_cache_flush_by_filename()
Following files where flushed:
cache/normal/www.madfanboy.com/site/_page=2.html

Error: boost_cache_kill()
String was not given for filename: Array

[filename] => Array

[hash] => b4d10279464d94c30f2d1ec1e73b9efb
[filename] => cache/normal/www.madfanboy.com/site/rss.xml_.xml
[base_dir] => cache/normal/www.madfanboy.com/site
[expire] => 0
[lifetime] => -1
[push] => -1
[page_callback] => node_feed
[page_type] =>
[page_id] =>
[extension] => .xml
[timer] => 512
[timer_average] => 931
[hash_url] => 7d444ff38be539d04268b33e393b1d8b
[url] => http://www.madfanboy.com/site/rss.xml

mikeytown2’s picture

ID-ed issue; it's in boost_cache_expire_by_db()

      if (($info['page_callback'] == 'node' || $info['page_callback'] == 'taxonomy') && $info['page_id'] == 0) {
        // If we can't get a 'lock' just expire the file
        $filenames[] = $info;
      }
      elseif ($info['page_id'] != '' && $info['page_type'] != '' && $info['page_callback'] != '') {
        // Use boost_cache_expire_router() if we can get a 'lock' on this item in the database
        $hash = BOOST_FILE_PATH . $info['page_callback'] . $info['page_type'] . $info['page_id'];
        $data[$hash] = $info;
      }
      else {
        // If we can't get a 'lock' just expire the file
        $filenames[] = $info;
      }
    }
    // Expire all files that match up
    if ($data) {
      boost_set_base_dir_in_array($data);
      $counter += boost_cache_expire_router($data);
    }
    if ($filenames) {
      $counter += boost_cache_flush_by_filename($filenames);
    }

Will write a patch soon.

mikeytown2’s picture

FileSize
1.18 KB
srobert72’s picture

I have same error with 6.x-1.x-dev (2009-Nov-11) version.
I use Fivestar (6.x-1.19) also but all works perfectly before this last Boost version.

mikeytown2’s picture

@srobert72
can you test the above patch #6 and let me know if it works?

mikeytown2’s picture

Status: Needs review » Fixed

committed code from #1 & #6
Please Let me know if this doesn't fix the problem. You can grab the code in todays dev when it comes out in about an hour from now.

superfedya’s picture

fixed. thanks for the great support!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.