Mattermost, Inc.

Search isn't searching, how to fix?

Summary

Search isn’t returning any results, despite doing something for a noticeable amount of time.

Steps to reproduce

Using the current Mac desktop client, and server 5.12.2, enter a term in the Search field, then hit Enter.

Expected behavior

Search results are returned.

Observed behavior

The “Searching…” and wait spinner appear in the Search Results panel. After ~30 seconds, “No results found. Try again?” This is for a term I can see on the screen. This fails for every term we’ve tried, other than literally the word “work” which returns results after a short delay.

The only relevant thing I can see in the logs is:

{“level”:“warn”,“ts”:1562590449.2580738,“caller”:“sqlstore/post_store.go:955”,“msg”:“Query error searching posts: pq: canceling statement due to user request”}

Is there some way to re-index the message database so Search works again? Is there something I can do to figure out why it’s failing?

Hi @Taffer, depending on if you use Postgres or Mysql, this doc might help: https://docs.mattermost.com/help/getting-started/searching.html#differences-between-mysql-and-postgres-search.

Not sure if you use Elasticsearch, but this doc might also help: https://docs.mattermost.com/deployment/elasticsearch.html.

Did this issue start to happen after you upgraded to v5.12?

I’m using Postgres as the back-end, and don’t have Elasticsearch installed.

I first noticed it in 5.10, but anecdotally it’s been broken for “a long time” on our server.

@Taffer For both this and the other issue you posted, it looks like it could be that your database server isn’t powerful enough. As we understand it, it’s unable to answer queries in time. This doc might help: https://docs.mattermost.com/install/requirements.html.

Thanks; when I spec’d out this VM, I used that document, but it’s possible things have changed since then. Going to do some Postgres tuning as well.