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

synapse_port_db fails because 'ascii' codec can't encode character #8993

Closed
haslersn opened this issue Dec 28, 2020 · 23 comments
Closed

synapse_port_db fails because 'ascii' codec can't encode character #8993

haslersn opened this issue Dec 28, 2020 · 23 comments
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@haslersn
Copy link
Contributor

haslersn commented Dec 28, 2020

I wanted to port my db from sqlite to postgres, but synapse_port_db fails with below-mentioned error.

Steps to reproduce

These are the steps I performed.

  • Synapse already runs on Debian 9 (VM) and uses sqlite.
  • Install Postgres.
  • Stop Synapse.
  • Copy homeserver.db to homeserver.db.snapshot.
  • Start Synapse.
  • Copy homeserver.yaml to homeserver-postgres.yaml.
  • Configure homeserver-postgres.yaml to use postgres instead of sqlite.
  • synapse_port_db --sqlite-database homeserver.db.snapshot --postgres-config homeserver-postgres.yaml

The error

[...]
user_directory_stream_pos: 100% (1/1)
push_rules: 100% (55/55)
threepid_validation_session: 100% (15/15)
room_alias_servers: 100% (18/18)
push_rules_enable: 100% (36/36)
remote_profile_cache: 100% (1/1)
e2e_cross_signing_signatures: 100% (484/484)
2020-12-28 04:50:55,889 - synapse.metrics - 576 - INFO - Collecting gc 1
federation_stream_position: 100% (2/2)
current_state_delta_stream: 0% (1000/581931)
2020-12-28 04:50:56,285 - synapse_port_db - 201 - ERROR - Failed to insert: room_memberships
Traceback (most recent call last):
  File "/opt/synapse/env-python3.5.3/bin/synapse_port_db", line 199, in insert_many_txn
    txn.executemany(sql, rows)
  File "/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py", line 274, in executemany
    self._do_execute(self.txn.executemany, sql, *args)
  File "/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py", line 297, in _do_execute
    return func(sql, *args)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128)
2020-12-28 04:50:56,302 - synapse_port_db - 704 - ERROR - 
Traceback (most recent call last):
  File "/opt/synapse/env-python3.5.3/bin/synapse_port_db", line 693, in run
    consumeErrors=True,
twisted.internet.defer.FirstError: FirstError[#17, [Failure instance: Traceback: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128)
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:501:errback
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:654:_runCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1475:gotResult
--- <exception caught here> ---
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/failure.py:512:throwExceptionIntoGenerator
/opt/synapse/env-python3.5.3/bin/synapse_port_db:420:handle_table
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:640:runInteraction
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:713:runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:250:inContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:266:<lambda>
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:122:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:85:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:306:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/compat.py:464:reraise
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:297:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:707:inner_func
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:510:new_transaction
/opt/synapse/env-python3.5.3/bin/synapse_port_db:408:insert
/opt/synapse/env-python3.5.3/bin/synapse_port_db:199:insert_many_txn
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:274:executemany
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:297:_do_execute
]]
Traceback (most recent call last):
  File "/opt/synapse/env-python3.5.3/bin/synapse_port_db", line 693, in run
    consumeErrors=True,
twisted.internet.defer.FirstError: FirstError[#17, [Failure instance: Traceback: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128)
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:501:errback
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:654:_runCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1475:gotResult
--- <exception caught here> ---
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/failure.py:512:throwExceptionIntoGenerator
/opt/synapse/env-python3.5.3/bin/synapse_port_db:420:handle_table
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:640:runInteraction
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:713:runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:250:inContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:266:<lambda>
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:122:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:85:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:306:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/compat.py:464:reraise
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:297:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:707:inner_func
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:510:new_transaction
/opt/synapse/env-python3.5.3/bin/synapse_port_db:408:insert
/opt/synapse/env-python3.5.3/bin/synapse_port_db:199:insert_many_txn
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:274:executemany
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:297:_do_execute
]]
FirstError[#17, [Failure instance: Traceback: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128)
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:501:errback
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:568:_startRunCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:654:_runCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1475:gotResult
--- <exception caught here> ---
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/internet/defer.py:1416:_inlineCallbacks
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/failure.py:512:throwExceptionIntoGenerator
/opt/synapse/env-python3.5.3/bin/synapse_port_db:420:handle_table
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:640:runInteraction
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:713:runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:250:inContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/threadpool.py:266:<lambda>
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:122:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/context.py:85:callWithContext
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:306:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/python/compat.py:464:reraise
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/twisted/enterprise/adbapi.py:297:_runWithConnection
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:707:inner_func
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:510:new_transaction
/opt/synapse/env-python3.5.3/bin/synapse_port_db:408:insert
/opt/synapse/env-python3.5.3/bin/synapse_port_db:199:insert_many_txn
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:274:executemany
/opt/synapse/env-python3.5.3/lib/python3.5/site-packages/synapse/storage/database.py:297:_do_execute

Version information

  • Version: {"python_version":"3.5.3","server_version":"1.24.0"}
  • Install method: pip3 in virtualenv
  • Platform: Debian 9
@clokep
Copy link
Member

clokep commented Dec 28, 2020

It would be interesting to see what in room_memberships contains that character, although it is likely the displayname field!

Something like the following might work (although I'm not sure about the number of backslashes tto use there 😄).

SELECT * FROM room_memberships WHERE display_name LIKE "%\\xfc%";

Note that the result may leak some private info. If you can confirm that's the issue then I suspect it is a bug in the port DB script.

@haslersn
Copy link
Contributor Author

Yes, I confirm that room_memberships has several rows where the display_name contains an "ü".

@haslersn
Copy link
Contributor Author

and there are no other columns with that character.

@clokep clokep added z-bug (Deprecated Label) z-p2 (Deprecated Label) and removed info-needed labels Dec 28, 2020
@callahad
Copy link
Contributor

callahad commented Jan 8, 2021

I cannot reproduce this.

The character exists in my sqlite database:

sqlite> SELECT * FROM room_memberships WHERE instr(display_name,char(0xFC));
$BIAY0IyuxeMLv64FmAhYgZXX8TtfNQM3sAoxaDlIhlg|@test:example.com|@test:example.com|!wuWfLDEVCbVdAZMUrW:example.com|join|0|Unicode üsername|

The port script runs successfully and the character appears in my Postgres database:

synapse=# SELECT * FROM room_memberships WHERE display_name LIKE E'%\u00FC%';
                   event_id                   |      user_id      |      sender       |             room_id             | membership | forgotten |   display_name    | avatar_url 
----------------------------------------------+-------------------+-------------------+---------------------------------+------------+-----------+-------------------+------------
 $BIAY0IyuxeMLv64FmAhYgZXX8TtfNQM3sAoxaDlIhlg | @test:example.com | @test:example.com | !wuWfLDEVCbVdAZMUrW:example.com | join       |         0 | Unicode üsername | 
(1 row)

callahad added a commit to callahad/synapse-8993 that referenced this issue Jan 9, 2021
@callahad
Copy link
Contributor

callahad commented Jan 9, 2021

@haslersn I was wondering if you could try running synapse_port_db against the snapshot in https://github.com/callahad/synapse-8993? That's a copy of my SQLite database from trying to reproduce as above.

There are two users in the database,test and test2, password is the same as the username.

@haslersn
Copy link
Contributor Author

haslersn commented Jan 9, 2021

With your database snapshot I get the same error.

@haslersn
Copy link
Contributor Author

haslersn commented Jan 9, 2021

Initially I was wrong in that it's Debian 10. It's actually Debian 9. I updated my original post.

@callahad
Copy link
Contributor

callahad commented Jan 9, 2021 via email

@haslersn
Copy link
Contributor Author

haslersn commented Jan 9, 2021

$ psql -U postgres -l 
                             List of databases
   Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges   
-----------+----------+----------+---------+-------+-----------------------
 postgres  | postgres | UTF8     | C       | C     | 
 synapse   | synapse  | UTF8     | C       | C     | 
 template0 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
 template1 | postgres | UTF8     | C       | C     | =c/postgres          +
           |          |          |         |       | postgres=CTc/postgres
(4 rows)

@haslersn
Copy link
Contributor Author

haslersn commented Jan 10, 2021

The PostgreSQL version I used was 9.6.

Now I am trying to migrate to a PostgreSQL 12 cluster running outside the Debian 9 VM, and that seems to work. (It's still running.)

@callahad
Copy link
Contributor

I suspect this is https://bugs.python.org/issue19846, which was fixed in Python 3.7

Can you try re-running the port_db script, prepending env LANG="C.UTF-8" to the invocation?

E.g., env LANG="C.UTF-8" synapse_port_db --sqlite-database homeserver.db.snapshot --postgres-config homeserver-postgres.yaml

@haslersn
Copy link
Contributor Author

Migrating to PostgreSQL 12 worked, and I did it with Python 3.5.3. Do you still think it could be that Python issue19846?

@callahad
Copy link
Contributor

That's a fair point, and I can't for the life of me reproduce this issue on my end, even using Python 3.5.3 and both Postgres 9.5 and 9.6.

I'm going to close this issue as you were able to port out by targeting PostgreSQL 12, but I'd love to reopen and resolve it if we can find reliable steps to reproduce the bug. I really appreciate your help throughout.

@EdGeraghty
Copy link

It looks like I'm currently being bitten by this bug...

root@Synapse:~# synapse_port_db --sqlite-database /var/local/synapse/homeserver.db.snapshot --postgres-config /etc/matrix-synapse/homeserver-postgres.yaml --curses
Traceback (most recent call last):
  File "/usr/bin/synapse_port_db", line 701, in run
    consumeErrors=True,
twisted.internet.defer.FirstError: FirstError[#11, [Failure instance: Traceback: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\U0001f642' in position 0: ordinal not in range(128)
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:517:errback
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:580:_startRunCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:662:_runCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:1514:gotResult
--- <exception caught here> ---
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:1443:_inlineCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/failure.py:500:throwExceptionIntoGenerator
/usr/bin/synapse_port_db:421:handle_table
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:668:runInteraction
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:744:runWithConnection
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/threadpool.py:238:inContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/threadpool.py:255:<lambda>
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/context.py:118:callWithContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/context.py:83:callWithContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/enterprise/adbapi.py:293:_runWithConnection

/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/deprecate.py:298:deprecatedFunction
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/compat.py:403:reraise
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/enterprise/adbapi.py:284:_runWithConnection
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:738:inner_func
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:532:new_transaction
/usr/bin/synapse_port_db:409:insert
/usr/bin/synapse_port_db:200:insert_many_txn
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:297:executemany
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:320:_do_execute
]]
FirstError[#11, [Failure instance: Traceback: <class 'UnicodeEncodeError'>: 'ascii' codec can't encode character '\U0001f642' in position 0: ordinal not in range(128)
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:517:errback
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:580:_startRunCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:662:_runCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:1514:gotResult
--- <exception caught here> ---
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/internet/defer.py:1443:_inlineCallbacks
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/failure.py:500:throwExceptionIntoGenerator
/usr/bin/synapse_port_db:421:handle_table
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:668:runInteraction
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:744:runWithConnection
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/threadpool.py:238:inContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/threadpool.py:255:<lambda>
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/context.py:118:callWithContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/context.py:83:callWithContext
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/enterprise/adbapi.py:293:_runWithConnection
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/deprecate.py:298:deprecatedFunction
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/python/compat.py:403:reraise
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/twisted/enterprise/adbapi.py:284:_runWithConnection
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:738:inner_func
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:532:new_transaction
/usr/bin/synapse_port_db:409:insert
/usr/bin/synapse_port_db:200:insert_many_txn
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:297:executemany
/opt/venvs/matrix-synapse/lib/python3.7/site-packages/synapse/storage/database.py:320:_do_execute

@callahad
Copy link
Contributor

/me frowns, clicks the "Reopen and comment" button

@callahad callahad reopened this Mar 24, 2021
@callahad callahad added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release labels Mar 24, 2021
@EdGeraghty
Copy link

/me frowns, clicks the "Reopen and comment" button

If you'd like to start a DM with me to try and resolve, @ed:geraghty.london

@callahad
Copy link
Contributor

So the original reporter was seeing issues encoding \xfc (ü), Ed is seeing it with \U0001f642 (🙂)... not sure if that's especially relevant here, but worth noting since emoji are outside of Unicode's Base Multilingual Plane and may trigger weirder errors.

@EdGeraghty
Copy link

EdGeraghty commented Mar 24, 2021

I'm currently attempting to migrate from sqlite on an MS Azure Debian 10 instance to a "postgresql for Azure", which means I'm not 100% in control of the configs on both sides.

Synapse:
Debian Buster, installed as matrix-synapse-py3 using the repo line deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ buster main

I've tried setting the locale to all sorts of things with no success, it's currently

root@Synapse:~# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="UTF-8"
LC_NUMERIC="UTF-8"
LC_TIME="UTF-8"
LC_COLLATE="UTF-8"
LC_MONETARY="UTF-8"
LC_MESSAGES="UTF-8"
LC_PAPER="UTF-8"
LC_NAME="UTF-8"
LC_ADDRESS="UTF-8"
LC_TELEPHONE="UTF-8"
LC_MEASUREMENT="UTF-8"
LC_IDENTIFICATION="UTF-8"
LC_ALL=UTF-8

I've also tried using env LANG="C.UTF-8" in the invocation, exporting it, all sorts...

root@Synapse:~# dpkg -s matrix-synapse-py3
Package: matrix-synapse-py3
Status: install ok installed
Priority: extra
Section: contrib/python
Installed-Size: 170942
Maintainer: Synapse Packaging team <packages@matrix.org>
Architecture: amd64
Version: 1.30.0+buster1

synapse server version 12

root@Synapse:~# psql "host=<snip>.postgres.database.azure.com port=5432 dbname=synapse user=synapse password=${DBPASS} sslmode=require" -l
                                              List of databases
       Name        |     Owner      | Encoding |  Collate   |   Ctype    |         Access privileges
-------------------+----------------+----------+------------+------------+-----------------------------------
 azure_maintenance | azuresu        | UTF8     | en_US.utf8 | en_US.utf8 |
 azure_sys         | azuresu        | UTF8     | en_US.utf8 | en_US.utf8 |
 postgres          | azure_pg_admin | UTF8     | en_US.utf8 | en_US.utf8 |
 synapse           | synapse        | UTF8     | C          | C          |
 template0         | azuresu        | UTF8     | en_US.utf8 | en_US.utf8 | =c/azuresu                       +
                   |                |          |            |            | azuresu=CTc/azuresu
 template1         | azure_pg_admin | UTF8     | en_US.utf8 | en_US.utf8 | =c/azure_pg_admin                +
                   |                |          |            |            | azure_pg_admin=CTc/azure_pg_admin
(6 rows)

Also, it dies on different unicode chars each time I run it, I'm guessing the porting script isn't deterministic in its ordering? 🤔

@callahad
Copy link
Contributor

callahad commented Apr 7, 2021

Sorry for the delay here; I'm still unable to reproduce this... I'm curious if you can successfully port the test database from my earlier comment?

@EdGeraghty
Copy link

--------------------------------------------------------------------------------
Preparing sqlite3...
2021-04-07 18:23:34,160 - synapse.storage.prepare_database - 100 - INFO - ('main', 'state'): Checking existing schema version
2021-04-07 18:23:34,163 - synapse.storage.prepare_database - 109 - INFO - ('main', 'state'): Existing schema is 59 (+12 deltas)
2021-04-07 18:23:34,164 - synapse.storage.databases.main - 379 - INFO - Checking database for consistency with configuration...
2021-04-07 18:23:34,164 - synapse.storage.prepare_database - 376 - INFO - Applying schema deltas for v59
2021-04-07 18:23:34,165 - synapse.storage.prepare_database - 501 - INFO - Schema now up to date
2021-04-07 18:23:34,173 - synapse.storage.util.id_generators - 56 - INFO - initialising stream generator for pushers(id)
2021-04-07 18:23:34,173 - synapse.storage.util.id_generators - 56 - INFO - initialising stream generator for deleted_pushers(stream_id)
2021-04-07 18:23:34,174 - synapse.storage.util.id_generators - 56 - INFO - initialising stream generator for events(stream_ordering)
2021-04-07 18:23:34,174 - synapse.storage.util.id_generators - 56 - INFO - initialising stream generator for events(stream_ordering)
2021-04-07 18:23:34,174 - synapse.storage.util.id_generators - 56 - INFO - initialising stream generator for ex_outlier_stream(event_stream_ordering)
Pending background updates exist in the SQLite3 database. Please start Synapse again and wait until every update has finished before running this script.

@EdGeraghty
Copy link

I don't want to mess around with this box too much!

I'm going to try migrating to a local postgres instance, take one step out of the chain

@EdGeraghty
Copy link

It would appear that's done the trick 🤷‍♂️ guess you can close the ticket again...?

@callahad
Copy link
Contributor

callahad commented Apr 9, 2021

Strange! Thank you for checking.

@callahad callahad closed this as completed Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. X-Regression Something broke which worked on a previous release z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants