Upgrading to 2.0 Error: Unexpected end of JSON input

Hello,

I’ve been at this for a couple hours now and I’d love to get my blog back up and running. I’m attempting to upgrade to version 2.0.2 from 1.22 and am getting a “Message: Unexpected end of JSON input” error upon running “ghost start”.

I’ve tried “ghost run” and the specific error thrown is: “ER_BAD_FIELD_ERROR: Unknown column ‘comment_id’ in ‘field list’”.

It seems to me either the backup or inserting the new 2.0 posts is causing havoc. Is there a way to wipe the JSON file clean? Then reimport from /ghost once it’s running?

I’ve tried rolling back the version (with --rollback flag, --force flag) and that just throws new errors.

Did you use the CLI? It shouldn’t have allowed you to do this - you should have been forced to upgrade from 1.22 to 1.25.5 (latest 1.x) and then upgrade from 1.25.5 to 2.0.2

Sorry, I forgot to mention that step. Yes, I did use the CLI and ran “ghost update --v1” first which brought me up to 1.25.5 before running “ghost update” after that.

Many hours later, I figured it out. I needed to delete the MySQL database altogether and let ghost start a new one; I’m guessing it was corrupt. Thankfully I had a backup of the blog prior to deleting and simply reimported the JSON to get my posts/users back.

Here’s the steps to delete the DB (make sure you have a backup first!)

  1. mysql -u root -p (assuming you set up the root user on install; it’ll prompt you for the password)
  2. drop database ghost_prod;
  3. \q (get out of mysql)

After that, “ghost start” worked beautifully. I initially received a 502 Bad Gateway error, but that went away with time (guessing nginx was still loading?)

“Unexpected end of JSON input” is not the most helpful error in retrospect. Something pointing to the database would’ve lead me much quicker to the above solution.

Hope this helps others! I tried nearly everything else (including reinstalling Ghost from scratch).

“Message: Unexpected end of JSON input” error upon running “ghost start”.

Do you still have the full error log? No idea where this error would come from.

The CLI will ask you if you want to rollback to 1.25.5, did you hit “no”?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.