Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

email.notif_template_html and email.notif_template_text are missing from sample config #6960

Closed
richvdh opened this issue Feb 20, 2020 · 3 comments · Fixed by #6962
Closed

Comments

@richvdh
Copy link
Member

richvdh commented Feb 20, 2020

If you set email.enable_notifs: True, synapse will refuse to start unless you also set email.notif_template_html and email.notif_template_text, but these are not mentioned in the sample config

@richvdh
Copy link
Member Author

richvdh commented Feb 20, 2020

stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/app/homeserver.py", line 639, in <module>
    main()
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/app/homeserver.py", line 634, in main
    hs = setup(sys.argv[1:])
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/app/homeserver.py", line 319, in setup
    "Synapse Homeserver", config_options
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/config/_base.py", line 617, in load_or_generate_config
    config_dict, config_dir_path=config_dir_path, data_dir_path=data_dir_path
  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/emailconfig.py", line 264, in read_config
    % (", ".join(["email." + k for k in missing]),)
RuntimeError: email.enable_notifs is True but required keys are missing: email.notif_template_html, email.notif_template_text

@richvdh
Copy link
Member Author

richvdh commented Feb 20, 2020

Introduced in #6685

richvdh added a commit that referenced this issue Feb 20, 2020
 * Give `notif_template_html`, `notif_template_text` default values (fixes
   #6960)
 * Don't complain if `smtp_host` and `smtp_port` are unset, since they have
   sensible defaults (fixes #6961)
 * Raise errors as ConfigError rather than RuntimeError for nicer formatting
@richvdh richvdh linked a pull request Feb 20, 2020 that will close this issue
richvdh added a commit that referenced this issue Feb 24, 2020
 * Give `notif_template_html`, `notif_template_text` default values (fixes #6960)
 * Don't complain if `smtp_host` and `smtp_port` are unset, since they have sensible defaults (fixes #6961)
 * Set the example for `enable_notifs` to `True`, for consistency and because it's more useful
 * Raise errors as ConfigError rather than RuntimeError for nicer formatting
@richvdh
Copy link
Member Author

richvdh commented Feb 24, 2020

fixed by #6962

@richvdh richvdh closed this as completed Feb 24, 2020
phil-flex pushed a commit to phil-flex/synapse that referenced this issue Apr 15, 2020
 * Give `notif_template_html`, `notif_template_text` default values (fixes matrix-org#6960)
 * Don't complain if `smtp_host` and `smtp_port` are unset, since they have sensible defaults (fixes matrix-org#6961)
 * Set the example for `enable_notifs` to `True`, for consistency and because it's more useful
 * Raise errors as ConfigError rather than RuntimeError for nicer formatting
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant