3

Hey guys I am getting this error: unserialize(): Error at offset 0 of 60695 bytes when i push a backup of my local db to my staging environment. I am using craft 3. Any ideas? Clearing the /storage/runtime/cache didn't work.

More info here: The value that php is trying to unserialize() and failing to do so looks like json (The value of info config, see picture below). Looking at an old version of a db dump, that value looks like it was proper serialized data. At some point, craft started storing it as json?

enter image description here

2
  • Also had the exact same problem yesterday. Only fix we could find was to empty the /vendor folder and run composer install again locally Jul 10, 2019 at 19:06
  • 1
    I can confirm there's been some changes about the way configuration data is serialized. We've got some issues about that too. See github.com/craftcms/cms/issues/4459 Jul 11, 2019 at 12:05

3 Answers 3

8

Adding a "^" to the craftcms version in the composer.json file and then running composer update, did the trick for me.

for example: "craftcms/cms": "^3.1.22",

I also cleared the cache folder in /storage/runtime/cache

1
  • Yep - this fixed it for me also
    – JKM
    Nov 11, 2019 at 5:13
2

I had this issue after I deployed to an environment I hadn't used for a while. I deployed the files and updated the database, but I forgot to update the Composer files. So the site was trying to use the outdated Composer files that were on the server, resulting in errors.

So I ran rm -R vendor and composer install and was back on track.

1

It looks like the issue here was that the craft version running on staging was and old one (14 days old). The data held in info config was stored as serialized data at that time. When I supplied un updated dump of the db, the same value of info config was stored as json, but the outdated craft was trying to unserialize it. It was fixed by making sure the staging version of craft was up to date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.