Mattermost bot seems to be forbidden, but it is not

Describe the issue/error/question

I’m trying to setup a mattermost auth for a bot user. Note that the issue I’ll discuss here is not present with regular (user) accounts, but happens only for bots.

After creating a bot account, I generate an access token and save it in n8n credentials.
Then, I add a mattermost node and try to send a message using those credentials.

In the Channel ID field, n8n complains that the user is not authorized with the error message reported below.
But the token is actually working from the very same node: if I set a channel id (with the bare string), I can execute the node and I correctly receive the message in mattermost.

Therefore, the credentials do work.

It seems there is an issue with the UI alone, when trying to retrieve the channels list, but the auth is actually valid.

I’m not sure what’s the proper way to verify what request is performed by the UI and check if there is something wrong with it.

What is the error message (if any)?

Issues:
  - There was a problem loading the parameter options from server: "Forbidden - perhaps check your credentials?"

Please share the workflow

Information on your n8n setup

  • n8n version: 0.156.9
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker

Think the issue is that the bot is allowed to post a message but not to query the channels. For that reason will it work fine when you execute the node but display the error on the channel parameter where it tries to resolve the name.

Thank you for the answer, I’ll try to gather more details on how the request is performed and ask mattermost devs details about bot permissions.

1 Like

I’ve run into the very same problem.
Any news on how to resolve this?

It’s a bit of a showstopper.

@Alessandro_Re, have you gotten any further insights?
Any thread on the mattermost side to link to?

For now we have “abused” a normal user for n8n.
It seems like the user still cannot list the channels - but can send messages.
Similar to what @jan said.

hi @tcurdt! no, sorry, but no news on that: I gave up on that road and used other approach to solve my problem. I don’t know when I’ll give this approach another try.

For others finding this:
We are using a non-bot user for now. That seems to be working.
But that’s really not ideal.

1 Like