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)
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.
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.
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.
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.
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?
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
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.