"Akismet" plugin always returns "Sorry, an error has occured." although everything works as expected

AI-generated summary

Users are reporting that the Akismet plugin returns a “Sorry, an error has occured.” message when confirming a post as not spam, even though the action is successfully logged and the post is removed from the queue. Sujan provides screenshots showing the error occurs after clicking “Not Spam,” despite the post being correctly marked as such in the logs. zogstrip suggests a possible race condition, but Sujan confirms the issue persists even when they are the one handling it. Further investigation reveals a 500 error in the network request for the “allow” action, with the log confirming the post was marked as not spam. LeoMcA confirms experiencing the same issue, and eviltrout identifies it as a Rails 5 regression, pointing to a fix in the discourse-akismet repository. tobiaseigen confirms the issue has been observed recently and is glad it’s been resolved.

Oh there is an Akismet report about a spam post:

Nope, not spam. I click “Not Spam”. But I get “Sorry, an error has occured.”:

But the report is gone:

And the log shows that the post was correctly “confirmed not spam”:

Anyone else having this problem?

2 Me gusta

This might happen when you click the button but the post was already handled by someone else.

Not sure how hard it is to properly handle this case though.

It was not, see my last screenshot. I am “Sujan12” that is logged as having handled it. That’s what makes this a bug :confused:

Some more investigating into this:


Chrome Dev Tools Network panel screenshot for another session. I go to /admin/plugins/akismet in the first request. Later you see allow which is /admin/plugins/akismet/allow that already responds with an error 500:

Again I checked the logs, it has my account as “confirmed not spam” for that post.

I’ve had this happen to me a couple of times as well. The first time I assumed it was a race condition, the next time I wasn’t so sure…

1 me gusta

This is another Rails 5 regression. Fixed here:

https://github.com/discourse/discourse-akismet/commit/137c30ec467bbdd98da29bd2b289acf50a639604

6 Me gusta

Great! For the record I saw this a few times in the last 10 days as well. Glad it’s fixed.

3 Me gusta

This topic was automatically closed after 26 hours. New replies are no longer allowed.