42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.65k stars 618 forks source link

Failure to Get Mattermost Channel ID #1010

Closed distributedOne closed 4 years ago

distributedOne commented 4 years ago

Describe the bug Using an install of mattermost version: 5.18.0 and matterbridge (c0be3e585a5ef6c6dc4d517e891fd10bc053c195) fails to start the gateway when connecting to the mattermost channel. I executed with -debug and found that the channel ID was coming back empty. The mattermost instance reported the ID so I copied that into the src, built + installed resulting in matterbridge starting and joining the mattermost channel without issue.

To Reproduce Steps to reproduce the behavior:

Please see the above description.

Expected behavior A clear and concise description of what you expected to happen.

Matterbridge should successfully retrieve the channel ID for a mattermost channel.

Screenshots/debug logs If applicable, add screenshots to help explain your problem. Use logs from running matterbridge -debug if possible.

[0001]  INFO mattermost:   Connection succeeded
[0001]  INFO mattermost:   mattermost.snc: joining https://<mattermost-install>/<team>/channels/<channel> (ID: https://<mattermost-install>/<team>/channels/<channel>mattermost.snc)
[0001] FATAL main:         Starting gateway failed: Bridge mattermost.snc failed to join channel: Could not find channel ID for channel https://<mattermost-install>/<team>/channels/<channel>

Environment (please complete the following information):

Additional context Please add your configuration file (be sure to exclude or anonymize private data (tokens/passwords))

[irc]
    [irc.oftcnet]
    Server="irc.oftc.net:6697"
    Nick="<bot-irc-user>"
    UseTLS=true
    SkipTLSVerify=false
    RunCommands=["PRIVMSG nickserv :IDENTIFY <bot-irc-user> <bot-irc-pass>"]
    ColorNicks=true

[mattermost]
    [mattermost.snc]
    Server="<mattermost-install>:443"
    Team="<team>"
    Login="<bot name>"
    Token="<bot token>"
    PrefixMessagesWithNick=true

[general]
RemoteNickFormat="[{PROTOCOL}/{BRANCH}] <{NICK}> "

[[gateway]]
name="scattered-gateway"
enable=true

    [[gateway.out]]
    account="mattermost.snc"
    channel="https://<mattermost-install>/<team>/channels/<mattermost-channel>"

    [[gateway.in]]
    account="irc.oftcnet"
    channel="<irc-channel>"
42wim commented 4 years ago

Your config is wrong, should be

    [[gateway.out]]
    account="mattermost.snc"
    channel="<mattermost-channel>"
distributedOne commented 4 years ago

Thanks for taking the time to look this over and reply. I've confirmed my problem and closed this out.