Error when trying to view analytics ER_BAD_FIELD_ERROR

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.


  • How was Ghost installed and configured? It was installed via the terminal with cli tool

  • What Node version, database, OS & browser are you using? nodejs version 18.12.1 using MariaDB 10.6.11 using latest firefox at MacOS

  • What errors or information do you see in the console? When trying to view statistics of a post, 400 error happens. It seemed to work fine before update to Ghost 5.

    "message":"Could not understand request.",
    "stack":"Error: select `posts`.*, (with `k` as (select `member_id` from `members_subscription_created_events` where = members_subscription_created_events.attribution_id union select `member_id` from `members_created_events` where = 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 = redirects.post_id) as `count__clicks`, `posts`.*, (select COALESCE(ROUND(AVG(score) * 100), 0) from `members_feedback` where = members_feedback.post_id) as `count__sentiment`, `posts`.*, (select count(*) from `members_feedback` where = members_feedback.post_id AND members_feedback.score = 0) as `count__negative_feedback`, `posts`.*, (select sum(`score`) from `members_feedback` where = members_feedback.post_id) as `count__positive_feedback` from `posts` where (`posts`.`type` = 'post' and `posts`.`status` in ('draft', 'published', 'scheduled', 'sent')) and `posts`.`id` = '63e778e42ce6c5f177c33d15' limit 1 - Unknown column '' in 'where clause'\n    at Child.<anonymous> (/var/www/\n    at Packet.asError (/var/www/\n    at Query.execute (/var/www/\n    at Connection.handlePacket (/var/www/\n    at PacketParser.onPacket (/var/www/\n    at PacketParser.executeStart (/var/www/\n    at Socket.<anonymous> (/var/www/\n    at Socket.emit (events.js:376:20)\n    at addChunk (internal/streams/readable.js:309:12)\n    at readableAddChunk (internal/streams/readable.js:284:9)\n    at Socket.Readable.push (internal/streams/readable.js:223:10)\n    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)",


  • What steps could someone else take to reproduce the issue you’re having? They could view analytics in the posts

Any update on this issue?

I have the same issue, any update on this issue?