Matrix won't start with Public Registration enabled

Hi,

Just setting up Matrix for the first time. It seems that the Matrix server refuses to start when public registration is enabled. When I disable public registration the server starts just fine.

It appears to have been deprecated according to the logs. Does anyone have any further info on this situation? Will it be possible for public registrations in the future, or is there some alternative method in the works? Thanks.

Here is the relevant (I hope) journalctl:

Blockquote
Jul 20 19:00:04 debian systemd[1]: Started Synapse Matrix homeserver.
Jul 20 19:00:04 debian sudo[7006]: pam_unix(sudo:session): session closed for user root
Jul 20 19:00:04 debian /usr/bin/plinth[578]: # matrixsynapse public-registration status
Jul 20 19:00:04 debian sudo[7189]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/matrixsynapse public-registration status
Jul 20 19:00:04 debian sudo[7189]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 20 19:00:04 debian sudo[7189]: pam_unix(sudo:session): session closed for user root
Jul 20 19:00:04 debian /usr/bin/plinth[578]: # letsencrypt get-status
Jul 20 19:00:04 debian sudo[7193]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt get-status
Jul 20 19:00:04 debian sudo[7193]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 20 19:00:05 debian python3[7178]: WARNING: The ‘room_invite_state_types’ configuration setting is now deprecated,
Jul 20 19:00:05 debian python3[7178]: and replaced with ‘room_prejoin_state’. New features may not work correctly
Jul 20 19:00:05 debian python3[7178]: unless ‘room_invite_state_types’ is removed. See the sample configuration file for
Jul 20 19:00:05 debian python3[7178]: details of ‘room_prejoin_state’.
Jul 20 19:00:05 debian python3[7178]: --------------------------------------------------------------------------------
Jul 20 19:00:05 debian python3[7178]: This server is configured to use ‘matrix.org’ as its trusted key server via the
Jul 20 19:00:05 debian python3[7178]: ‘trusted_key_servers’ config option. ‘matrix.org’ is a good choice for a key
Jul 20 19:00:05 debian python3[7178]: server since it is long-lived, stable and trusted. However, some admins may
Jul 20 19:00:05 debian python3[7178]: wish to use another server for this purpose.
Jul 20 19:00:05 debian python3[7178]: To suppress this warning and continue using ‘matrix.org’, admins should set
Jul 20 19:00:05 debian python3[7178]: ‘suppress_key_server_warning’ to ‘true’ in homeserver.yaml.
Jul 20 19:00:05 debian python3[7178]: --------------------------------------------------------------------------------
Jul 20 19:00:05 debian python3[7178]: Config is missing macaroon_secret_key
Jul 20 19:00:05 debian synapse[7178]: root: [main] ***** STARTING SERVER *****
Jul 20 19:00:05 debian synapse[7178]: root: [main] Server /usr/lib/python3/dist-packages/synapse/app/homeserver.py version 1.61.0
Jul 20 19:00:05 debian synapse[7178]: synapse.app: [sentinel] Failed to listen on 0.0.0.0, continuing because listening on [::]
Jul 20 19:00:05 debian sudo[7193]: pam_unix(sudo:session): session closed for user root
Jul 20 19:00:05 debian /usr/bin/plinth[578]: # letsencrypt compare-certificate --managing-app matrixsynapse --source-private-key-path /etc/letsencryp>
Jul 20 19:00:05 debian sudo[7209]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt compare-certificate --managing-app ma>
Jul 20 19:00:05 debian sudo[7209]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 20 19:00:05 debian sudo[7209]: pam_unix(sudo:session): session closed for user root
Jul 20 19:01:01 debian systemd[1]: snapperd.service: Succeeded.
Jul 20 19:01:17 debian /usr/bin/plinth[578]: # matrixsynapse public-registration status
Jul 20 19:01:17 debian slapd[829]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
Jul 20 19:01:17 debian slapd[829]: slap_global_control: unrecognized control: 1.3.6.1.4.1.4203.666.5.16
Jul 20 19:01:17 debian sudo[7235]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/matrixsynapse public-registration status
Jul 20 19:01:17 debian sudo[7235]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 20 19:01:18 debian sudo[7235]: pam_unix(sudo:session): session closed for user root
Blockquote

Steps to Reproduce

  1. Start Matrix server with public registrations enabled.

Expected Results
Matrix server starts

Actual results
Matrix server fails to start

Information

  • FreedomBox version: 22.15
  • Hardware: Homebuilt PC
  • How did you install FreedomBox?: ‘apt install freedombox’

Update: I realize public registration should work from what I understand. So I think my initial presumption was wrong.

I tried enabling DMZ for the FB server on my router thinking maybe additional port(s) were needed? After enabling DMZ I rebooted the FB server, then started the Matrix service with public registrations enabled.

But still the Matrix server refuses to start for some reason.

Journalctl:

Blockquote
Jul 21 09:49:51 debian systemd[1]: Starting Synapse Matrix homeserver…
Jul 21 09:49:51 debian systemd[1]: matrix-synapse.service: Control process exited, code=killed, status=15/TERM
Jul 21 09:49:51 debian systemd[1]: matrix-synapse.service: Failed with result ‘signal’.
Jul 21 09:49:51 debian systemd[1]: Stopped Synapse Matrix homeserver.
Jul 21 09:49:51 debian sudo[1825]: pam_unix(sudo:session): session closed for user root
Jul 21 09:49:51 debian /usr/bin/plinth[570]: # apache disable --name matrix-synapse-plinth --kind config
Jul 21 09:49:51 debian sudo[1880]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/apache disable --name matrix-synapse-plinth --kind config
Jul 21 09:49:51 debian sudo[1880]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 21 09:49:51 debian systemd[1]: Reloading The Apache HTTP Server.
Jul 21 09:49:51 debian systemd[1]: Reloaded The Apache HTTP Server.
Jul 21 09:49:51 debian sudo[1880]: pam_unix(sudo:session): session closed for user root
Jul 21 09:49:51 debian /usr/bin/plinth[570]: Firewall ports closed - Matrix Synapse, [‘matrix-synapse-plinth’]
Jul 21 09:49:51 debian /usr/bin/plinth[570]: # matrixsynapse public-registration status
Jul 21 09:49:51 debian sudo[1960]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/matrixsynapse public-registration status
Jul 21 09:49:51 debian sudo[1960]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 21 09:49:51 debian sudo[1960]: pam_unix(sudo:session): session closed for user root
Jul 21 09:49:51 debian /usr/bin/plinth[570]: # letsencrypt get-status
Jul 21 09:49:51 debian sudo[1964]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt get-status
Jul 21 09:49:51 debian sudo[1964]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=124)
Jul 21 09:49:52 debian sudo[1964]: pam_unix(sudo:session): session closed for user root
Jul 21 09:49:52 debian /usr/bin/plinth[570]: # letsencrypt compare-certificate --managing-app matrixsynapse --source-private-key-path /etc/letsencrypt/live/mydomain.duckdns.org/privkey.pem --so>
Jul 21 09:49:52 debian sudo[2027]: plinth : PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt compare-certificate --managing-app matrixsynapse --source-private-key-path /etc/letsen>
Blockquote

I started looking at my homeserver.yaml settings. Is that a good place to start?

*EDIT: Also, here is the diagnostic view for what it’s worth (I think it merely confirms that the Matrix Synapse service failed to start):

Honestly, I’ve looked at it before and I have no idea what the yaml standard people were smoking when they invented it.

Looking at what you posted, I think you aught remove it and re-install. It seems like something did not go according to plan.

Do you have other services installed and running fine?

The only other thing I installed on Freedombox was Coturn. I tested the TURN server using Jami on a few devices and it works fine. The devices could not communicate previous to installing Coturn, so I presume that means it’s working.

Everything seems okay except for Matrix refusing to start when public registrations are enabled. Which makes no sense. Given my skill level with Linux, which is pretty poor, I guess my only option is to reinstall. Maybe wipe this box and start over if a reinstall of Matrix doesn’t help. Thanks.

I guess the only way to uninstall an app on Freedombox is by CLI?

I’ve been working on this all day. :sob:

*EDIT: I’m not the type to moan about stuff when it breaks, and I am eternally grateful this project exists. I just completely uninstalled Matrix Synapse and did a system cleanup while keeping my Coturn server running (which works fine).

Sorry to say, same result. Matrix server refuses to start with public registration enabled. I guess it’s just one of those days.
I will nuke the entire box and start with a fresh Debian 11 server install.

Another update: I wiped the box and started over from scratch with Debian 11 (no window manager with standard apps) and now it says the application is not available with my distribution. Ha! I literally installed Matrix last night on Debian 11 on the same box. What terrible luck huh?! I guess I will have to do it all over again! :rofl:

I have the same issue. Matrix server doesn’t start when public registration is enabled.

1 Like

Good to know it’s not just me, but sorry it doesn’t work for you either. I just tried again with a fresh instance of FB in case something went wrong the first time. This time making sure my domain name was all good, valid cert installed, then installed Coturn. Still, Matrix won’t start with public registration enabled.

Maybe it is by design to decrease attack surface? However, why would that option be available at all then? Hopefully, this can be addressed soon. I wish I had more knowledge in this area.

Did you turn on “Frequent Feature Updates”?

Hi, Yes I did. I just tried a manual update as well and tried restarting Matrix server. Unfortunately, the same situation.

1 Like

It worked fine at the beginning. This bug is occuring since a few weeks.

2 Likes

Okay. Well, I’m happy to gather any details necessary to help T/S this. Whatever I can do within my ability.

The not-available-on-debian sounds like the issue with a dependency not being available. I encountered this when I first installed myself a couple months ago. See it here → Matrix Install Failure on Debian Bullseye - Work Around

There was a break about a month ago where a matrix update relied on some dependency and it broke on freedombox for about a day as well. → Matrix stopped working

1 Like

Thanks for that. Did an autoremove of Matrix-Synapse server, then installed the Python dependency mentioned, reinstalled Matrix-Synapse again.

As before, the installation itself worked just fine and the server started. But when I enable public registration and update settings, Matrix service fails. Also tried stopping Matrix service first, then enabled public registration again, next I started the Matrix service, but it still refuses to start.

1 Like

I’ve not (nor desired) public registration. The closest I’ve gotten is trying to federate (which went poorly, if you look up that thread).

I’ll be watching to see if someone else has a solution. I must admit I’ve not been running matrix for long.

1 Like

The same problem here.

1 Like

@Frankie This is exactly what was happening to me, because of your thread I turned off public registration and everything worked. I turn public registration on, and it started failing tests again.

Did you ever get this resolved?

looking through the issues this was a fix for freedombox 22.14…

It’s not working for me in freedombox FreedomBox version 22.15

This was the supposed fix for 22.14:

emorrp1: So, this is an upstream issue?
yes and no, yes upstream has merged a code change in develop that will incidentally fix it, but no it’s a packaging upload that caused the problem to start occurring yesterday
Fix Synapse git info missing in version strings (#12973) ¡ matrix-org/synapse@f30bcbd ¡ GitHub
Copying details from other channel:
Error: Synapse 1.57.1 needs matrix-common~=1.1.0, but got matrix-common==1.2.1
Fix: sudo sed -i '/common/s/~=/>=/' /usr/lib/python3/dist-packages/matrix_synapse-1.57.1.dist-info/METADATA

IT’s not working for freedombox 22.15
@johnny got any advice please?

@sunil could you guys please provide a measure of support I’m absolutely at my wits end here, and I need this project going yesterday.

@jvalleroy any advice even a little bit of directional pointing would help please. I bought 2 of your guys units.

@emorrp1 I need a resolution for this please please please just point me in the right direction.

I am in a role of responsibility. The idea to go with your guyses server was mine, and I own it. Now I dont have out of the box functionality I basically have two broken units. Love the project, and I know i’m close to it working, but I need a fix or something…

1 Like

This is still an issue for me. I’ve been waiting on the next FB update which should resolve this. My understanding is that there is indeed an issue upstream that is holding things up.

it seems like yes there’s an issue with public registration, the one gentleman told me that it’s because it’s configured to use LDAP.

I turn public registration off, and diagnostics says everything is a go. Is this also happening with your issue?