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 was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Synapse 1.12.0 requires sqlite3 even if you're using postgres #7127
Turns out that some distributions don't ship the sqlite3 library as part of their python:
(env) $ synctl start
Starting ...
Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/app/homeserver.py", line 53, in <module>
from synapse.federation.transport.server import TransportLayerServer
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/federation/transport/server.py", line 48, in <module>
from synapse.server import HomeServer
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/server.py", line 31, in <module>
from synapse.api.filtering import Filtering
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/api/filtering.py", line 30, in <module>
from synapse.storage.presence import UserPresenceState
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/__init__.py", line 30, in <module>
from synapse.storage.data_stores import DataStores
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/data_stores/__init__.py", line 18, in <module>
from synapse.storage.data_stores.state import StateGroupDataStore
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/data_stores/state/__init__.py", line 16, in <module>
from synapse.storage.data_stores.state.store import StateGroupDataStore # noqa: F401
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/data_stores/state/store.py", line 26, in <module>
from synapse.storage._base import SQLBaseStore
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/_base.py", line 27, in <module>
from synapse.storage.database import LoggingTransaction # noqa: F401
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/database.py", line 38, in <module>
from synapse.storage.background_updates import BackgroundUpdater
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/background_updates.py", line 25, in <module>
from . import engines
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/engines/__init__.py", line 19, in <module>
from .sqlite import Sqlite3Engine
File "/var/synapse/synapse/env/lib/python3.7/site-packages/synapse/storage/engines/sqlite.py", line 15, in <module>
import sqlite3
File "/usr/local/lib/python3.7/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
error starting (exit code: 1); see above for logs
Thanks to richvdh for mentioning this in Synapse room. I shot my server too and was unable install sqlite 3 stuff. A minor update would be great, then I can also update Twister lib. Thank you.
Hmm, I gave an initial stab at this in #7143 but don't seem to be able to come up with a solution that solves the problem, appeases mypy and produces working code, so... I leave this up to someone else.
Sorry, yes! I know, but I always take the servers down for offline Snapshot before updating and I want to keep downtime as short as possible. Thank you for fixing things.
Activity
richvdh commentedon Mar 23, 2020
Introduced in #6987 I think
anoadragon453 commentedon Mar 23, 2020
Does
synapse/synapse/storage/engines/sqlite.py
Line 15 in 4170b2e
richvdh commentedon Mar 23, 2020
yes
richvdh commentedon Mar 23, 2020
or rather, it probably needs to be be made conditional and only used when type-checking
matoro commentedon Mar 23, 2020
Just tried to upgrade and ran into this. Will this be fixed in a minor update to the 1.12 release?
richvdh commentedon Mar 25, 2020
workaround is to install whatever package contains the sqlite library on your OS.
I suspect it only affects FreeBSD, since linux distros ship sqlite as part of their stock python (which is why we didn't notice this sooner).
vsatmydynipnet commentedon Mar 25, 2020
Thanks to richvdh for mentioning this in Synapse room. I shot my server too and was unable install sqlite 3 stuff. A minor update would be great, then I can also update Twister lib. Thank you.
anoadragon453 commentedon Mar 25, 2020
Hmm, I gave an initial stab at this in #7143 but don't seem to be able to come up with a solution that solves the problem, appeases mypy and produces working code, so... I leave this up to someone else.
auscompgeek commentedon Mar 27, 2020
Looking at #7143, I think I can come up with a correct fix. Give me a few minutes.
Only import sqlite3 when type checking (#7155)
richvdh commentedon Mar 27, 2020
fixed by #7155
richvdh commentedon Mar 27, 2020
I assume you mean "Twisted", but Twisted is not related to this issue.
vsatmydynipnet commentedon Mar 27, 2020
Sorry, yes! I know, but I always take the servers down for offline Snapshot before updating and I want to keep downtime as short as possible. Thank you for fixing things.
Only import sqlite3 when type checking
Only import sqlite3 when type checking
Only import sqlite3 when type checking