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

sqlite3.OperationalError: no such table: event_txn_id_device_id when upgrading from Docker v1.89.0 to v1.92.2 #16335

@Anthial

Description

@Anthial

Description

Messages cannot be sent. When attempting to send a message the server logs a database error.

Steps to reproduce

Note, I do not currently have the capabilities to do this fresh, but assume a normal upgrade path from somewhere around v1.70.

  1. Run Synapse Docker v1.89.0 with sqlite3
  2. Upgrade to v1.92.2 via docker compose pull
  3. Messages can no longer be sent

Homeserver

the.eldritch.gift

Synapse Version

v1.92.2

Installation Method

Docker (matrixdotorg/synapse)

Database

SQLite (Docker Default)

Workers

Single process

Platform

Distro: Pop OS 22.04
Hardware:

  • CPU: Intel(R) Celeron(R) N4505 @ 2.00GHz
  • 16GB DDR4 RAM
  • 500GB Storage

Configuration

No response

Relevant log output

docker-synapse-1  | 2023-09-17 12:52:14,536 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 0/5
docker-synapse-1  | 2023-09-17 12:52:14,537 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 1/5
docker-synapse-1  | 2023-09-17 12:52:14,537 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 2/5
docker-synapse-1  | 2023-09-17 12:52:14,538 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 3/5
docker-synapse-1  | 2023-09-17 12:52:14,538 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 4/5
docker-synapse-1  | 2023-09-17 12:52:14,539 - synapse.storage.txn - 780 - WARNING - PUT-287 - [TXN OPERROR] {get_event_id_from_transaction_id_and_device_id-575} no such table: event_txn_id_device_id 5/5
docker-synapse-1  | 2023-09-17 12:52:14,539 - synapse.http.server - 140 - ERROR - PUT-287 - Failed handle request via 'RoomSendEventRestServlet': <XForwardedForRequest at 0x7f35bb9654d0 method='PUT' uri='/_matrix/client/v3/rooms/!bMPYjpwMVArbXrMnrM%3Athe.eldritch.gift/send/m.room.encrypted/m1694955131659.2' clientproto='HTTP/1.1' site='8008'>
docker-synapse-1  | Traceback (most recent call last):
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
docker-synapse-1  |     result = context.run(
docker-synapse-1  |              ^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
docker-synapse-1  |     return g.throw(self.type, self.value, self.tb)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/rest/client/room.py", line 366, in _do
docker-synapse-1  |     ) = await self.event_creation_handler.create_and_send_nonmember_event(
docker-synapse-1  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/handlers/message.py", line 1012, in create_and_send_nonmember_event
docker-synapse-1  |     event = await self.get_event_from_transaction(
docker-synapse-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/handlers/message.py", line 931, in get_event_from_transaction
docker-synapse-1  |     existing_event_id = await self.get_event_id_from_transaction(
docker-synapse-1  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/handlers/message.py", line 901, in get_event_id_from_transaction
docker-synapse-1  |     await self.store.get_event_id_from_transaction_id_and_device_id(
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/databases/main/events_worker.py", line 2031, in get_event_id_from_transaction_id_and_device_id
docker-synapse-1  |     return await self.db_pool.simple_select_one_onecol(
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 1709, in simple_select_one_onecol
docker-synapse-1  |     return await self.runInteraction(
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 945, in runInteraction
docker-synapse-1  |     return await delay_cancellation(_runInteraction())
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
docker-synapse-1  |     result = context.run(
docker-synapse-1  |              ^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
docker-synapse-1  |     return g.throw(self.type, self.value, self.tb)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 911, in _runInteraction
docker-synapse-1  |     result = await self.runWithConnection(
docker-synapse-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 1040, in runWithConnection
docker-synapse-1  |     return await make_deferred_yieldable(
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/threadpool.py", line 244, in inContext
docker-synapse-1  |     result = inContext.theWork()  # type: ignore[attr-defined]
docker-synapse-1  |              ^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
docker-synapse-1  |     inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
docker-synapse-1  |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 117, in callWithContext
docker-synapse-1  |     return self.currentContext().callWithContext(ctx, func, *args, **kw)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 82, in callWithContext
docker-synapse-1  |     return func(*args, **kw)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/twisted/enterprise/adbapi.py", line 282, in _runWithConnection
docker-synapse-1  |     result = func(conn, *args, **kw)
docker-synapse-1  |              ^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 1033, in inner_func
docker-synapse-1  |     return func(db_conn, *args, **kwargs)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 773, in new_transaction
docker-synapse-1  |     r = func(cursor, *args, **kwargs)
docker-synapse-1  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 1752, in simple_select_one_onecol_txn
docker-synapse-1  |     ret = cls.simple_select_onecol_txn(
docker-synapse-1  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 1775, in simple_select_onecol_txn
docker-synapse-1  |     txn.execute(sql, list(keyvalues.values()))
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 432, in execute
docker-synapse-1  |     self._do_execute(self.txn.execute, sql, parameters)
docker-synapse-1  |   File "/usr/local/lib/python3.11/site-packages/synapse/storage/database.py", line 484, in _do_execute
docker-synapse-1  |     return func(sql, *args, **kwargs)
docker-synapse-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-synapse-1  | sqlite3.OperationalError: no such table: event_txn_id_device_id

Anything else that would be useful to know?

I do believe this was also the case for Synapse v1.90.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    X-Needs-InfoThis issue is blocked awaiting information from the reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions