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.55k stars 616 forks source link

Failed to join channel #201

Closed bkeys closed 7 years ago

bkeys commented 7 years ago

Which version of matterbridge are you using?

version: 0.15.0 822605c

If you're having problems with mattermost please specify mattermost version.

3.10.0

Please describe the expected behavior.

Bridging the IRC chat

Please describe the actual behavior.

Use logs from running matterbridge -debug if possible.

NFO[2017-06-22T20:48:51-04:00] Enabling debug                               
INFO[2017-06-22T20:48:51-04:00] Running version 0.15.0 822605c               
INFO[2017-06-22T20:48:51-04:00] Starting gateway: gateway2                   
INFO[2017-06-22T20:48:51-04:00] Starting bridge: irc.dmux                    
INFO[2017-06-22T20:48:51-04:00] Connecting localhost:6667                     module=irc
2017/06/22 20:48:51 Connected to localhost:6667 ([::1]:6667)
2017/06/22 20:48:51 <-- :irc.example.com NOTICE Auth :*** Looking up your hostname...
2017/06/22 20:48:51 <-- :irc.example.com NOTICE Auth :*** Could not resolve your hostname: Domain name not found; using your IP address (0::1) instead.
2017/06/22 20:48:51 --> NICK matterbot
2017/06/22 20:48:51 --> USER matterbot 0.0.0.0 0.0.0.0 :matterbot
2017/06/22 20:48:51 <-- PING :o`SFNZFOrE
2017/06/22 20:48:51 <-- :irc.example.com NOTICE matterbot :*** If you are having problems connecting due to ping timeouts, please type /quote PONG o`SFNZFOrE or /raw PONG o`SFNZFOrE now.
2017/06/22 20:48:51 --> PONG :o`SFNZFOrE
2017/06/22 20:48:52 <-- :irc.example.com NOTICE Auth :Welcome to Omega!
2017/06/22 20:48:52 <-- :irc.example.com 001 matterbot :Welcome to the Omega IRC Network matterbot!matterbot@0::1
DEBU[2017-06-22T20:48:52-04:00] Registering callbacks                         module=irc
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 001 matterbot :Welcome to the Omega IRC Network matterbot!matterbot@0::1"  module=irc
2017/06/22 20:48:52 <-- :irc.example.com 002 matterbot :Your host is irc.example.com, running version InspIRCd-2.0
2017/06/22 20:48:52 <-- :irc.example.com 003 matterbot :This server was created 10:27:55 May 18 2017
2017/06/22 20:48:52 <-- :irc.example.com 004 matterbot irc.example.com InspIRCd-2.0 BIRWcgikorsw ACHIKMOPRTXabcefghijklmnopqrstvz HIXabefghjkloqv
2017/06/22 20:48:52 <-- :irc.example.com 005 matterbot AWAYLEN=200 CALLERID=g CASEMAPPING=rfc1459 CHANMODES=IXbeg,k,Hfjl,ACKMOPRTcimnprstz CHANNELLEN=64 CHANTYPES=# CHARSET=ascii ELIST=MU ESILENCE EXCEPTS=e EXTBAN=,ACORTUcjrz FNC INVEX=I :are supported by this server
2017/06/22 20:48:52 <-- :irc.example.com 005 matterbot KICKLEN=255 MAP MAXBANS=60 MAXCHANNELS=20 MAXPARA=32 MAXTARGETS=20 MODES=20 NAMESX NETWORK=Omega NICKLEN=31 OPERLOG PREFIX=(qaohv)~&@%+ SILENCE=32 :are supported by this server
2017/06/22 20:48:52 <-- :irc.example.com 005 matterbot STATUSMSG=~&@%+ TOPICLEN=307 UHNAMES USERIP VBANLIST WALLCHOPS WALLVOICES :are supported by this server
2017/06/22 20:48:52 <-- :irc.example.com 042 matterbot 058AAAAB1 :your unique ID
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 042 matterbot 058AAAAB1 :your unique ID"  module=irc
2017/06/22 20:48:52 <-- :irc.example.com 375 matterbot :irc.example.com message of the day
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-  _____                        _____   _____    _____      _
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :- |_   _|                      |_   _| |  __ \  / ____|    | |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-   | |    _ __    ___   _ __    | |   | |__) || |       __| |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-   | |   | '_ \  / __| | '_ \   | |   |  _  / | |      / _` |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-  _| |_  | | | | \__ \ | |_) | _| |_  | | \ \ | |____ | (_| |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :- |_____| |_| |_| |___/ | .__/ |_____| |_|  \_\ \_____| \__,_|
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-     __________________| |_______________________________
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-    |__________________|_|_______________________________|
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-                         Putting the ricer in IRCer since 2007
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-        //\
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-        V  \    WELCOME TO AN INSPIRCD NETWORK
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-         \  \_    If you see this, I am probably new.
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-          \,'.`-.   If I'm not new, my owner is lazy.
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-           |\ `. `.
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-           ( \  `. `-.                        _,.-:\
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-            \ \   `.  `-._             __..--' ,-';/
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-             \ `.   `-.   `-..___..---'   _.--' ,'/
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-              `. `.    `-._        __..--'    ,' /
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-                `. `-_     ``--..''       _.-' ,'
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-                  `-_ `-.___        __,--'   ,'
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-                     `-.__  `----"""    __.-'
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-                          `--..____..--'
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-         ---- To change, see motd.txt.example -----
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-        /                                          \
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       /   * Web: http://www.inspircd.org           \
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       |   * IRC: irc.inspircd.org #inspircd        |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       |   * Docs: http://wiki.inspircd.org         |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       |   * Bugs: http://inspircd.org/bugs         |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       |                                            |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       | We hope you like this software. Please do  |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       | make  sure  you  put  some  effort  into   |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       | your configuration, though, so you love it.|
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       | Enjoy.                                     |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       |                                            |
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-       \                   -- The InspIRCd Team    /
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-        -------------------------------------------
2017/06/22 20:48:52 <-- :irc.example.com 372 matterbot :-
2017/06/22 20:48:52 <-- :irc.example.com 376 matterbot :End of message of the day.
2017/06/22 20:48:52 <-- :irc.example.com 251 matterbot :There are 2 users and 0 invisible on 1 servers
2017/06/22 20:48:52 <-- :irc.example.com 254 matterbot 1 :channels formed
2017/06/22 20:48:52 <-- :irc.example.com 255 matterbot :I have 2 clients and 0 servers
2017/06/22 20:48:52 <-- :irc.example.com 265 matterbot :Current Local Users: 2  Max: 3
2017/06/22 20:48:52 <-- :irc.example.com 266 matterbot :Current Global Users: 2  Max: 3
2017/06/22 20:48:52 <-- :irc.example.com 501 matterbot x :is unknown mode char to me
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 501 matterbot x :is unknown mode char to me"  module=irc
INFO[2017-06-22T20:48:52-04:00] Connection succeeded                          module=irc
INFO[2017-06-22T20:48:52-04:00] irc.dmux: joining #DMUX (#DMUXirc.dmux)      
DEBU[2017-06-22T20:48:52-04:00] using key channelkey for channel #DMUX       
INFO[2017-06-22T20:48:52-04:00] Starting bridge: mattermost.work             
INFO[2017-06-22T20:48:52-04:00] Connecting dbot (team: bot) on chat.bkeys.org  module=mattermost
DEBU[2017-06-22T20:48:52-04:00] handle &irc.Event{Code:"JOIN", Raw:":matterbot!matterbot@0::1 JOIN :#dmux", Nick:"matterbot", Host:"0::1", Source:"matterbot!matterbot@0::1", User:"matterbot", Arguments:[]string{"#dmux"}, Connection:(*irc.Connection)(0xc4200731e0)}  module=irc
DEBU[2017-06-22T20:48:52-04:00] ":matterbot!matterbot@0::1 JOIN :#dmux"       module=irc
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 332 matterbot #dmux :DMUX Official Channel | https://notabug.org/bkeys/DMUX"  module=irc
DEBU[2017-06-22T20:48:52-04:00] 333: Topic set by bkeys [Thunderbird@host-168-33.mnmimel.minneapolis.mn.us.clients.pavlovmedia.net] [2017-06-22 20:32:01 -0400 EDT]  module=irc
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 333 matterbot #dmux bkeys!Thunderbird@host-168-33.mnmimel.minneapolis.mn.us.clients.pavlovmedia.net 1498177921"  module=irc
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 353 matterbot = #dmux :matterbot @bkeys "  module=irc
DEBU[2017-06-22T20:48:52-04:00] ":irc.example.com 366 matterbot #dmux :End of /NAMES list."  module=irc
INFO[2017-06-22T20:48:52-04:00] Found version 3.10.0.3.10.0.ac71458914afcd24a2aa2ce442edb792.false  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] trying login bot dbot chat.bkeys.org          module=matterclient
DEBU[2017-06-22T20:48:52-04:00] initUser(): found our team bot (id: 5k4cgeotmjydjyg35p5u5hkzmw)  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WsClient: making connection: wss://chat.bkeys.org/api/v3/users/websocket  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WsClient: connected                           module=matterclient
INFO[2017-06-22T20:48:52-04:00] Connection succeeded                          module=mattermost
INFO[2017-06-22T20:48:52-04:00] mattermost.work: joining DMUX (DMUXmattermost.work) 
DEBU[2017-06-22T20:48:52-04:00] Joining                                       module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WsReceiver: model.WebSocketEvent{Event:"hello", Data:map[string]interface {}{"server_version":"3.10.0.3.10.0.ac71458914afcd24a2aa2ce442edb792.false"}, Broadcast:(*model.WebsocketBroadcast)(0xc420296180), PreComputeJson:[]uint8(nil)}  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WS PING                                       module=matterclient
DEBU[2017-06-22T20:48:52-04:00] sendWsRequest &model.WebSocketRequest{Seq:1, Action:"ping", Data:map[string]interface {}(nil), Session:model.Session{Id:"", Token:"", CreateAt:0, ExpiresAt:0, LastActivityAt:0, UserId:"", DeviceId:"", Roles:"", IsOAuth:false, Props:model.StringMap(nil), TeamMembers:[]*model.TeamMember(nil)}, T:(i18n.TranslateFunc)(nil), Locale:""}  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] Choosing API based Mattermost connection: true  module=mattermost
DEBU[2017-06-22T20:48:52-04:00] map[string]interface {}{"server_version":"3.10.0.3.10.0.ac71458914afcd24a2aa2ce442edb792.false"}  module=mattermost
DEBU[2017-06-22T20:48:52-04:00] WsReceiver: model.WebSocketResponse{Status:"OK", SeqReply:1, Data:map[string]interface {}{"server_time":1.498178932732e+12, "text":"pong", "version":"3.10.0", "node_id":""}, Error:(*model.AppError)(nil), PreComputeJson:[]uint8(nil)}  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WS PONG received                              module=matterclient
DEBU[2017-06-22T20:48:52-04:00] WsReceiver: model.WebSocketEvent{Event:"status_change", Data:map[string]interface {}{"status":"online", "user_id":"n76wntn613gxugopwexpekchgr"}, Broadcast:(*model.WebsocketBroadcast)(0xc420296440), PreComputeJson:[]uint8(nil)}  module=matterclient
DEBU[2017-06-22T20:48:52-04:00] map[string]interface {}{"status":"online", "user_id":"n76wntn613gxugopwexpekchgr"}  module=mattermost
FATA[2017-06-22T20:48:52-04:00] Starting gateway failed: Bridge mattermost.work failed to join channel: failed to join

Any steps to reproduce the behavior?

I simply run matterbridge

Please add your configuration file

(be sure to exclude or anonymize private data (tokens/passwords))

[irc]
    [irc.dmux]
    Server="localhost:6667"
    Nick="matterbot"

[mattermost]
    [mattermost.work]
    useAPI=true
    #do not prefix it wit http:// or https://
    Server="chat.com"
    Team="bot"
    Login="dbot"
    Password="my_password"
    PrefixMessagesWithNick=false

#simpler config possible since v0.10.2
[[gateway]]
name="gateway2"
enable=true
inout = [
    { account="irc.dmux", channel="#DMUX", options={key="channelkey"}},
    { account="mattermost.work", channel="DMUX" },
]
bkeys commented 7 years ago

I can join the same IRC channel and see that the bot pops in and out as well

42wim commented 7 years ago

try lowercase IRC and mattermost channel names

bkeys commented 7 years ago

I changed it to lower case and it still fails

ghost commented 7 years ago

2017/06/23 11:37:00 Connected to kappakappa.alpha:6697 (x.y.z.a:6697) INFO[2017-06-23T11:37:01-04:00] Connection succeeded
connection to irc server gets established perfectly well it fails at this point FATA[2017-06-23T11:37:01-04:00] Starting gateway failed: Bridge mattermost.work failed to join channel: failed to join

42wim commented 7 years ago

Are you sure the channel exists ? The bot can only join channels that exist, it can not create a new channel on mattermost

bkeys commented 7 years ago

Yes because we have IRC users hanging out in the chat; and we can see the bot pop in and out. It disconnects with the message

10:37:01 AM - dbot [dbot@v-64-94-238-142.unman-vds.internap-atlanta.nfoservers.com] entered the room.
10:37:01 AM - dbot has left the room (Quit: The TLS connection was non-properly terminated.).
42wim commented 7 years ago
DEBU[2017-06-22T20:48:52-04:00] Joining                                       module=matterclient

This line means it didn't find the channel id, after Joining it should show a channel id

42wim commented 7 years ago

The channel on mattermost, not irc. If it's a private group, it can not join a private group, it needs to be invited.

bkeys commented 7 years ago

By group you mean team right?

42wim commented 7 years ago

Private group is called private channels now. Is the channel you want to join on mattermost a private channel, if so you have to invite the bot user.

Ofcourse the bot has to be in the same team as the channel is.

bkeys commented 7 years ago

capture Yeah it appears to be in the channel, which is public

42wim commented 7 years ago

ok, great, could you show me the url of the channel you took the screenshot from ?

https://yourserver/yourteam/channels/yourchannel

The yourserver part can be redacted :)

bkeys commented 7 years ago

https://myserver.com/main/channels/town-square

42wim commented 7 years ago

ok, so the channel isn't dmux but the channel is "town-square" config should look as below

inout = [
    { account="irc.dmux", channel="#dmux", options={key="channelkey"}},
    { account="mattermost.work", channel="town-square" },
]
bkeys commented 7 years ago

Great now it links! Thank you