warning: md5() expects parameter 1 to be string, array given in /site/sites/all/modules/boost/boost.module on line 1921

superfedya - November 11, 2009 - 21:30
Project:Boost
Version:6.x-1.15
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

mikeytown2 - November 11, 2009 - 22:35
Status:active» needs review

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.

AttachmentSize
boost-630174.patch 948 bytes

#2

superfedya - November 12, 2009 - 00:26

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

#3

mikeytown2 - November 12, 2009 - 01:48

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.

<?php
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.

#4

superfedya - November 12, 2009 - 03:59

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

#5

mikeytown2 - November 12, 2009 - 17:47

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

<?php
     
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.

#6

mikeytown2 - November 12, 2009 - 17:56
AttachmentSize
boost-630174.patch 1.18 KB

#7

srobert72 - November 13, 2009 - 18:34

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.

#8

mikeytown2 - November 13, 2009 - 18:36

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

#9

mikeytown2 - November 13, 2009 - 23:08
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.

#10

superfedya - November 14, 2009 - 01:29

fixed. thanks for the great support!

#11

System Message - November 28, 2009 - 01:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.