You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
It would be nice if it was possible to validate the syntax of config file without running synapse (and possibly without having access to the network, database, certificates etc). It allows to validate config before restarting synapse and possibly having it not restart because of a typo. It would also allow config validation at "build time" before deployment for example on NixOS.
Random examples of prior work:
postgres -C
sshd -t
varnishd -C
nagios -v
collectd -t
nginx has a similar possibility but it insists in reading all certificates so you can't do the syntax check on another machine pre-deployment.
venv $ python3 -m synapse.config -c ~/src/nixpkgs/homeserver.yaml
You have set two incompatible options, expiry_time and expire_caches. Please only use the expire_caches and cache_entry_ttl options and delete the expiry_time option as it is deprecated.
Expiry_time is a deprecated option, please use the expire_caches and cache_entry_ttl options instead.
Traceback (most recent call last):
File "/nix/store/wnrc4daqbd6v5ifqlxsj75ky8556zy0p-python3-3.9.12/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/nix/store/wnrc4daqbd6v5ifqlxsj75ky8556zy0p-python3-3.9.12/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/__main__.py", line 56, in <module>
main(sys.argv)
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/__main__.py", line 30, in main
config = HomeServerConfig.load_config("", load_config_args)
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/_base.py", line 461, in load_config
obj, _ = cls.load_config_with_parser(config_parser, argv)
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/_base.py", line 532, in load_config_with_parser
obj.parse_config_dict(
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/_base.py", line 718, in parse_config_dict
self.invoke_all(
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/_base.py", line 347, in invoke_all
res[config_class.section] = getattr(config, func_name)(*args, **kwargs)
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/repository.py", line 120, in read_config
self.media_store_path = self.ensure_directory(
File "/tmp/venv/lib/python3.9/site-packages/synapse/config/_base.py", line 199, in ensure_directory
os.makedirs(dir_path, exist_ok=True)
File "/nix/store/wnrc4daqbd6v5ifqlxsj75ky8556zy0p-python3-3.9.12/lib/python3.9/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/nix/store/wnrc4daqbd6v5ifqlxsj75ky8556zy0p-python3-3.9.12/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/lib/matrix-synapse'
but as you can see it actually runs the full server and could not be done on another machine or in a sandbox.
The text was updated successfully, but these errors were encountered:
but as you can see it actually runs the full server and could not be done on another machine or in a sandbox.
no, it does not run the full server. Attempting to create directories is a bug in this instance - but if those directories exist or are successfully created, the command will exit rather than start listening on any ports, etc.
richvdh
changed the title
Feature request: command to validate the syntax of the config filepython3 -m synapse.config attempts to create directories for the media store
May 24, 2022
It would be nice if it was possible to validate the syntax of config file without running synapse (and possibly without having access to the network, database, certificates etc). It allows to validate config before restarting synapse and possibly having it not restart because of a typo. It would also allow config validation at "build time" before deployment for example on NixOS.
Random examples of prior work:
postgres -C
sshd -t
varnishd -C
nagios -v
collectd -t
nginx has a similar possibility but it insists in reading all certificates so you can't do the syntax check on another machine pre-deployment.
Originally posted by @symphorien in #12651 (comment)
It's possible to do something close now:
but as you can see it actually runs the full server and could not be done on another machine or in a sandbox.
The text was updated successfully, but these errors were encountered: