-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Unhelpful error message when importlib.metadata.version
returns None (which it shouldn't do normally!)
#12223
Comments
@Videothek Any chance you have the logs from with the error in it? |
I'm on Ubuntu 20.04.4 LTS. I ran the same upgrade to Synapse 1.54.0. I did not run into any issues. |
Unfortunately not because installed the complete backup. I will try to update to the new version today again and will keep this issue up to date. If the same error occurs i will post the error message and the logs here. |
Ok so this is good news because it means it is only a me problem. As mentioned i will try to install it again today. So far i was ok with having the config in my homeserver.yaml maybe its time to switch. Do you have any tutorial how to add the settings to /etc/matrix-synapse/conf.d ? I can also check my apt lists later, maybe i have the wrong repos installed which i dont think but you never know. |
Possibly #12185. though it's hard to tell without the logs. If you're running on sqlite with |
I looked at the errors and mine were diffrent as far as i remember correctly there wasnt anything regarding sqlite in the errors. I am aware that troubleshooting without logs is nearly impossible. But today i will try to upgrade again and will post the logs and errors if the same problem occures again. |
Well as promised i upgraded matrix-synapse. It throws the errors again so i will just post them here maybe anybody can help me. systemctl status matrix-synapse.service throws following:
And executing journalctl -xe throwes this:
And the logs are especially useless with giving no Error or anything at all. Maybe someone can help me because not upgrading to a new Version is never a good fix. Just for clearance: I keept my modifyed homeserver.yaml when asked during updating. Thanks in Advance. |
So for matrix it is the same key and for the postgresql i dont have any special key. |
I'm not able to reproduce this using an Ubuntu 20.04 docker image. Can you please run |
Ok weird seems like i have a specific problem. @DMRobertson This is the output of
|
That pip freeze list matches what I see. You could try adding a line which prints out the version information before everything goes wrong. E.g. edit --- /opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/util/check_dependencies_orig.py 2022-03-15 17:10:44.788970350 +0000
+++ /opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/util/check_dependencies.py 2022-03-15 17:11:05.672812181 +0000
@@ -164,6 +164,7 @@
errors.append(_not_installed(requirement, extra))
else:
# We specify prereleases=True to allow prereleases such as RCs.
+ print(f"DEBUG: {requirement}, {must_be_installed}, {dist}, {dist.version!r}")
if not requirement.specifier.contains(dist.version, prereleases=True):
deps_unfulfilled.append(requirement.name)
errors.append(_incorrect_version(requirement, dist.version, extra))
|
@DMRobertson Ok so first of all thank you for your reply. Unfortunately it hasnt fixed anything. I added the following to
No the error is this:
|
I changed the content of the file because i figured that the first two lines are unnecessary. So it looks like this:
The error persits anyways but changed:
|
The point of this is to work out what your problem is; we can't provide a fix until we understand the root cause.
The example I gave was a "unified diff" to explain how to make the change (and give the nice highlighting on github). In a nutshell:
After doing so, the file should look like this:
|
Yeah makes sense, just tell me what you need me to do to figure out the root cause. Thank you for explaning that to me, i am not that familiar with coding. With the correct lines in the code it spits out this:
Maybe i have done something wrong again so just let me know what you think is the problem. Just that i said it, i copied your code to the beginning of the file, so there are outcommented lines above and the rest of the file comes after that. Thank you in advance. |
Hi @Videothek, and thanks for bearing with me. I think it might be easier to download a copy of the file which has my debug changes applied. It is available here. You can apply this to your server with the following command. I wouldn't normally recommend this, since this command will download and overwrite a file onto your system which will ultimately get run by Synapse. (In general, you should be extremely suspicious if someone asks you to run a command you don't understand.)
To undo this, run |
Hey @DMRobertson thank you for your patience. I have replaced the file and it spits out errors again but diffrent once than last time:
I really hope we are coming the solution closer. I am considering installing a fresh ubuntu server and test if a clean install would fix it. Is there a good way to backup messages and user settings to import them on a fresh install? |
For some reason,
You could try
to see if that helps. Failing that, I'd suggest
I'd save a clean install as a last resort. This should all be kept in the database that Synapse uses. If you're going to do a clean install, you must back this up. You probably also wants to backup the configuration files for Synapse itself. #synapse:matrix.org would probably be able to better advise. |
Possibly due to python/importlib_metadata#291 (comment)? |
ok weird, yeah sure.
running
I tried I tried Yeah i also would love to see this instance working again. |
Was this the full form?: |
@reivilibre makes a good point --- see if that gets you anywhere. Failing that, my only other suggestion would be to delete the leftover metadata directory, then try to start Synapse again.
|
No it was without the full path, i will try that later. |
True, i will try that later i am currently not home but should be in one hour, than i will test this. |
@DMRobertson @reivilibre Ok so after running After trying to start matrix it throws py errors again. So what is the next step? |
Can we see these errors please? |
@DMRobertson sure, sorry.
|
Thanks. Can you please try:
|
@DMRobertson i did it in the same order as you said. The error output is as follows:
|
How odd. Something has also gone wrong with the
|
@DMRobertson it seems like you hit the nail on the head, thank you. It works now after doing your steps.
Could you maybe summerize what the problem was and if there is any solutions without running your file. (no offense but as you said running files you dont have any clue about with private messages on risk i dont feel very well) |
Thanks for going through all of this. I'm glad to hear it's working now!
Certainly. Synapse contains code which will check that any packages it needs requires installed and running the right version. I recently changed this in the Synapse 1.54 release: it now uses a different mechanism ( This isn't something you should normally see during an installation; I'm not sure why this happened and you shouldn't expect to have to do this in the future. In any case, the fix was: delete the virtual environment (1), then reinstall a clean virtual environment (2). Step (3) overwrites the checking code with a version that includes extra debug information. I asked you to do this in case things still were broken. You can undo this change by running Does that make sense? In the meantime I'll change this checking code to detect this situation and provide a more useful error message. |
importlib.metadata.version
returns None (which it shouldn't do normally!)
minor correction: |
Description
I cant say it for sure but i just wanted to post it here just that you are aware of this problem. Today my Homeserver was running normally till it wasn't anymore. I got some python syntax errors. I tried to reinstall matrix-synapse-py3 but it hasn't worked. I reseted my homeserver.yaml to the default but the problem persisted. I checked for possible updates with apt but that wasn't the case either. I brought back my backup from yesterday and it worked again. After running apt update and apt list --upgradable i saw that matrix has an update. So i figured that it must be the unattended upgrade that installed the new version which somehow broke my server.
Steps to reproduce
I expected it to work fine and it doesn't. I needed to bring up my backup.
Version information
Version: 1.44.0
python version: 3.8.10
Install method: package manager (apt)
The text was updated successfully, but these errors were encountered: