matrix-org / sydent

Sydent: Reference Matrix Identity Server
http://matrix.org
Apache License 2.0
293 stars 84 forks source link

prometheus-client is required to start sydent #558

Closed lfom closed 1 year ago

lfom commented 1 year ago

Hello, there.

I have been using Sydent for a while, installed on Ubuntu 20.04 via pip, which I also use to do updates, and it has been working fine for many versions. But today I have updated it to version 2.5.3 and noticed the clients I use could not connect to the identity server. Checking the log, I noticed it was requiring prometheus-client:

Mar 15 00:49:37 systemd[1]: Started sydent.
Mar 15 00:49:37 python[13226]: Traceback (most recent call last):
Mar 15 00:49:37 python[13226]:   File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
Mar 15 00:49:37 python[13226]:     return _run_code(code, main_globals, None,
Mar 15 00:49:37 python[13226]:   File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
Mar 15 00:49:37 python[13226]:     exec(code, run_globals)
Mar 15 00:49:37 python[13226]:   File "/opt/sydent/lib/python3.8/site-packages/sydent/sydent.py", line 25, in <module>
Mar 15 00:49:37 python[13226]:     import prometheus_client
Mar 15 00:49:37 python[13226]: ModuleNotFoundError: No module named 'prometheus_client'
Mar 15 00:49:37 systemd[1]: sydent.service: Main process exited, code=exited, status=1/FAILURE
Mar 15 00:49:37 systemd[1]: sydent.service: Failed with result 'exit-code'.

Checking past issues, there was one that was closed with a merge that added it as an optional dependency.

Is there any way to disable it in sydent.conf or the only solution is to install the package? If the package is needed, it shouldn't be installed/updated when using pip?

Regards

H-Shay commented 1 year ago

Looks like https://github.com/matrix-org/sydent/pull/527 made the prometheus dependency mandatory, so I think you have to install it. This is reflected in the pyproject.toml file - note that we are moving towards using poetry for managing dependencies.