synapse_port_db – KeyError: 'server_name'

Created on 13 Dec 2019  Â·  2Comments  Â·  Source: matrix-org/synapse

After the several warnings on your blog, I thoughts it's time to migrate from sqlite to postgres. (Though I must say so far synapse works great on sqlite for my 2 user installation.)

At the actual "port" step, I get the following error.

# synapse_port_db --sqlite-database homeserver.db.snapshot --postgres-config /etc/matrix-synapse/homeserver-postgres.yaml
Traceback (most recent call last):
  File "/usr/bin/synapse_port_db", line 1006, in <module>
    config.parse_config_dict(hs_config, "", "")
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/config/_base.py", line 639, in parse_config_dict
    data_dir_path=data_dir_path,
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/config/_base.py", line 254, in invoke_all
    res[name] = getattr(config, func_name)(*args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/config/server.py", line 64, in read_config
    self.server_name = config["server_name"]
KeyError: 'server_name'

I'm using the recent Debian/Ubuntu package on a fully updated Ubuntu Server 18.04:

# dpkg -l matrix-synapse-py3
ii  matrix-synapse-py3                  1.7.0+bionic1          amd64                  Open federated Instant Messaging and VoIP server

My server_name is declared in conf.d/server_name.yaml not in homeserver-postgres.yaml, as per Debian packaging. I guess this case should be considered in the port script, as many installations will use the Debian package.

bug p2

Most helpful comment

Workaround: temporarily add the server_name to homeserver-postgres.yaml seems to do the trick.

All 2 comments

Workaround: temporarily add the server_name to homeserver-postgres.yaml seems to do the trick.

dup #6370

Was this page helpful?
0 / 5 - 0 ratings