404 on Admin/Posts Page

Hi,
I just upgraded to v5.21.0 and now I can no longer access my Posts page. It shows a 404 error message.

When I try and create a new Post, I see the following error message:

Internal server error, cannot save post. select `posts`.*, (with `k` as (select `member_id` from `members_subscription_created_events` where posts.id = members_subscription_created_events.attribution_id union select `member_id` from `members_created_events` where posts.id = members_created_events.attribution_id) select count(*) from `k`) as `count__conversions`, `posts`.*, (select count(distinct `members_click_events`.`member_id`) from `members_click_events` inner join `redirects` on `members_click_events`.`redirect_id` = `redirects`.`id` where posts.id = redirects.post_id) as `count__clicks`, `posts`.*, (select COALESCE(ROUND(AVG(score) * 100), 0) from `members_feedback` where posts.id = members_feedback.post_id) as `count__sentiment`, `posts`.*, (select count(*) from `members_feedback` where posts.id = members_feedback.post_id AND members_feedback.score = 0) as `count__negative_feedback`, `posts`.*, (select sum(`score`) from `members_feedback` where posts.id = members_feedback.post_id) as `count__positive_feedback` from `posts` where `posts`.`id` = '635f0a68d51ad95d7baae25f' limit 1 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`k` as (select `member_id` from `members_subscription_created_events` where post' at line 1

I’ve attached photos of the console log and the current state of the Posts page.


1 Like

What operating system and database version are you on?

1 Like

Ubuntu 18.04.6 LTS and mysql Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using EditLine wrapper

Your problem is probably the mysql version. Only 8 is supported.
To downgrade Ghost (until you’re ready to deal with the mysql problem), do this:

ghost update 5.20.0 

(or whatever version was working before you upgraded)

I’m also on Ubuntu 18 and have Ghost sites on mysql 5.x. They’re fine at 5.12/5.13, but something in this last update apparently really does require MySQL 8. The Ghost folks have been saying for months that they’re only supporting MySQL 8, and apparently 5.21.0 actually does break for older versions of 5.x.

1 Like

Okay, will do. It didn’t let me do that since my current version is higher, but I tried with --force and it’s running through the installation now.

Good catch. Hope that fixes you up for now!

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