# \[SOLVED\] Matrix server can't federate

**URL:** <https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663>\
**Category:** Support apps\
**Tags:** synapse, english\
**Created:** [July 25, 2021, 10:04pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663 "2021-07-25T22:04:35Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 25, 2021, 10:04pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/1 "2021-07-25T22:04:35Z")

</div>

**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](https://forum.yunohost.org/t/solved-setup-matrix-homeserver/16662)), 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](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](https://federationtester.matrix.org/api/report?server_name=chat.mms.nohost.me) for the json report.

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

---

<div class="post-metadata">

**Author:** ![charly](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@charly](https://forum.yunohost.org/u/charly)\
**Post date:** [July 26, 2021, 8:15am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/2 "2021-07-26T08:15:32Z")

</div>

Hi there and welcome to Yunohost !

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

Best,  
Charly

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 26, 2021, 2:50pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/3 "2021-07-26T14:50:35Z")

</div>

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? 🙃

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 26, 2021, 6:31pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/4 "2021-07-26T18:31:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HoldMyGin](https://forum.yunohost.org/user_avatar/forum.yunohost.org/holdmygin/32/3701_2.png) [@HoldMyGin](https://forum.yunohost.org/u/HoldMyGin)\
**Post date:** [July 26, 2021, 9:32pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/5 "2021-07-26T21:32:52Z")

</div>

Hi again,

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

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 26, 2021, 10:31pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/6 "2021-07-26T22:31:57Z")

</div>

Hello again!  
Glad to see you. 😄

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.

---

<div class="post-metadata">

**Author:** ![HoldMyGin](https://forum.yunohost.org/user_avatar/forum.yunohost.org/holdmygin/32/3701_2.png) [@HoldMyGin](https://forum.yunohost.org/u/HoldMyGin)\
**Post date:** [July 27, 2021, 9:20am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/7 "2021-07-27T09:20:54Z")

</div>

How about doing this?

[https://github.com/YunoHost-Apps/synapse\_ynh#access-by-federation](https://github.com/YunoHost-Apps/synapse_ynh#access-by-federation)

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 27, 2021, 10:50pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/8 "2021-07-27T22:50:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![HoldMyGin](https://forum.yunohost.org/user_avatar/forum.yunohost.org/holdmygin/32/3701_2.png) [@HoldMyGin](https://forum.yunohost.org/u/HoldMyGin)\
**Post date:** [July 28, 2021, 10:43am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/9 "2021-07-28T10:43:38Z")

</div>

.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.

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [July 28, 2021, 11:43am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/10 "2021-07-28T11:43:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 29, 2021, 6:10am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/11 "2021-07-29T06:10:06Z")

</div>

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](https://paste.yunohost.org/raw/hevilusuqi) is the log.  
The main issue seems to be inability to install dependencies:

```auto
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?

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [July 29, 2021, 7:02am UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/12 "2021-07-29T07:02:27Z")

</div>

```auto
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… 😅

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>`.

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 29, 2021, 2:54pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/13 "2021-07-29T14:54:33Z")

</div>

Problem solved.  
At least that one.  
Thank you.

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

```auto
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](https://federationtester.matrix.org/api/report?server_name=matrix.mms.nohost.me)** there is the full json report.

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 30, 2021, 7:33pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/14 "2021-07-30T19:33:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![HoldMyGin](https://forum.yunohost.org/user_avatar/forum.yunohost.org/holdmygin/32/3701_2.png) [@HoldMyGin](https://forum.yunohost.org/u/HoldMyGin)\
**Post date:** [July 30, 2021, 9:02pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/15 "2021-07-30T21:02:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![unmy](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/u/dfb087/32.png) [@unmy](https://forum.yunohost.org/u/unmy)\
**Post date:** [July 30, 2021, 9:21pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/16 "2021-07-30T21:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [August 14, 2021, 9:22pm UTC](https://forum.yunohost.org/t/solved-matrix-server-cant-federate/16663/17 "2021-08-14T21:22:04Z")

</div>

Closed on August 14, 2021, 9:22pm UTC

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