Wow - any clues why I am getting this error?
Notice: unserialize() [function.unserialize]: Error at offset 36 of 43 bytes in variable_initialize() (line 749 of /var/www/vhosts/humanhighlights.com/httpdocs/includes/bootstrap.inc)..
it happens intermittantly, but often, if you go to http://humanhighlights.com there is a good chance you
will see it right there on the front page :(
I've done some searching and it looks like I may have database corruption - all that I found about it is on
Drupal 6 - they talk about making changes to bootstrap.inc to identify the corruption and fix manually -
Someone else suggested that I do a
SELECT name, LENGTH( value ) , value
FROM variable
WHERE LENGTH( value ) = "43"
which came up with a variable called "update_notify_emails"
but I am not sure what to do next can somebody help a brotha out?
Many thanks in advance!
Comments
Comment #1
oregonwebsiteservices commentedPlease help?!?!
Comment #2
steven jones commentedWhat may have happened is that the variable value has been corrupted in the database in some way, try removing it from the database by either running the following PHP code (with the devel module) or SQL query.
or
DELETE FROM variable WHERE name = 'update_notify_emails'Comment #3
oregonwebsiteservices commentedI did what you suggested and it seems to have resolved the issue - many thanks!
Comment #4
dilnix commentedI having some similar
Notice: unserialize() [function.unserialize]: Error at offset 2 of 8 bytes in variable_initialize() (line 749 of /home/h29638/data/www/helpfactory.com.ua/includes/bootstrap.inc).So just tried to use SQL query
DELETE FROM variable WHERE name = 'update_notify_emails'And have no effect, notice is prolongs further. May be my problem is some different??
Help me to find a fix for this please...
Comment #5
steven jones commentedIt will be a different variable that is causing your issue, run:
To find out the potential variables that might be causing the issue, find the one that is broken, and delete it from the database.
Comment #6
oregonwebsiteservices commentedSteven you da man!
Comment #7
Starminder commentedSimilar problem here:
•Notice: unserialize() [function.unserialize]: Error at offset 446 of 23435 bytes in variable_initialize() (line 748 of /home/hoslot5/public_html/includes/bootstrap.inc).
•Notice: unserialize() [function.unserialize]: Error at offset 44 of 45 bytes in variable_initialize() (line 748 of /home/hoslot5/public_html/includes/bootstrap.inc).
Comment #8
Starminder commentedComment #9
steven jones commentedRight, let's just provide a simple step-by-step guide:
If you're getting an error like this:
Then the important number is: Y.
Run this SQL query (replacing Y with the number from the error message):
Then, if there are multiple records returned try to identify the one causing the issue. Once you have the name of the variable causing the issue, run, replacing NAME with the name you have found:
DELETE FROM variable WHERE name = 'NAME'Comment #10
Starminder commentedThanks for the explanation, worked like a charm!
Comment #12
bryancasler commentedFantastic new module out that takes care of all these notices
http://drupal.org/project/variablecheck
Comment #13
CarbonPig commented#9 @Steven Jones
Thanks for the clear instructions - seems to have worked.
The only question I have is this:
I got about 5 records. I wasn't sure which one was "causing the issue", so I deleted all of them using the provided command.
Could this be an issue later?
Thanks,
CarbonPig
Comment #14
probocop commented@Steven Jones - After much head scratching with this issue, I stumbled across this thread and it worked a treat. Thanks alot!
Comment #15
avoura commentedThanks for the link, I had a similar problem, installed this module (variablecheck) and it found an old variable for an earlier version of the Zen theme, which I had used before using a different theme and then upgrading Drupal from 6.x to 7.x
Comment #16
leanderl commentedThanks! This problem has been plaguing me for six months -- now I could finally solve it with the Variable Check module and deleting the "bad" variables. Perfect!
Comment #17
giorgoskthanks
#9 worked great
Comment #18
Marc Ledergerber commented#9 solved this issue. And, the Variable Check module makes it super easy. http://drupal.org/project/variablecheck
Thanks!
Comment #19
drplgreat,thanks
Comment #20
devildog commentedgreat explanation by Steven Jones at #9. Thanks!
Comment #21
jillslocum commentedUsing Drupal 7 and Sqlite3, I am getting this same unserialize error. I've isolated the variables causing it. Each is an array of blobs with strings, and each contains a line feed character, '0a'. There are no other values in the variable table which contain line feeds, so I am assuming that these characters are causing the problem. Other answers here seem to suggest deleting these variables, but as far as I can tell they are used by the web site software. Why would I want to do this? Also, what would VariableCheck do to solve this problem? Thanks for any help people can give.
Comment #22
dark_kz commentedhttps://drupal.org/project/variablecheck module helped
Comment #23
openmode commentedDELETE FROM variable WHERE name = 'taxonomy_xml_url'
Comment #24
esmitex commentedI have a similar issue, I get the following error when adding a new content with a matrix field:
Notice : unserialize(): Error at offset 401 of 3920 bytes in matrix_field_widget_form() (line 202 in /homepages/45/d444012100/htdocs/smq/sites/all/modules/matrix/matrix.module).Comment #25
slevino commentedI received this error after (during?) a core update of drupal.
I installed the variable check module (http://drupal.org/project/variablecheck) which identified the bad value:
update_notify_emails a:1:{i:0;s:26:"user@email.com";}But this is indicating that the function is expecting an array, not just a string so I couldn't just set a new value, and when I checked the value table in the mysql db the data value was a blob and I couldn't edit it. Not knowing what module set that value and what might break if I simply deleted it I decided to try "re-setting" the array to clear it out.
Google told me that "update_notify_emails" is called in the update module into modules, clicked congfigure for Update Manager
and edited the value for "E-mail addresses to notify when updates are available" (mine was blank). Since the error indicated it was expecting both an int and a string I also flipped the setting on "Only security updates" so that value was passed in as well. Clicked save and error went away.
Comment #26
norman.lolYes #25!!! That's it!!! So simple ...
Comment #27
norman.lol3 month later. Same problem, slightly different cause. This time #9 helped me to spot it.
So inside
theme_preprocess_page(template.php) I checkedThe
dpm()returned mename == webform_default_from_nameI then tried to db_delete, what didn't work. So I went to check Webform module settings and simply filled in all 'from' fields again. Error gone.Comment #28
memcinto commentedSadly, in our case, after moving a site to a new server (and going from standalone to multisite), and getting these errors:
Notice: unserialize(): Error at offset 1776 of 1808 bytes in EntityAPIController->load() (line 261 of /xxx/xxx/xxx/xxx/xxx/xxx/sites/all/modules/contrib/entity/includes/entity.controller.inc).
Notice: unserialize(): Error at offset 2073 of 2105 bytes in EntityAPIController->load() (line 261 of /xxx/xxx/xxx/xxx/xxx/xxx/sites/all/modules/contrib/entity/includes/entity.controller.inc).
the module "variablecheck" found "No invalid variables found"
Trying the direct query also returned no rows.
Comment #29
Adrião Neves commentedI also had an identical issue, and after finding out which variable was causing the error, in my case the string size was wrong, I updated the value and until now no more error. Most cases will have a value harder to fix.
kcfinder_upload_url | 36 | s:24:"example/uploads";
to:
kcfinder_upload_url | 36 | s:15:"example/uploads";
Comment #30
tapas_talukder commentedDelete the row from variable table.
variable_delete('update_notify_emails');
or
DELETE FROM variable WHERE name = 'update_notify_emails';
Comment #31
shomari commentedStill an issue today and #9 helped me solve the problem.
Comment #32
annieceline commentedHi,
Got a similar error:
Notice: unserialize(): Error at offset 219 of 663 bytes in C:\xampp\htdocs\drupal\core\lib\Drupal\Component\DependencyInjection\Container.php on line 164
Notice: unserialize(): Error at offset 97 of 877 bytes in C:\xampp\htdocs\drupal\core\lib\Drupal\Component\DependencyInjection\Container.php on line 164
When following the step by step guide at #9, sql replies that the table 'variable' doesn't exist...
Did that happen to anyone ?
Thanks in advance !
Comment #33
ownage commentedHello, Drupal Experts-- HELP NEEDED!!!
Every time I run Cron, I'm getting "The website encountered an unexpected error. Please try again later."
Followed by this Very Similar notice in the error log:
Here is the function in system.queue.inc:
It is also accompanied with this error:
Google is showing no results for my specific case. Nothing about "unserialize()" within the system.queue.inc file or the accompanied Feeds error. I'd be forever grateful if someone could possibly step forward and lend any advice to help me troubleshoot this stressful situation. I need to get this website up and running within the next couple weeks...
Comment #34
fadonascimento commentedGreat explanation by Steven Jones at #9.
#9 solved the issue, thanks a lot.