6 replies [Last post]
x86
x86's picture
Offline
Joined: 05/11/2013
Juice: 11
Was this information Helpful?

Getting this error on order view page:

Notice: unserialize() [function.unserialize]: Error at offset 272 of 488 bytes in UcOrderController->attachLoad() (line 14 of /html/sites/all/modules/ubercart/uc_order/uc_order.controller.inc).

The site hosted on local machine (MAMP) runs without errors with the database dump from the store that showing the error above.

When I open list of orders, it showing several errors similar to this.

Please help, if you are familiar with this problem. Its already 6 hours I'm searching for the solution but could not find anything.

Site is hosted on Godaddy, using latest version of Drupal and Ubercart.

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1738
Re: Notice: unserialize() [function.unserialize]: Error at offse

PHP is trying to unserialize some order data that is in the wrong format. This is in the "data" field of a record in the {uc_orders} table. This field holds extra information about the order that doesn't fit into other fields.

In other words, it's likely that your database is corrupt. Look at your database to see if you can find anything strange.

It's possible that some other module put bad data in that field.

x86
x86's picture
Offline
Joined: 05/11/2013
Juice: 11
Re: Re: Notice: unserialize() [function.unserialize]: Error at o

DanZ, thank you for your response.

A weird situation – when I tried to run the run the same code and database from GoDaddy hosted site on Site5 hosting, everything is ok.

I don't get the "unserialize" error message on Site5. I did not changed anything when I copied database and files.

Now I'm thinking about migrating to Site5 if this can not be fixed with php.ini configuration. But I'm not sure if this is related to php.ini configuration.

Any ideas?

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1738
Re: Re: Re: Notice: unserialize() [function.unserialize]: Error

Well, clearly there's an incompatibility with the way you moved the data to one of the DBMSs.

I'm not an expert in these things, but check to make sure your export and import match on things like collation and character sets.

It might also be that the PHP interpreter and its DB interface is not set up to handle the data (again with the character set and such). Again, I'm not an expert here.

The good news is that it's working on one site. That means that you can compare the data in the two databases to see that they match exactly, then use that information in your troubleshooting.

Once you've gathered all the information you can, you can talk to GoDaddy's tech support. They should be able to offer something.

If you have a small scrap of stand-alone PHP test code that demonstrates the problem by working on one site, but not the other, that will make it much easier to troubleshoot.

x86
x86's picture
Offline
Joined: 05/11/2013
Juice: 11
Thanks a lot DanZ. I have

Thanks a lot DanZ.

I have created a sample PHP file that demonstrates the problem with unserialize function on GoDaddy and created a ticket for their support. Let's see what they suggest.

I'm attaching that php file here too. It works on my local MAMP environment and Site5 hosting, but does not work at GoDaddy.

AttachmentSize
tmp.php_.txt 606 bytes
DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1738
Re: Thanks a lot DanZ. I have

Heh, Ubercart.org has some anti-hack protection against files containing PHP.

You'll have to paste the text in your post if you want it to be visible. That's not too important, though. GoDaddy should have enough to go on now.

x86
x86's picture
Offline
Joined: 05/11/2013
Juice: 11
Here is the code:<?phpecho

Here is the code:

<?php
echo "Start\n";

$string_from_db='a:5:{s:17:"uc_quote_selected";b:1;s:7:"cc_data";s:156:"5Q;XZz<l8{jtI@S:2/-/XF3}_VW;lL9W*2yHA+YbqtQki<FWV21!EJx7Gn+W!nYv4)&pxexkCc!|gi/[:)w)mxb+fp<+ip~ZIGJY3-? )d1Y?#%eT,wj<?$q-9cXoWXPAj)AHO$0aF{!7:{>HDY3#~Pp|fpS";s:7:"cc_txns";a:1:{s:14:"authorizations";a:1:{i:5196045262;a:3:{s:6:"amount";d:19.754000000000001335820343228988349437713623046875;s:10:"authorized";i:1367118373;s:8:"captured";i:1367251050;}}}s:8:"new_user";a:1:{s:4:"name";s:6:"pddeer";}s:13:"complete_sale";s:8:"new_user";}';
$array = unserialize($string_from_db);
print_r($array);

echo

"\nEnd\n";
?>