Things I couldn’t find elsewhere

Mautrix-Signal bridge dropping Dendrite

Dendrite English Matrix Signal Uncategorized

4 minutes

Symptom:

2024-02-18T18:06:31Z ERR The homeserver is outdated (supported spec versions are below minimum required by bridge) bridge_requires=v1.4 server_supports=v1.2

Resolution:

When I decided on a Matrix home server the choice fell on Dendrite. More modern (and IMHO secure) development environment, and seemingly a better fit for the size of the server I was shooting for. Also, Dendrite was very close to Synapse in functionality and - as far as I understood - would soon be feature complete and from then on go in lockstep.

That’s no longer the case. Dendrite is rapidly falling behind, with very little developer attention. I’m speculating it’s Element’s success with governments that has meant that the focus has shifted onto their needs - and all that development is being made on Synapse. With no migration possible between Dendrite and Synapse (nor the third party Conduit server that I would other recommend people to look to today) that puts us existing Dendrite server admins in a bind.

A few weeks ago, the Mautrix-Signal bridge dropped support for API v1.2 which is still the highest Dendrite advertises. When I brought this up on the development channel, the project lead - tulir - was very helpful and added both an “ignore outdated server” flag to the bridge, as well as made a commit to Dendrite that increased the API level support for the appservice.

I’ve now tested running the latest bridge docker image, as well as a manually built image from Dendrite HEAD, and my Signal bridge is now back up an working. Seeing as there’s already someone else reporting this problem, I’m writing this post as documentation on what I needed to do.

In the docker-compose for your server, just add :latest to the Mautrix-Signal image. That will give you the possibility to ignore the outdated server (Dendrite will still report v1.2 API level). To actually set the flag, add a new entrypoint like this to your docker-compose:

entrypoint: "/usr/bin/mautrix-signal -c /data/config.yaml -r /data/registration.yaml --ignore-unsupported-server"

The next step involves cloning the Dendrite repo and building your own docker image. If you’re doing this on the same machine as the server is running on, it’s probably enough to just do this:

$ docker build . -t matrixdotorg/dendrite-monolith

You can verify when Dendrite starts up that it’s reporting the same git commit as HEAD is currently. At the time of this post, that looks like this:

Dendrite version 0.13.6+e9deb52

Now, hopefully this is all anyone needs to do - but in my case while I first thought it was a complete success (signal messages sent during the downtime suddenly appeared in my Matrix client) I had no contact the the signalbot and messages I wrote from Matrix didn’t go through to signal. The rest of this post deals with how I solved (I think) that.

Dendrite log complained about lots of 404s:

time="2024-02-18T17:29:37.671572670Z" level=error msg="Unable to send transaction to appservice, backing off for 1m4s" appservice=signal error="received HTTP status code 404 from appservice url http://mautrix-signal:29328/transactions/1708274113422557376?access_token=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"

The bridge log contained an entry like this on startup:

2024-02-18T17:51:29Z WRN Failed to login with shared secret error="failed to POST /_matrix/client/v3/login: M_FORBIDDEN (HTTP 403): The username or password was incorrect or the account does not exist." user_id=@XXXXX:YYYYYYYYY

When I looked up the current documentation on how to set the bridge up, I noticed a slight difference. In my config I used the Dendrite shared secret for account signup, while the documentation talked about as_token. I also specified my actual username with exclusive: true, while the documentation talked about a general homeserver user regex and exclusive: false.

After I made those changes to my appservice registration file, the error went away. It still didn’t seem to work at first, and I had a bunch of other errors in the log:

2024-02-18T18:09:45Z ERR error retrieving profile error="profile key not found" action="fetch contact then try and update with profile" function=Puppet.UpdateInfo profile_uuid=XXXXXXXXXXXXXXXXXXXXXXXXXX signal_user_id=YYYYYYYYYYYYYYYYYYYYYYYYYYYY user_id=@ZZZZZZZZZZZZZZZZZZZZZZZZ

… but after a while those disappeared and all messages came through in both direction as they should. Mentioning it here in case it turns out to be important for others too.

As to the future of Dendrite I’m worried. The Matrix ecosystem is unhealthy at the moment with way too much focus on the matrix.org server. It seems Conduit might be the non-Synapse future, but without migration tools I don’t see many server admins making that jump. It’s enough to have a “family sized” instance for that to become a true pain.