Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COLLATE' is set to 'c'. Should be 'C' #16915

Closed
wrenix opened this issue Feb 13, 2024 · 5 comments
Closed

COLLATE' is set to 'c'. Should be 'C' #16915

wrenix opened this issue Feb 13, 2024 · 5 comments

Comments

@wrenix
Copy link

wrenix commented Feb 13, 2024

Description

Synapse has an collate and ctype check which does not work correct.

Steps to reproduce

  • create database with sql
  • start synapse

Homeserver

my

Synapse Version

v1.100.0

Installation Method

Docker (matrixdotorg/synapse)

Database

postgres

Workers

Single process

Platform

K3s single node

Configuration

Database was created with this SQL:

CREATE DATABASE "matrix-synapse" LC_COLLATE='C' LC_CTYPE='C' ENCODING=UTF8 TEMPLATE=template0

Relevant log output

synapse.storage.engines._base.IncorrectDatabaseSetup: Database is incorrectly configured:                                              
                                                                                                                                            
         - 'COLLATE' is set to 'c'. Should be 'C'                                                                                           
         - 'CTYPE' is set to 'c'. Should be 'C'                                                                                             
                                                                                                                                            
     See docs/postgres.md for more information.

Anything else that would be useful to know?

No response

@reivilibre
Copy link
Contributor

What platform is your Postgres database running on? Over many years I don't think we've seen this. And indeed it seems like you created it with an uppercase C so it's sort of odd that it'd report it back as lowercase.

@wrenix
Copy link
Author

wrenix commented May 26, 2024

that depends on how you create the database, by commandline createdb it is uppercase on sql CREATE DATABASE "matrix-synapse" LC_COLLATE='C' LC_CTYPE='C' ENCODING=UTF8 TEMPLATE=template0 it is lowercase.


the answer of your question is Kubernetes and the version 16.3

@reivilibre
Copy link
Contributor

Is it a specific docker image that it's running in, that is public/you can share?

I can't reproduce at all locally; if I create with CREATE DATABASE it comes out uppercase, SELECT datcollate, datctype FROM pg_database WHERE datname = current_database();

If I try to create it lowercase, I even get told it's an invalid locale.

@wrenix
Copy link
Author

wrenix commented Jun 10, 2024

hmm, okay my init database script was dirty and it call:

CREATE DATABASE "matrix-synapse" LC_COLLATE="c" LC_CTYPE="c" ENCODING=UTF8 TEMPLATE=template0

do you like to check that in your script either? Or just close that issue?

@devonh
Copy link
Member

devonh commented Jun 18, 2024

It seems like we can close this issue since the database was being created using the lowercase c.

@devonh devonh closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants