Search no longer works after 3.1.0.beta1 update

Since our 3.1.0 update today, our Search is no longer working.
Our sysadmin team identified a problem and provided us with this log stating this is an application error.

Does anyone else experience this problem and what may the clues be for us to be able to resolve the problem ourselves? I see search works perfectly at Discourse Meta.

Started GET "/search?q=37%20%20realm&page=1" for [IP_REDACTED] at 2023-01-13 11:19:36 +0000
Processing by SearchController#show as JSON
  Parameters: {"q"=>"37  realm", "page"=>"1"}
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms | Allocations: 1555)
ArgumentError (wrong number of arguments (given 1, expected 0))
lib/search.rb:285:in `execute'
app/controllers/search_controller.rb:73:in `show'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
config/initializers/008-rack-cors.rb:24:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'
Failed to handle exception in exception app middleware : ArgumentError : wrong number of arguments (given 1, expected 0)
Screenshots of the problem



It can’t be totally common issue — mine works just fine. Same here (I reckon Meta is on latest).

What happends when trying /safe-mode?

Unfortunately, it doesn’t work in Safe mode either. No themes, no plugins mode.

We see the search doesn’t work for Topics/Posts, but works for Categories/Tags and Users.

Are you using an external instance of PostgreSQL? If so what is the version?

Yes, we are using the external PostgreSQL. The version is 14.6-1

1 Like

Our search is completely broken when running against PostgreSQL 14, which is why we are still shipping PostgreSQL 13 for everyone following our standard install.

We will eventually fix it since we will upgrade to PostgreSQL 15 (or 16) someday, but it may take a while.

3 Likes

Thank you. We’re investigating how that may have happened IF we have previously had other PostgreSQL version. Will get back to you once we identify the issue.

1 Like

Whether you previously had 14 isn’t really material, Discourse isn’t compatible with PostgreSQL 14. That’s your issue.

1 Like

I’ve checked the discourse/INSTALL.md at main · discourse/discourse · GitHub documentation instead, as Cloud documentation doesn’t have server requirements at all.

We see “Postgres 13+” requirement here. May I be wrong by suggesting to your team to add a notice that Discourse supports 13.X versions only? Maybe, explicit notice of 14/15/… versions are not supported would be helpful too in such cases like ours.

You see, we had Version 14 for at least since December, and we had Stable version of Discourse installed since months earlier. Recently we moved back to tests-passed version, searched worked as expected. Today, we updated from 2.9.0.beta14 to 3.1.0.beta1 and now it’s broken.

any chance that you use the private replies plugin ?

4 Likes

We have it installed, it is disabled in Admin settings

We also tried and reproduced the issue in Safe Mode. Should it matter anyway?

Unclear, but that was the issue in my case (same symptoms - although with PostgreSQL13)
I’m sure Richard will patch it up shortly, in the mean time a fork and a simple edit is a solution.

2 Likes

Oh. Bummer. I’ve got one site that I mostly accidentally upgraded to PG14 a while back, and figured it would be fine.

I just did a few searches and they weren’t obviously terribly broken. And the site is mostly in Chinese, so I wouldn’t really be able to tell anyway.

Just how broken is it and how hard is it going to be to fix it?

2 Likes

Safe mode only impacts the client-side. This error is happening on the server. To check whether the error is related to the private replies plugin, you’ll need to uninstall that plugin completely.

This error does seem likely to be related to a Ruby 3.1 plugin incompatibility

4 Likes

then I’m fairly confident it’s the execute(readonly_mode) in the plugin (and no clue why :sweat_smile: )

3 Likes

You are right here @Benjamin_D.

That plugin does break search and will trigger the error 500.

But running PostgreSQL 14+ will also break search, but in a more subtly way where a lot of results that would be returned on pg13 won’t return on pg14+.

So @kinetiksoft can remove the plugin and rebuild to get search to not error out, but it won’t work normally still because of pg version.

4 Likes

I can now confirm Search works as expected now since we removed Discourse Private Replies plugin

No changes were done server-side, the PostgreSQL is still 14.6-1, but we will be looking into downgrading options next week.

Thank you, everyone, you saved our search functionality for this weekend.

P.S. Kindly asking Discourse @ github team to add caution for PostgreSQL version in the official documentation:

3 Likes

Did you check the documentation on running external PostgreSQL? It’s here on Meta, not github. All of the documentation is visible at Docs

1 Like

Sorry all! The private replies plugin was indeed breaking search (or: Ruby 3.1 was breaking the plugin).
It’s now working again.

5 Likes