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

allow_unsafe_locale: true still enforces the check on postgres' encoding #13709

Open
erkinalp opened this issue Sep 4, 2022 · 3 comments
Open
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@erkinalp
Copy link

erkinalp commented Sep 4, 2022

Description

allow_unsafe_locale still fails to work when a non-C locale is supplied.

Steps to reproduce

  • Run Synapse with YugabyteDB as the database
  • Observe it fails to work because Yugabyte storage actually does not support C collation

Homeserver

local test setup

Synapse Version

1.66.0

Installation Method

Docker (matrixdotorg/synapse)

Platform

Yugabyte is also from the latest docker.

Relevant log output

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/synapse/app/homeserver.py", line 382, in setup
    hs.setup()
  File "/usr/local/lib/python3.9/site-packages/synapse/server.py", line 308, in setup
    self.datastores = Databases(self.DATASTORE_CLASS, self)
  File "/usr/local/lib/python3.9/site-packages/synapse/storage/databases/__init__.py", line 74, in __init__
    prepare_database(
  File "/usr/local/lib/python3.9/site-packages/synapse/storage/prepare_database.py", line 152, in prepare_database
    _setup_new_database(cur, database_engine, databases=databases)
  File "/usr/local/lib/python3.9/site-packages/synapse/storage/prepare_database.py", line 213, in _setup_new_database
    database_engine.check_new_database(cur)
  File "/usr/local/lib/python3.9/site-packages/synapse/storage/engines/postgres.py", line 137, in check_new_database
    raise IncorrectDatabaseSetup(
synapse.storage.engines._base.IncorrectDatabaseSetup: Database is incorrectly configured:

    - 'CTYPE' is set to 'en_US.UTF-8'. Should be 'C'

See docs/postgres.md for more information.
******************************************************
 Error during initialisation:
    Database is incorrectly configured:
 
     - 'CTYPE' is set to 'en_US.UTF-8'. Should be 'C'
 
 See docs/postgres.md for more information.
 There may be more information in the logs.
******************************************************

Anything else that would be useful to know?

No response

@erkinalp
Copy link
Author

erkinalp commented Sep 4, 2022

Corresponding yugabyte issue: yugabyte/yugabyte-db#13863

@erkinalp
Copy link
Author

erkinalp commented Sep 4, 2022

image

@DMRobertson DMRobertson changed the title allow_unsafe_locale fails a few steps down the road allow_unsafe_locale: true still enforces the check on postgres' encoding Sep 4, 2022
@DMRobertson
Copy link
Contributor

See #12055 for motivation. I think most people would expect there to be a single i_know_what_im_doing_and_accept_possible_data_corruption flag, and so we'd probably accept a PR which

  • made this flag also disable the check on SERVER_ENCODING
  • updated docs accordingly.

Note that we have no plans to support databases other than Postgres and Sqlite, not even those which aim to be wire-compatible with Postgres.

@DMRobertson DMRobertson added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

2 participants