Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maubot 0.2.0 + Encryption fails to start #148

Closed
H4Mm3r opened this issue Jan 3, 2022 · 4 comments
Closed

Maubot 0.2.0 + Encryption fails to start #148

H4Mm3r opened this issue Jan 3, 2022 · 4 comments

Comments

@H4Mm3r
Copy link

H4Mm3r commented Jan 3, 2022

Hi,

Maubot was working, but after pip install --upgrade maubot[e2be], this happen :

[2022-01-03 18:41:51,218] [INFO@mau.init] Initializing maubot 0.2.0
[2022-01-03 18:41:51,218] [DEBUG@maubot.instance.zip] Preloading plugins...
[2022-01-03 18:41:51,251] [CRITICAL@mau.init] Unexpected error in initialization
Traceback (most recent call last):
File "/opt/matrix-bots/maubot/lib/python3.9/site-packages/mautrix/util/program.py", line 93, in _prepare
self.prepare()
File "/opt/matrix-bots/maubot/lib/python3.9/site-packages/maubot/main.py", line 55, in prepare
clients = init_client_class(self.config, self.loop)
File "/opt/matrix-bots/maubot/lib/python3.9/site-packages/maubot/client.py", line 449, in init
Client.crypto_db = AsyncDatabase.create(db_url, upgrade_table=PgCryptoStore.upgrade_table)
AttributeError: 'NoneType' object has no attribute 'upgrade_table'

@le-firehawk
Copy link

Haven't found a solution, but did look into the code briefly. From a functional Maubot 0.2.0 instance, the lib/.../client.py is identical to the non-function Encrypted instance (SHA 256 hash 2316cb0c844b1cacfe2ee5aac19ea457c9a55be3ba6418db268d7bfd53f30e15 verified).

Considering the error message, PgCryptoStore is the issue. This variable is created on line 34 of client.py:
'from mautrix.crypto import OlmMachine, StateStore as CryptoStateStore, PgCryptoStore'

I then entered a Python3.9 instance and ran this command, and indeed PgCryptoStore did become None
image

It seems that a couple of modules in the mautrix package are not loading properly, namely PgCryptoStore and PgCryptoStateStore
image

Operating on a hunch, I copied the old mautrix library to the directory running Maubot with encryption (note: this is not a solution)

Now, when running 'python3 -m maubot', a new error appears
image

Hope this helps someone identify a solution

@tulir
Copy link
Member

tulir commented Jan 4, 2022

Looks like I just forgot to move asyncpg to the non-optional requirements, so installing that will fix it

@le-firehawk
Copy link

Thanks for that. Yes I actually just caught onto that, was gonna comment the issue was asyncpg as I discovered by following the import calls from mautrix to this point.
image

Appreciate your efforts tulir. As a python guy myself, I know how difficult debugging can be at times

@H4Mm3r
Copy link
Author

H4Mm3r commented Jan 4, 2022

pip install asyncpg fix the problem, thank you guys, best wishes !

@tulir tulir closed this as completed in 3399717 Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants