Latest Akismet plugin not backwards compatible with stable

akismet

(Sigurður Guðbrandsson) #1

This is for you people who realize that upgrading your Discourse JUST BROKE EVERYTHING …

don’t panic.

I just upgraded my Discourse-akismet to the latest (stable) version and went to my community site.
Unfortunately, I got a JS error like the one above and started to panic a bit…

I tried ctrl+shift+F5 (ignore cache and re-download everything) - NOTHING!

I figured that I just have to update the core as well … so I did that.
What happened?
Nothing.

Same JS error.

I started to panic some more, figured it had to be the discourse akismet plugin … so I SSH’d into the server, removed the plugin and rebuilt the whole container…

What happened?

NOTHING. Same error!

Fuck.

Or so I thought.

I thought “Hey … maybe this is just a bad cache … let’s try a different browser that I haven’t used for the site”

So I opened Firefox and went to the site … and it was up …
WTF?

So I figured that I just have to clear the cache, cookies, the whole shebang in my browser…

… and that worked. (finally).

So I figure, the cookies must be broken or something … does that make any sense?

Now, the really really really bad thing:
All my users are now affected by this and I expect a storm of e-mails about how the forum no longer works.

I’ll be adding “try clearing your cookies” to my canned responses now, but has this happened to anyone else?
Did you find a fix for this for ALL users (so that the old cookies don’t affect the “new, upgraded system”)?


(Kane York) #2

Instructions for Chrome:

  • F12 (opens dev tools)
  • Drag down on the Reload button to “Empty Cache and Hard Reload”
  • Post away

However, this shouldn’t be happening. Is this a Docker install? Looks like it is Docker. But the filenames should have changed each time.


(Sigurður Guðbrandsson) #3

Ok … this is weird.

If I am logged out, everything is fine.
If I log in as an admin - everything breaks. (even in a different browser)

Here’s the error I see in firebug:

TypeError: s is not a function

from

if(t&&t.get("staff")){s("currentUser.akismet_review_count");va...

Now … I’ve removed discourse-akismet, rebuilt the whole container and I still get this error…

… I’m about to rebuild the container again with discourse-akismet, but I fear that I’ll still get teh same errors.
Does anyone have any bright ideas to help me test this?


(Sigurður Guðbrandsson) #4

Wow, never knew about this … you’re brilliant!

Unfortunately, being logged in, everything still breaks :confused:

I’m going to check logs and see if I find anything … but this is annoying (esp. since I’m supposed to be working for a client right now)


(Sigurður Guðbrandsson) #5

ok … so this is strange…

I removed discourse-akismet, but after rebuilding the container, discourse-akismet somehow magically reappears in the plugin folder…

where’s the shotgun?

EDIT: I’m a silly person. I of course forgot that I have to change the Docker definition and remove discourse-akismet before I rebuild the container… :wink:
Let’s see how far that will get me.


(Sigurður Guðbrandsson) #6

Got it working again.

Discourse Akismet update does something strange that will break the emberjs in the stable environment.

TO FIX THIS (for anyone else having this problem):

  1. Disable Discourse-Akismet from the docker container description file (remove the git clone line)
  2. Rebuild the container

CC: @eviltrout


(pjv) #7

FWIW, I just installed Discourse-Akismet this morning on the latest version of the Docker install and it seems to be working perfectly for me. No issues with the admin or the forum, whether logged in as an admin or an unprivileged user or not logged in at all.


(Jeff Atwood) #8

Have updated many times. Akismet and Discourse, both, never seen a problem.


(Mittineague) #9

sigurdur, Are you failing the :staff:

add_to_class(:guardian, :can_review_akismet?) do
user.try(:staff?)
end
add_to_serializer(:current_user, :akismet_review_count) do
scope.can_review_akismet? ? DiscourseAkismet.needs_review.count : nil
end

(Sigurður Guðbrandsson) #10

@Mittineague, I don’t have a clue … all I know is removing Akismet fixed my forums. (I’m not breaking it again unless I can see a good reason to)

@pjv, good … that means it’s only specific to something in my environment. I’m running the stable vanilla version of the forum.

@codinghorror, I don’t remember if I had finished configuring Akismet or not (I think not) … but having Discourse-Akismet broke the forum for some reason. I won’t be enabling it again unless it’s on a staging server for debug purposes.
I can provide a backup if you guys want.


(Robin Ward) #11

I really suspect it’s an environmental/setup issue and not related to your database. We have akismet on MANY hosted sites with different databases and have never seen this.


(Sigurður Guðbrandsson) #12

Well, I don’t know what’s different in my setup … it’s a docker setup using a DO Ubuntu machine (as per the official install manual) using a vanilla setup in a “single” container.
I do have two forums set up on the server … but I have a hard time believing that’s the reason.

In any case, I’ll see if I get any real amount of spam, right now I’ve only had one spam message ever… if spam starts to take more time than potential 2 day debug, then I’ll enable akismet again, otherwise I’ll just keep the system as it is now.


(Sam Saffron) #13

What is the git repo of your docket akismet thing? Keep in mind, we moved it when @eviltrout did all his work


(Sigurður Guðbrandsson) #14

GitHub - discourse/discourse-akismet: give spam a whoopin was the repo I used …


(Sam Saffron) #15

This sounds super odd, I wonder if its local related ? @eviltrout are we running akismet anywhere in non English?


(Sigurður Guðbrandsson) #16

All my forums are in English … :confused:


(Sam Saffron) #17

can you retry then and see if this happens again? maybe it was something else. Akismet works fine on all our sites.


(Sigurður Guðbrandsson) #18

I tried again …

Added the akismet plugin again and rebuilt the container


(Kane York) #19

You mentioned ‘stable’ - as in the stable branch? Perhaps that’s it?


(Sigurður Guðbrandsson) #20

Yup … I have Discourse ‘stable’, version 1.2.1