Hi everyone, I’m having troubles in production
Post creation and publishing works fine (as well as the webhooks associated with the event). However, we’re unable to update the Metadata (posts_meta) for any given (published/unpublished) post without raising the following error:
“message”:“An error occurred”,
“context”: “Unable to update nested relation. [object Object]”,
“type”: “BookshelfRelationsError”,
“details”: null,
“property”: null,
“help”: null,
“code”: “UPDATE_RELATION”,
“id”: “18c059c0-72a9-11ea-a235-577d1046a35d”
I’m new to Ghost and recently launched a Ghost instance (v3.12) in production.
The issue I’m having certainly lies on the fact that some information from the database (MySQL) of a previous Ghost instance (v2.26), such as the “users” and “webhooks” tables were essentially copied to the database for the new, fresh instance (also MySQL).
Basically, what I did was export a dump of the old database, import it into the new one and manually truncate stuff like “posts”, “tags” and the like. Migrations look fine (I’ve checked the table to see if its updated), the ghost update
command also runs fine and ghost doctor
tells everything should be ok.
Taking a look at Ghost’s source code, I found this:
/**
* CASE: Attach id to update existing posts_meta entry for a post
* CASE: Don't create new posts_meta entry if post meta is empty
*/
It seems to me that the entries on the post_meta
table should be automatically created to match an id on the posts
table, upon post creation. That isn’t happening, my posts_meta
table is empty and I’ve tried manually adding the entries to match the ids in posts
with no success.
Any help is greatly appreciated.