[solved] Slash command failed


I have an issue with a slash command.When I try my custom command I have this error:

Command with a trigger of ‘post’ failed

Steps to reproduce

My mattermost server is running on windows in a docker and is configured on
I set the site url to:
I added a slash command with this config:
Request URL :
Request Method: POST

I also have a flask server running on which has one route

@app.route('/post', methods=['POST', 'GET'])
def post():
    data = request.form

I added
"EnableInsecureOutgoingConnections": true,
"AllowedUntrustedInternalConnections": "localhost",
to config.json, default.json and config-docker.json

Expected behavior

When I try /post in the defaukt Town Square channel I get Command with a trigger of ‘post’ failed

detailed_error: ""
id: "api.command.execute_command.failed.app_error"
message: "Command with a trigger of 'post' failed"
request_id: "a5n1xkch77g9zb9u6a61456age"
status_code: 500

Do you have an idea to solve this ?

Hi @gloupmer,

Is that flask app running inside the Mattermost Docker container? (If that’s not the case, then Mattermost’s != flask’s . In other words, Mattermost won’t be able to reach the flask app.)

When I try with the flask server in the container, I can’t access the server on
I added the port 5000 to the container

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                                                                         NAMES
1379bc206848        mattermost/mattermost-preview   "/bin/sh -c ./docker…"   17 minutes ago      Up About a minute>5000/tcp,>8065/tcp, 3306/tcp, 33060/tcp,>8069/tcp   preview

I fixed that issue but still have the command failed

Hi @gloupmer, Would you be open to joining our Peer-to-Peer Help channel on our community server for more help on this issue?

I’m not sure what the solution is and I haven’t received feedback from our team in the past few days on this yet.

I fixed this by changing docker config

1 Like