Failed to machine-translate Post#9153 to en: quoted string not terminated

AI-generated summary

Jagster reported an issue where the machine translation backfill process failed on Post#9153 due to a malformed JSON error: ‘quoted string not terminated’. The post in question, from topic https://foorumi.katiska.eu/t/lehmille-suklaata-ja-strosselia/2486, contained a mix of Finnish text and an English quote — likely triggering the bug. After fixing a typo, Jagster encountered repeated Sidekiq job failures, visible in the dashboard, and experimented with removing the MoneyCNN onebox and disabling the experimental ‘inline translation’ setting — which resolved the issue. nat confirmed the experimental setting is not yet supported and has since been removed from the plugin and integrated into Discourse core. Jagster later reported the system returned to normal after deleting problematic topics, clearing Sidekiq queues, and letting the translator process remaining jobs. The issue appears tied to edge cases in experimental translation features, particularly involving mixed-language content with quotes.

Backfilling is stuck.

Failed to machine-translate Post#9153 to en: quoted string not terminated (after translation) at line 1, column 100 [parse.c:251] in '{"translation":"CNN news from 10 years ago, when things were better in the United States of America.\n\nhttps://money.cnn.com/2012/10/10/news/economy/farmers-cows-candy-feed/\n\nIn the US, the cause of overweight (and certainly many other problems) is that junk food is so much healthier than real food. When you earn minimum wage and live on tips, you might leave the healthier options on the shelf if you can afford just a pound of ground beef and maple syrup.\n\nBut the problem also concerns cows:\n\n> Feeding candy to cows has become a more popular practice in tandem with the rising price of corn, which has doubled since 2009, fueled by government-subsidized demand for ethanol and this year's drought. Thrifty and resourceful farmers are tapping into the obscure market for cast-off food ingredients. Cut-rate byproducts of dubious value for human consumption seem to make fine fodder for cows. While corn goes for about $315 a ton, ice-cream sprinkles can be had for as little as $160 a ton.\n>\n\"As the price of corn has climbed, farmers either sold off their pigs and cattle, or they found alternative feeds,\" said Mike
/var/www/discourse/plugins/discourse-translator/app/services/discourse_ai/base_translator.rb:25:in `parse'
/var/www/discourse/plugins/discourse-translator/app/services/discourse_ai/base_translator.rb:25:in `translate'
/var/www/discourse/plugins/discourse-translator/app/services/discourse_translator/provider/discourse_ai.rb:28:in `block in translate_translatable!'
/var/www/discourse/plugins/discourse-translator/app/services/discourse_translator/provider/discourse_ai.rb:28:in `map'
/var/www/discourse/plugins/discourse-translator/app/services/discourse_translator/provider/discourse_ai.rb:28:in `translate_translatable!'
/var/www/discourse/plugins/discourse-translator/app/services/discourse_translator/provider/base_provider.rb:...

By that short snippet of text it tries translate this topic: Lehmille suklaata ja strösseliä - Ihminen, luonto & maailma - Katiskan foorumi

And if I do

SELECT id, topic_id, post_number
FROM posts
WHERE id = 9153

I get same topic.

But what should I do?

I fixed a typo in that post ja then I started to get errors too.

So I opened sidekiq. I read it fluently, but don’t understand much. But I would guess this isn’t normal.

Will I break something if I just go and kill all those jobs? Or is it just waste of time and it starts to stack again?

Edit

Because it looks like Moneycnn onebox is an issue I changed it to plain link. No luck, same Failed to machine-translate notice still comes.

I cleaned Sidekiq and Job exception errors has disappeared.

Edit2

It looks like that problem disappeared when I disabled setting Experimental inline translation. And sure, that post has a quote in English when rest of text were in Finnish.

So — should this count as a Contribute > Bug even it is an experimental setting?

Hey there, as you said the experimental setting is not for mainstream use yet, so we will not be taking requests for now. (soon though, after an official announcement)

The setting itself has been axed :axe: from the plugin and has been moved to Discourse itself as well.

Well, it were back to normal after couple of days. I needed to delete permanently those deleted topic that were problematic, clean up sidekiq and let translator do its job and cleanup the queue.