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

  • Also had the exact same problem yesterday. Only fix we could find was to empty the /vendor folder and run composer install again locally – James Greig Jul 10 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 – Alban Jubert Jul 11 at 12:05

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.


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

New contributor
José Veríssimo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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