Mattermost, Inc.

Guest Account seeing Error on initial log-in

Summary

When we invite a new Guest account, after they get the e-mail invitation and log into Mattermost they see an error “Team Not Found”

Steps to reproduce

  • Invite a new Guest user
  • Have them log in after they receive the invitation e-mail

Expected behavior

They would be logged into the team/channels which were specified in the invitation modal.

Observed behavior

When they tried to log in they saw an error. It seems that after some time delay this issue resolves itself, as they are able to log-in and are added to the team correctly.

What Mattermost server version are you on?

5.21.0, however I saw the same behavior even on 5.19.0

Do you see any errors in Mattermost logs when this happens?

Here are the errors I managed to dig up from the logs around the time the Guest tried to log in initially. Note the Log level is set to ERROR. And the user_id matches the one of the Guest user.

{"level":"error","ts":1584546320.5513833,"caller":"mlog/log.go:175","msg":"You do not have the appropriate permissions","path":"/api/v4/teams/yz5mafigdt8iimjqii4ai7byxe/members","request_id":"fch1uq4w1id39k3ak46tpzxm3e","ip_addr":"10.252.213.206","user_id":"qcw9yao9ai8g3x3zoin4u4mtsc","method":"POST","err_where":"Permissions","http_code":403,"err_details":"userId=qcw9yao9ai8g3x3zoin4u4mtsc, permission=join_public_teams"}
{"level":"error","ts":1584546334.5095377,"caller":"mlog/log.go:175","msg":"You do not have the appropriate permissions","path":"/api/v4/teams/yz5mafigdt8iimjqii4ai7byxe/members","request_id":"m446mtf17fdufyn9x5uiqk565e","ip_addr":"10.252.213.206","user_id":"qcw9yao9ai8g3x3zoin4u4mtsc","method":"POST","err_where":"Permissions","http_code":403,"err_details":"userId=qcw9yao9ai8g3x3zoin4u4mtsc, permission=join_public_teams"}

Hello, @attzonko

Can you also please check the settings of the team that the Guest is supposed to join?

Since the log complains about permissions, I would like to see if any of these could be the reason behind it. Thanks.

So this error happened to multiple guests on two different teams.

Team #1, has the settings exactly like you show.
Team #2, has the second setting set to No.

However, please note, without any changes from admin side, the Guests were able to successfully log in a few minutes later and were placed in the correct channels. After all, during the invite process the user filling in the invite has to put the channels they wish the Guests to be quarantined in, hence those Guests should be automatically added of the team the channels are a part of.

Hello, @attzonko

Thank you for the confirmation from your end. Just to be sure on this, can you please confirm that the issue is happening on both teams?

This is correct. I have attempted to reproduce this issue on my end and the guest account should be automatically be added to the channels that was specified during the invite process. For example, this is the log entry that I am getting after I signed up for a guest account on my test instance. No specific error:

{"level":"debug","ts":1584924700.4467294,"caller":"mlog/log.go:163","msg":"No channel member found for that user ID and channel ID","path":"/api/v4/channels/XXXXXXXXXX/members/XXXXXXXXXX","request_id":"x3sbbthuu389pd6hm1f5r6t58o","ip_addr":"XX.X.X.X","user_id":"XXXXXXXXXX","method":"GET","err_where":"SqlChannelStore.GetMember","http_code":404,"err_details":"channel_id=kt9m99xmyt8i8r3xrhw5i5nesyuser_id=3jpum7w46pretqmntuaibhkkuo,sql: no rows in result set"}

After the sign up process was completed, I logged out and logged in again without any issues. Can you please confirm if the affected user was invited to multiple teams across multiple channels?

Also, how is the size of your Mattermost instance like? Can you provide a screen shot of System Console > Site Statistics from your end?

can you please confirm that the issue is happening on both teams?

Yes, it happened on both teams.

Can you please confirm if the affected user was invited to multiple teams across multiple channels?

No, each user was only invited to a single team, single channel.

Can you provide a screen shot of System Console > Site Statistics from your end?