Encountered error while looking up team by name


When posting a message I often see this come up:

ERRO[2019-11-08T12:14:51.6016839Z] Encountered error while looking up team by name  Team Name=select_team caller="app/notification_email.go:288" error="SqlTeamStore.GetByName: Unable to find the existing team, name=select_team, sql: no rows in result set"

Any ideas what could be causing it?

@Alexander77703 What Mattermost server version are you on?

We’re currently seeing it on v.5.16.3

Do you just see the error in the logs or do the messages fail to send? What device and OS are you on?

We found out it was a misconfiguration of our database. One of the columns was set to ‘JSON’ which was breaking the channel search functionality (e.g. when someone type ~channel_name).

Hi, @Alexander77703

Out of curiosity, can you please confirm which table and column were the cause of the issue? How did you fix the misconfiguration?

I would like to see if this can help other users who might potentially run into the same problem in the future. If you have any screen shots to share, that will be great too. Thanks.

We were playing around with adding some metadata to each channel in the channel table. We don’t want our changes to ever interfere with any developments that happen to the upstream Mattermost project and so one idea raised was to put all of our data under a _company column as JSON.

Our current project is to add per-channel retention periods, instead of the current server-wide retention period. The configuration issue was entirely our fault and was not caused by any mattermost-server base code / equivalent.