What is happening here is this
-
Some people have a very old version of the question answer plugin with my personal github username in the repository URL in their app.yml file.
-
I transferred the QnA plugin to
paviliondev
years ago. Github redirects repository URLs when they’re transferred, so the old urls with my personal username in it kept working. -
More years later Pavilion transferred the Question Answer Plugin to Discourse. Discourse initially kept the name
discourse-question-answer
. -
A few months ago I created my own fork of the plugin hosted in
discourse
, while it was still calleddiscourse-question-answer
. -
People with very old links to the QnA plugin with my personal github account in them were now cloning my new fork of the significantly updated
discourse-question-answer
hosted indiscourse
. In other words a very old link was now pointing to a fork of a new plugin. Despite the intervening years, I should have forseen that, so apologies for that. I’ve removed that fork. -
Discourse changed the name of
discourse-question-answer
todiscourse-upvotes
. This change of name has not had a material impact on your case @Jaap-Jan_Swijnenburg, but it’s why you’re now (unexpectedly) cloning a fork of that repo. -
A migration in
discourse/discourse-upvotes
(exdiscourse-question-answer
) assumes thevalue
column inpost_custom_fields
is type-safe as JSON. -
Old data created by the plugin when it was
angusmcleod/discourse-question-answer
(years ago) was not saved as valid JSON by theHasCustomFields
concern indiscourse/discourse
. I’m guessing, but this data was probably added before JSON type-checking was added 4 years ago (It’s still possible to end up with invalid JSON in custom fields registered as JSON in edge cases).
Therefore
- When people with the (years-out-of-date)
angusmcleod/discourse-question-answer
url in their app.yml update their Discourse the migration in the new version of the plugin is cloned, the migration runs and potentially creates this error.
There are a few solutions to this:
-
@Jaap-Jan_Swijnenburg in your case you just need to remove the reference to my old QnA plugin and you’ll be able to rebuild your site. That’s it; nothing more. Looks like that’s what you’ve done
-
The
discourse/discourse-upvotes
plugin migration could be updated to handle non-JSON values in thevalue
column inpost_custom_fields
.
I’d note that 2
would also handle the additional case of people who do indeed want to switch from the an old version of the QnA plugin to discourse-upvotes
. In that case the migration will run and it will fail if any entries in the value
column of post_custom_fields
are not valid JSON.