Mattermost, Inc.

403 Error When Creating New Webhook

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:

Summary

Hey. When trying to create a new webhook, I get an error message in the bottom left hand corner of the page that states: “You do not have the appropriate permissions”. According to the Mattermost logs, the following error is generated when clicking on the Save button:

“{“level”:“error”,“ts”:1574846356.7781525,“caller”:“mlog/log.go:174”,“msg”:“You do not have the appropriate permissions”,“path”:”/api/v4/hooks/incoming",“request_id”:“4ryofy6z3byb9cktqrkkbhsy8y”,“ip_addr”:“REMOVED”,“user_id”:“REMOVED”,“method”:“POST”,“err_where”:“Permissions”,“http_code”:403,“err_details”:“userId=REMOVED, permission=manage_incoming_webhooks”}"

Steps to reproduce

Go to “integrations/incoming_webhooks/add” and try to add a new webhook.

Expected behavior

Creating a new webhook.

Observed behavior

“You do not have the appropriate permissions”

The Mattermost installation is on version: 5.16.2

Many thanks,

Hello, @izacizac

I just tried to reproduce it on my end on the same version 5.16.2 but did not run into the same issue when creating an incoming webhook using a System Administrator account.

{"level":"debug","ts":1574879571.5091808,"caller":"web/handlers.go:60","msg":"request:","method":"POST","url":"/api/v4/channels/members/me/view"}
{"level":"debug","ts":1574879571.5175264,"caller":"web/handlers.go:60","msg":"request:","method":"GET","url":"/api/v4/users/me/teams/a6z45fudijr69n8686wast3bse/channels"}
{"level":"debug","ts":1574879571.5223076,"caller":"web/handlers.go:60","msg":"request:","method":"GET","url":"/api/v4/users/me/teams/a6z45fudijr69n8686wast3bse/channels/members"}
{"level":"debug","ts":1574879584.589997,"caller":"web/handlers.go:60","msg":"request:","method":"POST","url":"/api/v4/hooks/incoming"}
{"level":"debug","ts":1574879585.8925292,"caller":"web/handlers.go:60","msg":"request:","method":"POST","url":"/api/v4/channels/members/me/view"}
...
{"level":"debug","ts":1574879589.670335,"caller":"web/handlers.go:60","msg":"request:","method":"POST","url":"/api/v4/channels/members/me/view"}
{"level":"debug","ts":1574879591.2682254,"caller":"web/handlers.go:60","msg":"request:","method":"GET","url":"/api/v4/hooks/incoming"}
{"level":"debug","ts":1574879591.871824,"caller":"web/handlers.go:60","msg":"request:","method":"POST","url":"/api/v4/channels/members/me/view"}

May I know if your Mattermost instance implements any restrictions to webhook management based on the Restrict managing webhooks and slash commands documentation?

Hi @ahmaddanial

I think it probably does. I have only recently discovered that there is meant to be an admin console that I should have access to, to grant these permissions. Unfortunately as I have inherited the Linux server that hosts the GitLab and Mattermost instance, I am piecing together how it works. I have no idea how the Mattermost instance was installed/configured.

I’ve tried the following command on the Linux server to grant my user the system_admin role:

cd /opt/gitlab/embedded/bin/

./mattermost roles system_admin izac

But in return I am greeted with the following error:

panic: Unable to find i18n directory

Which lead me down a rabbit hole of trying to work out why this error occurs - but I have been unable to resolve it.

Do you have any idea why this error occurs?

Many thanks