mattermost-community / mattermost-plugin-welcomebot

Apache License 2.0
64 stars 41 forks source link

Action button faulty #89

Open boredomdenied opened 2 years ago

boredomdenied commented 2 years ago

I have latest mattermost installed with fresh install of welcomebot. This is mattermost-docker latest stable docker, docker-compose running ubuntu 20.04LTS

I have enabled the plugin. Adapted the config.json as follows:

    "PluginSettings": {
        "Enable": true,
        "EnableUploads": false,
        "AllowInsecureDownloadURL": false,
        "EnableHealthCheck": true,
        "Directory": "./plugins",
        "ClientDirectory": "./client/plugins",
        "Plugins": {
            "com.mattermost.custom-attributes": {
                "customattributes": [
                    {
                        "GroupIDs": "",
                        "Name": "Interests",
                        "TeamIDs": [],
                        "UserIDs": [
                            "fjadklgjaklbdsalj"
                        ]
                    }
                ]
            },
            "com.mattermost.welcomebot": {
                "WelcomeMessages": [
                    {
                        "Actions": [
                            {
                                "ActionDisplayName": "Social Butterfly",
                                "ActionName": "social-butterfly",
                                "ActionSuccessfulMessage": [
                                    "User successfully joined the Telegram and Community channels"
                                ],
                                "ActionType": "button",
                                "ChannelsAddedTo": [
                                    "telegram",
                                    "community"
                                ]
                            }
                        ],
                        "AttachmentMessage": [
                            "Please inform us which roles you are interested in filling. Click the buttons to enable the relevant channels"
                        ],
                        "DelayInSeconds": 3,
                        "Message": [
                            "Welcome to [redacted]. We're happy to have you around."
                        ],
                        "TeamName": "ou-test"
                    }
                ]
            },

I see welcomebot for new user initial login. My custom text is visible. The button does not result in the result message or channel joins.

Here is the output inmattermost.log:

{"timestamp":"2022-01-06 20:45:04.660 Z","level":"debug","msg":"Action integration error.","caller":"web/context.go:101","path":"/api/v4/posts/hrht1jmf3prq9qmotgebjeax8c/actions/jupo71zsxfd4dpx7wypx8g5q7y","request_id":"3n5ju8i47bb3dd85fyhtfmrh6w","ip_addr":"42.42.42.42","user_id":"msjwkk9qoiygtetqrebihwgb4a","method":"POST","err_where":"DoActionRequest","http_code":400,"err_details":"err=Post \"https://[url.redacted]/plugins/com.mattermost.welcomebot/addchannels\": dial tcp 127.0.1.1:443: connect: connection refused"}
{"timestamp":"2022-01-06 20:45:04.661 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:156","method":"POST","url":"/api/v4/posts/hrht1jmf3prq9qmotgebjeax8c/actions/jupo71zsxfd4dpx7wypx8g5q7y","request_id":"3n5ju8i47bb3dd85fyhtfmrh6w","host":"[url.redacted]","scheme":"https","status_code":"400"}

Are users reporting success with the docker installation? Any ideas where to go from here?

boredomdenied commented 2 years ago

I found this issue that seems related. Link to a potential solution though it's two years old and a fix was said to be already in:

https://github.com/matterpoll/matterpoll/issues/174#issuecomment-534236534

MatterMost Fix:

https://github.com/mattermost/mattermost-server/pull/12156

Can someone please inform me which is the best route to take to resolve issue. Thank you

boredomdenied commented 2 years ago

https://github.com/mattermost/mattermost-server/pull/12156/files It looks like this should be hitting the local network yet doesn't for some reason?

boredomdenied commented 2 years ago

As per:

https://github.com/moussetc/mattermost-plugin-giphy/issues/21#issuecomment-604713546

I tried shifting this attribute in the config.json file

From: "AllowedUntrustedInternalConnections": "",

To:

"AllowedUntrustedInternalConnections": "127.0.1.1, [my-url-redacted], localhost, 127.0.0.1",

Same result