Hi all men !!
I have recently switched a test site from drupal 6.20 to 7.0.
After the upgrade, sometimes (yes, not always), I get these notices:
* Notice: unserialize() [function.unserialize]: Error at offset 86 of 90 bytes in variable_initialize() (line 749 of /home/cappella/public_html/drupal/includes/bootstrap.inc).
* Notice: unserialize() [function.unserialize]: Error at offset 113 of 771 bytes in variable_initialize() (line 749 of /home/cappella/public_html/drupal/includes/bootstrap.inc).
* Notice: unserialize() [function.unserialize]: Error at offset 113 of 723 bytes in variable_initialize() (line 749 of /home/cappella/public_html/drupal/includes/bootstrap.inc).
What can I do ? All seem to work fine except these notices.
Have you ever experienced this ?
Thank you all !
Have a nice day !
F.
Comments
Me too
Yep, me too. Haven't been able to resolve it yet.
Here's the function and line 749 is a variable rebuild.
$variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
/**
* Load the persistent variable table.
*
* The variable table is composed of values that have been saved in the table
* with variable_set() as well as those explicitly specified in the configuration
* file.
*/
function variable_initialize($conf = array()) {
// NOTE: caching the variables improves performance by 20% when serving
// cached pages.
if ($cached = cache_get('variables', 'cache_bootstrap')) {
$variables = $cached->data;
}
else {
// Cache miss. Avoid a stampede.
$name = 'variable_init';
if (!lock_acquire($name, 1)) {
// Another request is building the variable cache.
// Wait, then re-run this function.
lock_wait($name);
return variable_initialize($conf);
}
else {
// Proceed with variable rebuild.
$variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());
cache_set('variables', $variables, 'cache_bootstrap');
lock_release($name);
}
}
foreach ($conf as $name => $value) {
$variables[$name] = $value;
}
return $variables;
}
This unserialize error is
This unserialize error is likely caused by a mis-formatted variable. What modules are you both using? Any chance you could track down which variable is causing the problem?
Some debugging output would help us figure out what formatting issues are causing the notices.
I am running into the same problem.
I do not have any additional modules installed 7.0. In 6.20 I had:
Category Status Module Version
Administration 1 Actions permissions 6.x-1.10
Administration 1 Admin Role 6.x-1.3
Administration 1 Administration menu 6.x-1.6
Core - Optional 1 Aggregator 6.19
Other 1 Backup and Migrate 6.x-2.4
Other 1 Better Formats 6.x-1.2
Core - Optional 1 Blog 6.19
Core - Optional 1 Blog API 6.19
Calais 1 Calais 6.x-3.5
Calais 1 Calais API 6.x-3.5
Calais 1 Calais Tag Modifier 6.x-3.5
Spam control 1 CAPTCHA 6.x-2.3
Chaos tool suite 1 Chaos tools 6.x-1.8
Other 1 CKEditor 6.x-1.2
Core - Optional 1 Color 6.19
Core - Optional 1 Comment 6.19
Core - Optional 1 Contact 6.19
CCK 1 Content 6.x-2.9
Core - Optional 1 Database logging 6.19
CCK 1 Fieldgroup 6.x-2.9
Core - Optional 1 Forum 6.19
Core - Optional 1 Help 6.19
Spam control 1 Image CAPTCHA 6.x-2.3
User interface 1 jQuery UI 6.x-1.4
Core - Optional 1 Menu 6.19
CCK 1 Node Reference 6.x-2.9
CCK 1 Number 6.x-2.9
CCK 1 Option Widgets 6.x-2.9
Core - Optional 1 Path 6.19
Other 1 Pathauto 6.x-1.5
Core - Optional 1 PHP filter 6.19
Core - Optional 1 Ping 6.19
Core - Optional 1 Profile 6.19
RDF 1 RDF 6.x-1.0-alpha8
Spam control 1 reCAPTCHA 6.x-1.5
Spam control 1 reCAPTCHA Mailhide 6.x-1.5
Core - Optional 1 Search 6.19
Other 1 ShareThis 6.x-1.8
Other 1 Skinr 6.x-1.6
Core - Optional 1 Statistics 6.19
Other 1 Strongarm 6.x-2.0
Core - Optional 1 Syslog 6.19
Taxonomy 1 Tagadelic 6.x-1.2
Taxonomy 1 Tagadelic all block 6.x-1.2
Views 1 Tagadelic Views 6.x-1.2
Core - Optional 1 Taxonomy 6.19
CCK 1 Text 6.x-2.9
Other 1 Token 6.x-1.15
Other 1 Token actions 6.x-1.15
Core - Optional 1 Trigger 6.19
Other 1 Twitter 6.x-3.0-beta3
Other 1 Twitter actions 6.x-3.0-beta3
Other 1 Twitter Post 6.x-3.0-beta3
Core - Optional 1 Update status 6.19
Core - Optional 1 Upload 6.19
CCK 1 User Reference 6.x-2.9
User interface 1 Vertical Tabs 6.x-1.0-rc1
Views 1 Views 6.x-2.12
Views 1 Views Bulk Operations 6.x-1.10
Views 1 Views Send E-mail 6.x-1.x-dev
Views 1 Views UI 6.x-2.12
same problem here. no
same problem here.
no additional modules installed, still this error is thrown frequently (approx. every 2 page load)
unserialize problem with damaged variables in D7
I found this thread http://drupal.org/node/49694
But the code has changed a bunch for D7 so I am not sure how to apply it.
My error:
Notice: unserialize() [function.unserialize]: Error at offset 2 of 8 bytes in variable_initialize() (line 748 of /home1/explore8/public_html/2tim/includes/bootstrap.inc).
Doesn't help because the SQL:
select name, length(value), value from variable where length(value) = "8";
finds 100s of variables
I'd rather not just cover up the error as suggested, or it might bite me later.
Found it. There is now a module to find bad variables http://drupal.org/project/variablecheck
Install it, go to your status report, run the variable check, tell some module developers about bad variable where appropriate,
then using phpmyadmin, click on variable table, search tab, look for your variable using %like%, delete where you can afford it
How to run the variable check?
I installed variablecheck module
I went to admin/reports/status
There I could get the following:
"Variables______________________________Found 4 invalid entries
The variable table contains an invalid entry. Please check the variable report for more information."
I clicked on variable report and expected to get the wrong variables names,
But instead I was sent back to the admin/reports page.
Thanks in advance for your help
I found the way, I created a
I found the way,
I created a temporary node were I added the following:
And I got the following:
Array (
[0] => Array ( [0] => superfish_arrow_1 [1] => s:4:"1"; )
[1] => Array ( [0] => superfish_arrow_2 [1] => s:5:"0"; )
[2] => Array ( [0] => superfish_shadow_1 [1] => s:5:"0"; )
[3] => Array ( [0] => superfish_shadow_2 [1] => s:4:"1"; ) )
The wrong variables were coming from an update of Superfish module
So I went to "variable" table in PhpMyAdmin and deleted the variables
Thanks
I had got a similar problem caused by a update of Superfish.
I detected the variables by module variablecheck and manually deleted the faulty ones as I couldn't do in the adminstrator environment.
Thanks for the tip.
Greeting, Bas
a lil more please
thx so much it works fine...
but, what about : Unserialize variable
b:0;
i:0
????? help please