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 error "UNIQUE constraint failed: temp_user_filters.user_id" after update to 1.86.0 #15809

@brunofontes

Description

@brunofontes

Description

Hi,

I am using a Ubuntu server and had installed the matrix-synapse-py3. The update to version 1.86.0 appeared Today and I updated it as normal (via apt).

After the update the server was not getting back.

I've tried to rollback to version 1.71.0+focal1, but it complains the database has a newer version.

Steps to reproduce

  • sudo apt upgrade

After that, server did not started.

Homeserver

matrix.brunofontes.net

Synapse Version

1.86.0

Installation Method

Debian packages from packages.matrix.org

Database

SQLite

Workers

Single process

Platform

Linux mx 5.4.0-152-generic #169-Ubuntu SMP x86_64

Configuration

No response

Relevant log output

2023-06-20 19:44:04,875 - root - 348 - WARNING - main - ***** STARTING SERVER *****                                                                                                     
2023-06-20 19:44:04,875 - root - 349 - WARNING - main - Server /opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/app/homeserver.py version 1.86.0                           
2023-06-20 19:44:04,875 - root - 354 - INFO - main - Server hostname: matrix.brunofontes.net                                                                                            
2023-06-20 19:44:04,876 - root - 355 - INFO - main - Instance name: master                                                                                                              
2023-06-20 19:44:04,876 - root - 356 - INFO - main - Twisted reactor: EPollReactor                                                                                                      
2023-06-20 19:44:04,876 - synapse.app.homeserver - 349 - INFO - main - Setting up server                                                                                                
2023-06-20 19:44:04,876 - synapse.server - 337 - INFO - main - Setting up.                                                                                                              
2023-06-20 19:44:04,880 - synapse.storage.databases - 66 - INFO - main - [database config 'master']: Checking database server                                                           
2023-06-20 19:44:04,880 - synapse.storage.databases - 69 - INFO - main - [database config 'master']: Preparing for databases ['main', 'state']                                          
2023-06-20 19:44:04,881 - synapse.storage.prepare_database - 120 - INFO - main - ['main', 'state']: Checking existing schema version                                                    
2023-06-20 19:44:04,882 - synapse.storage.prepare_database - 124 - INFO - main - ['main', 'state']: Existing schema is 77 (+5 deltas)                                                   
2023-06-20 19:44:04,882 - synapse.storage.databases.main - 288 - INFO - main - Checking database for consistency with configuration...                                                  
2023-06-20 19:44:04,882 - synapse.storage.prepare_database - 418 - INFO - main - Applying schema deltas for v77                                                                         
2023-06-20 19:44:04,883 - synapse.storage.prepare_database - 418 - INFO - main - Applying schema deltas for v78                                                                         
2023-06-20 19:44:04,883 - synapse.storage.prepare_database - 513 - INFO - main - Running 78/01_validate_and_update_profiles.py:run_upgrade                                              
2023-06-20 19:44:04,899 - synapse.storage.prepare_database - 513 - INFO - main - Running 78/02_validate_and_update_user_filters.py:run_upgrade                                          
2023-06-20 19:44:04,901 - synapse.app._base - 215 - ERROR - main - Exception during startup                                                                                             
Traceback (most recent call last):                                                                                                                                                      
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/app/homeserver.py", line 352, in setup hs.setup()
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/server.py", line 339, in setup self.datastores = Databases(self.DATASTORE_CLASS, self)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/databases/__init__.py", line 74, in __init__ prepare_database(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/prepare_database.py", line 141, in prepare_database _upgrade_existing_database(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/prepare_database.py", line 514, in _upgrade_existing_database module.run_upgrade(cur, database_engine, config=config)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/schema/main/delta/78/02_validate_and_update_user_filters.py", line 85, in run_upgrade cur.execute(copy_sql, (f"{hostname}",))
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 417, in execute self._do_execute(self.txn.execute, sql, parameters)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 469, in _do_execute return func(sql, *args, **kwargs)
    sqlite3.IntegrityError: UNIQUE constraint failed: temp_user_filters.user_id

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DatabaseDB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the dbT-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions