Anyone know what this is ? It happens when I run cron

Notice: unserialize() [function.unserialize]: Error at offset 2 of 93 bytes in /includes/bootstrap.inc on line 390

Comments

darumaki’s picture

This error msg doesn't get logged either, does anyone know where it comes from ?

darumaki’s picture

This is very strange, i removed all content and disabled all modules and I still get this message

Summit’s picture

Subscribing, same error! greetings, Martijn

drew reece’s picture

This error seems to be due to character encodings, there are several posts if you search drupal.org for 'Notice: unserialize() [function.unserialize]:' the figures relate to where the error is in the data I believe.

I have no idea what the solution is, I have cleaned my caches and imported db's from other backups, but I am still getting the error.

The error can be made to 'go away' by adding the following to the .htaccess
php_flag display_errors off

But the error is still happening, but at least the user isn't witnessing it too.

Here are some posts that also talk about this issue… the last 2 may have the answer, but the last post is so long I don't know where to begin.

http://drupal.org/node/171662
http://drupal.org/node/223705
http://drupal.org/node/239332

http://drupal.org/node/40987
http://drupal.org/node/40515

Drew

drew reece’s picture

Probably just talking to myself at this stage, but incase you (or I) have this happen again here is what I did to solve it…

Make sure php error reporting is on & notices is set to all. Obviously this is best done on a test server :)

Find the line where the first error is occurring, for me it was line 390 in includes/bootstrap.inc. Print some of the variables using print_r(); to try to figure out what is being processed at the error stage.

My problem was happening after clearing the cache with the devel module, and at line 390 in bootstrap.inc the caches are being rebuilt for each variable.
From there I could print the name of the variable, the one that comes before the error is usually causing the trouble.

Then its a case of looking in the DB to see if the data contains mangled characters and replacing them with something appropriate.

FWIW My problem was with the breadcrumb separator that is used in the zen theme. The symbol somehow got mangled in one of my sqldumps I suspect it was one done from phpmyadmin, but can't confirm that.

Drew

SocialNicheGuru’s picture

i am having a similar problem and I will see it.

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

brett.anderson’s picture

Drew:

Thanks for your suggestions. Looking into my bootstrap.inc file and printing out the offending variables I found that there were multiple versions of the theme settings variables that were made over the multiple modifications I have made to my themes. Regardless of my settings in the /themes folder files I was still receiving jumbled characters that were triggering the unserialize function failures because these old theme settings variables were not being removed or reset in the database. Looking into the Variables table of the database I found and deleted the offending "theme_
_settings" variables and all was well.

-b-

dreeuwtje’s picture

Mine was caused by date_format_ ... _delete variables after upgrading the core from 6.6 to 6.14.
After removing these vars from the database the issue seems to be solved.

Anonymous’s picture

Having the exact same problem. I've tracked it down to the breadcrumb separator in the 'theme_STARTERKIT_settings' variable, and yes, the breadcrumb was mangled. However, changing it so something innocuous like "-" hasn't helped and I'm still getting the error.

Here's the error:

Notice: unserialize() [function.unserialize]: Error at offset 113 of 753 bytes in /home/mysite/public_html/mysite/includes/bootstrap.inc on line 557

And here's the value:

a:25:{s:17:"zen_block_editing";s:1:"1";s:14:"zen_breadcrumb";s:3:"yes";s:24:"zen_breadcrumb_separator";s:5:" > ";s:19:"zen_breadcrumb_home";s:1:"1";s:23:"zen_breadcrumb_trailing";s:1:"1";s:20:"zen_breadcrumb_title";s:1:"0";s:20:"zen_rebuild_registry";s:1:"1";s:14:"zen_wireframes";s:1:"0";s:7:"mission";s:0:"";s:12:"default_logo";i:1;s:9:"logo_path";s:0:"";s:15:"default_favicon";i:1;s:12:"favicon_path";s:0:"";s:13:"primary_links";i:1;s:15:"secondary_links";i:1;s:11:"toggle_logo";i:1;s:14:"toggle_favicon";i:1;s:11:"toggle_name";i:1;s:13:"toggle_search";i:0;s:13:"toggle_slogan";i:0;s:14:"toggle_mission";i:1;s:24:"toggle_node_user_picture";i:0;s:27:"toggle_comment_user_picture";i:0;s:20:"toggle_primary_links";i:1;s:22:"toggle_secondary_links";i:1;}

If I'm counting right, an offset of 113 puts me at the semi-colon before 's:19', but I see no error here. Like I said, I've also tried changing the separator to "-", but still get exact same error on exact same value.

EDIT: Oh, never mind. I didn't realise the 's' stood for string length. s:1:"-"; works fine

crozilla’s picture

I ran this in myphpadmin under SQL:

select name, length(value), value from variable where length(value) = "16";

That returned a list of variables that matched my error number ("16"):

Notice: unserialize() [function.unserialize]: Error at offset 2 of 16...

Then I looked to see if the 's:XX' matched the number of characters in the string that followed. When it didn't, I changed the 's:XX' number to match. That seemed to clear it up.

geoffv’s picture

Thanks, this helped a lot.

Using the above query will find the offending string or array in the varaibles table.
Once you've figured that out, it's easy to find the symbols that don't look right.

For me it was the Zen_Theme Breadcrumb seperator same as a previous post.

I discovered it was in my method of restoring the Database. I used the MySQL Workbench instead of command line, and it changed a special character '>' to 3 symbol characters. It was easy to find an old backup of the database and copy the correct symbol into the current Database.

wqr786’s picture

I had the same problem after checking out from repository into a new folder, and then setting up a new database and populating it with data --- which was running fine on my other PC. When I set it up on my other system it started giving this errors.

What I did to solve it was, just ran update.php file and ----- things became normal again.

Hope this helps.

Thanks
Waqar
4 Ace Technologies

computer_jin’s picture

i ran update.php file and now i m still having this error plzz tell me if is there an other way to solve this ...

Thanks

--
Azhar uddin
Technical Lead
email : engr.azharuddin@gmail.com
skype : computer_jin

codeelegance’s picture

I had this problem, but it went away when I deleted the variable table and imported it alone after the rest of the db had been imported for an upgrade from V5 to V6.

jc.vdb’s picture

I had the same problem . Check your drupal stauts report and check if the mbstring php module is installed on your server.
Hope this fix yours.

spigot’s picture

Turn on php_mbstring

Look in the variable table for strange characters, such as an A with a hat on it, my problem was with 2 currency variables, instead of a £ they had A£ (the A had a 'hat' on), remove the strange characters.

For me this fixed it, other ppl have had problems with email addresses, probably the @ sign.

sunchaser’s picture

hm I'm reading everywhere that php_mbstring needs to be DISABLED for Drupal to run properly ?!
I'm having the above issue too btw, still haven't found a fix for it.
By the way; ... nowhere in my statusreport can I find anything about php_mbstring being loaded or not.

drew reece’s picture

I have …
"Unicode library PHP Mbstring Extension"
… listed in my status report at admin/logs/status and admin/reports/status on Drupal 5 & 6 sites respectively.

justintsmith’s picture

Just thought that I would throw in my two cents and say that this error was popping up for me when I forgot to change the base url in settings.php on a Drupal multisite.

mylocaltrades’s picture

Offering Drupal website services to the UK - www.my-local-trades.co.uk