[SOLVED] Matrix server can't federate

Hardware: VPS bought online ( Contabo )
YunoHost version: 4.2.6.1
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Ok, managed to install Synapse and all with a little bit of help (see here), but now my server won’t federate?

I was unable to reach a couple of friends and they checked my server using the federationtester and what they got is

Got 0 connection report. This usually means at least one error happened.

Connection Errors

Get “https://173.249.30.166:8448/_matrix/key/v2/server”: dial tcp 173.249.30.166:8448: connect: connection refusedGet “https://[2a02:c207:2061:3407::1]:8448/_matrix/key/v2/server”: dial tcp [2a02:c207:2061:3407::1]:8448: connect: connection refused

No SRV Records

Moreover, here for the json report.

Looking forward to the support of this cool community once again.
Thank you in advance.

Hi there and welcome to Yunohost !

Do you have a domain for this server ?
Did you activate / install the SSL certificate ?

Best,
Charly

Hey Charly,

Thank you for your reply.

I’m using a subdomain for this server with an activated/installed SSL certificate.

I believe it works formy XMPP account in fact.

Which just made me realise I’m using the same sub for both.
Might that be the problem? :upside_down_face:

Oh, well, I moved the XMPP chat app on a different subdomain, but the error still persist.

Hi again,

Have you given your Synapse app visitor access and also opened the relevant port in the firewall ?

Hello again!
Glad to see you. :grinning_face_with_smiling_eyes:

Yes to both.
Both 8448 and 8449 are mentioned as port and they’re open.
Also opened the ones relevant to the Turnserver as suggested by the email I received once installed Synapse.

How about doing this?

https://github.com/YunoHost-Apps/synapse_ynh#access-by-federation

Yeah, I’ve done that already as well.

Maybe I should try to clear everything and then restart the whole process with a new subdomain?

.this might help yes, but before doing this, how are you accessing Synapse, with Element installed from Yunohost or another client? You might wanna give visitor access to Element if you are using this app from Yunohost.

It may not be the root cause, but the federation tester outputs:

Get \"https://YOURDOMAIN.nohost.me/.well-known/matrix/server\": x509: certificate is valid for yunohost.org, www.yunohost.org, ns.yunohost.org, xmpp-upload.yunohost.org, not YOURDOMAIN.nohost.me

You should generate a proper Let’s Encrypt certificate for this subdomain.

Edit: I see it complains about _matrix._tcp.YOURDOMAIN.nohost.me record too. For this one, I think you cannot have it working since it is handled by YunoHost.

Sorry, I went on reinstalling before reading your last two replies (even though I’m sure Element had a visitor access and the subdomain a Let’s Encrypt certificate).

But now I’m having issues installing synapse again apparently?
This is the log.
The main issue seems to be inability to install dependencies:

Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - before the override, which is most probably a packaging bug, to recover you
Info: DEBUG - can remove the override manually with dpkg-statoverride
Info: DEBUG - + ynh_package_install --fix-broken
Info: DEBUG - + ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
Info: DEBUG - + ynh_wait_dpkg_free
Info: DEBUG - + return 0
Info: DEBUG - + LC_ALL=C
Info: DEBUG - + DEBIAN_FRONTEND=noninteractive
Info: DEBUG - + apt-get --assume-yes --quiet -o=Acquire::Retries=3 -o=Dpkg::Use-Pty=0 --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
Info: DEBUG - Reading package lists...
Info: DEBUG - Building dependency tree...
Info: DEBUG - Reading state information...
Info: DEBUG - 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Info: DEBUG - + [[ -n /tmp/tmp.Wu5EWvIx0J ]]
Info: DEBUG - + rm --recursive --force /tmp/tmp.Wu5EWvIx0J
Info: DEBUG - + ynh_package_is_installed synapse-ynh-deps
Info: DEBUG - + ynh_wait_dpkg_free
Info: DEBUG - + return 0
Info: DEBUG - + dpkg-query --show '--showformat=${Status}' synapse-ynh-deps
Info: DEBUG - + grep --count 'ok installed'
Info: DEBUG - + ynh_die '--message=Unable to install dependencies'
Warning: Removing the app following the installation failure...
Info: [+...................] > Loading installation settings...
Info: [#+..................] > Stopping and removing the systemd service
Info: [##+.................] > Removing the PostgreSQL database
Warning: Database matrix_synapse not found
Warning: User matrix_synapse not found
Info: [###++++++++.........] > Removing dependencies
Warning: E: Unable to locate package synapse-ynh-deps
Info: [###########+........] > Removing app main directory
Info: '/opt/yunohost/matrix-synapse' wasn't deleted because it doesn't exist.
Info: '/var/www/synapse' wasn't deleted because it doesn't exist.
Info: '/var/log/matrix-synapse' wasn't deleted because it doesn't exist.
Info: '/etc/matrix-synapse' wasn't deleted because it doesn't exist.
Info: '/etc/default/matrix-synapse' wasn't deleted because it doesn't exist.
Info: '/etc/default/coturn-synapse' wasn't deleted because it doesn't exist.
Info: '/etc/nginx/conf.d/matrix.mms.nohost.me.d/synapse_server_name.conf' wasn't deleted because it doesn't exist.
Info: [############+.......] > Removing nginx web server configuration
Info: '/etc/nginx/conf.d/matrix.mms.nohost.me.d/synapse.conf' wasn't deleted because it doesn't exist.
Info: '/etc/php/7.3/fpm/pool.d/synapse.conf' wasn't deleted because it doesn't exist.
Info: [#############+......] > Removing logrotate configuration
Info: [##############......] > Closing port 8448
Info: [##############+.....] > Closing port 5349
Info: [###############.....] > Closing port 5350
Info: [###############+++++] > Removing fail2ban configuration...
Info: '/etc/fail2ban/jail.d/synapse.conf' wasn't deleted because it doesn't exist.
Info: '/etc/fail2ban/filter.d/synapse.conf' wasn't deleted because it doesn't exist.
Info: [####################] > Removing the dedicated system user
Warning: The user matrix-synapse was not found
Info: Due of the backup core only feature the data directory in '/home/yunohost.app/matrix-synapse' was not removed. It need to be removed manually to purge app user data.
Info: [####################] > Removal of synapse completed

Might it be because the previous installation hasn’t been purged properly?

2021-07-29 08:02:43,693: DEBUG - dpkg: unrecoverable fatal error, aborting:
2021-07-29 08:02:43,693: DEBUG -  unknown system user 'matrix-synapse' in statoverride file; the system user got removed
2021-07-29 08:02:43,693: DEBUG - before the override, which is most probably a packaging bug, to recover you
2021-07-29 08:02:43,693: DEBUG - can remove the override manually with dpkg-statoverride

That’s a new one… :sweat_smile:

Let’s follow apt’s advice:

dpkg-statoverride --list will give you a list of the overrides, check out which paths rely on matrix-synapse. (weirdly I have none on my server with synapse).
You can then remove them with dpkg-statoverride --remove <path>.

Problem solved.
At least that one.
Thank you.

Now that I’ve reinstalled everything, I’m having a different kind of error though. :upside_down_face:

Got 2 connection reports.

Homeserver version: Synapse 1.37.1

It is possible that the MatchingServerName error below is caused by you entering the wrong URL in the federation tester, not because there is an actual issue with your federation. You should enter the server name into the Federation Tester, not the location where your server is. The server name is the public facing name of your server that appears at the end of usernames and room aliases.

## Connection Reports

### 173.249.30.166:8448

Checks

Error

MatchingServerName

Error

FutureValidUntilTS

Success

HasEd25519Key

Success

AllEd25519ChecksOK

Success

Ed25519Checks

Success

ed25519:a_hpOD

Success

ValidEd25519

MatchingSignature

ValidCertificates

Success

### [2a02:c207:2061:3407::1]:8448

Checks

Error

MatchingServerName

Error

FutureValidUntilTS

Success

HasEd25519Key

Success

AllEd25519ChecksOK

Success

Ed25519Checks

Success

ed25519:a_hpOD

Success

ValidEd25519

MatchingSignature

ValidCertificates

Success

## No SRV Records

And here there is the full json report.

Uninstalled and reinstalled again.
Working now.
The problem all along was the fact that I was choosing a name for my homeserver that was different from the name of the domain.

But, I mean, if there’s an option, why would that be wrong then?

I think the option is for a subdomain, not a completely different domain (not sure though).

My homeserver is on a subdomain.
Maybe the option is to just name it after the main domain instead?
Should try I guess…

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.