mymindstorm / matrix-appservice-mumble

Matrix <--> Murmur Bridge
https://matrix.org/docs/projects/bridge/matrix-appservice-mumble
MIT License
29 stars 8 forks source link

Bridge creation hangs after connecting to Murmur #25

Closed bertiebaggio closed 3 years ago

bertiebaggio commented 3 years ago

Hi, I was hoping to get this cool-looking bridge up and running. To this end, I spun up a dev homeserver, and started up a newly-compiled 1.4.0 murmur server.

However, though it reports that it can successfully connect to the gRPC endpoint on murmur, the bot never appears in the room. It has been invited!

I've tried tracking through the code but I am not familiar enough with how bridges work. Perhaps it get hung up awaiting setupCallBacks:

https://github.com/mymindstorm/matrix-appservice-mumble/blob/504ce43760166bce00d122943533161546027805/src/main.ts#L173

or somewhere around there, given where the console messages halt and due to lack of error messages.

some pointers as where to look would be appreciated. Can the latest git HEAD be built simply by git clone-ing and running build.sh ? If so, I can give debugging it a shot myself- or at least add some more debug console.logs !

Config etc information included below.

Cheers :)


From the container running MAM:

bertieb@matrix-mumble-bridge-test:~$ matrix-appservice-mumble -c mumble-config.yaml -f mumble-registration.yaml 
Connecting to Murmur...
Connetion to Murmur established!
Matrix-side listening on port 8090

nothing more is printed.

mumble-config.yaml:

# Address where Murmur is listening for gRPC. This will be in Murmur's logs.
mumble_grpc_endpoint: '192.168.1.218:50051'
# Homeserver domain
domain: 'example.org'
# Homeserver URL
homeserverURL: 'https://matrix.example.org/'
# Internal ID of the Matrix room to use for bridge admin commands.
# Anyone in this room will be able to link Mumble channels to Matrix.
# Type "help" for commands, you should only use this room for bot admin tasks.
# On Riot this is under 'Room Settings' => 'Advanced' => 'Room information'.
matrixRoom: '!REDACTEDROOMID:example.org'

mumble-registration.yml:

id: REDACTED_ID
hs_token: REDACTED_HS_TOKEN
as_token: REDACTED_AS_TOKEN
namespaces:
  users:
    - exclusive: true
      regex: '@mumble_.*'
  aliases: []
  rooms: []
url: 'http://192.168.1.209:8090'
sender_localpart: mumblebot
rate_limited: true
protocols: null

I can curl MAM on port 8090 from the HS, though it gives an error:

curl 192.168.1.209:8090                                                                                 
<!DOCTYPE html>                                                                                                                         
<html lang="en">                                                    
<head>                                                                                                                                  
<meta charset="utf-8">                                                                                                                  
<title>Error</title>         
</head>                           
<body>                     
<pre>Cannot GET /</pre>                                             
</body>                    
</html>

and I can curl the homeserver URL from the container running MAM:

$ curl https://matrix.example.org/
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
bertiebaggio commented 3 years ago

Can the latest git HEAD be built simply by git clone-ing and running build.sh ?

I did this (with npm i) and it seems to work. Does this mean the version on nodejs is out of date? It says it was last updated 9 months ago.

Cheers!

mymindstorm commented 3 years ago

I apologize for the confusion, yes the version on npm is out of date. Hence the disclaimer in the readme. I haven't had the chance to investigate an issue with the GRPC api that is blocking me from finishing the changes in command-parse.

bertiebaggio commented 3 years ago

Edit: didn't mean to close, my click accuracy was way off! As below, happy for it to stay closed or be reopened

No worries, thanks for taking the time to reply! I had a look at the other install options and couldn't see much difference in the early parts at a brief glance, though I see they do diverge :)

I was asking some questions in the #mumble IRC/matrix channel and was given fair warning about gRPC there being pretty experimental there!

Is there a specific issue for the gRPC problem?

(Side note: I am happy for this issue to be closed out, or left as a search hit for others who stumble into the same issue; whatever you feel is best)

mymindstorm commented 3 years ago

No worries, thanks for taking the time to reply!

No problem. Thank you for the detailed error report, I wish more people would give me reports like this one.

I was asking some questions in the #mumble IRC/matrix channel and was given fair warning about gRPC there being pretty experimental there!

Is there a specific issue for the gRPC problem?

Yep, might have been a better idea to use ICE, at this point I can't remember why I gave up on using it.

In terms of specifics, I can't remember exactly as it has been a while. I think the issue boiled down to channelGet not returning anything when I was trying to get parent channels from it for sending recursive messages. My plan was to investigate using GDB on murmur's end.

https://github.com/mymindstorm/matrix-appservice-mumble/blob/c70e08ede372b5163ce71be2eb1ed0918f9b0678/src/Murmur.ts#L333-L339

where channel is the one that is sent with the USERTEXTMESSAGE event:

https://github.com/mymindstorm/matrix-appservice-mumble/blob/097eadf4b7abb9e53afa09e9e859082022702da8/src/Murmur.ts#L124

bertiebaggio commented 3 years ago

Yep, might have been a better idea to use ICE, at this point I can't remember why I gave up on using it.

While it's experimental at this stage, gRPC feels more future-proof in the long run; not that I'm familiar with mumble-server dev!

In terms of specifics, I can't remember exactly as it has been a while. I think the issue boiled down to channelGet not returning anything when I was trying to get parent channels from it for sending recursive messages. My plan was to investigate using GDB on murmur's end.

Thanks for the explanation. I'm not well-versed in either the gRPC protocol or TypeScript, but if anything comes up in my playing around with the bridge I'll explore further.

Now that I've got the murmur side and the bridge functional, my intention is actually to Dockerise this so that it can be installed using matrix-docker-ansible-deploy. If I get somewhere useful with it -- no promises! -- and if you're interested, I can open an issue ± PR here once some meaningful progress has been made :)

mymindstorm commented 3 years ago

I can open an issue ± PR here once some meaningful progress has been made :)

I'd be happy to have the contribution.

mymindstorm commented 3 years ago

I can open an issue ± PR here once some meaningful progress has been made :)

I'd be happy to have the contribution.

bertiebaggio commented 3 years ago

I'd be happy to have the contribution.

Great! I'll work in a fork, and will probably seek guidance from the MDAD folks on what they consider best practices. I'll update here (or likely in a new issue/PR) when I get somewhere. Cheers again :)