Skip to content

[Bug]: Mariadb database init error #59

Description

@wallon-ines

What happened?

Summary

I have an error when I try to initialize the SOGo database with the MariaDB server

# poetry run start
2026-07-21 19:41:28,782 <30277> [WARNING][sogolog][ModuleInitSogo.py:check_sogo_database:89]: SOGo database is emtpy. It's normal if this is the first time you run it
2026-07-21 19:41:28,830 <30277> [ERROR][sogolog.sql][ClientMySQL.py:create_table:302]: Error when creating table sogo6_sogo_user_profiles: 1071 (42000): Specified key was too long; max key length is 3072 bytes

Environment

  • Rocky Linux 9
  • Sogo v6 (#3d25472)
  • python3.14-3.14.5-1.el9_8.x86_64
  • MariaDB-server-12.3.2-1.el9.x86_64 (from the official MariaDB DNF repo)
  • redis-8.8.0-1.x86_64 (from official Redis DNF repo)

Steps to reproduce

  1. Clone git repository
  2. Copy and edit process file in /etc/sogo/
  3. Create an empty database (CREATE DATABASE sogo;)
  4. Copy the default json config files (cp scripts/init/system_settings.json /etc/sogo/system_settings.json) and (scripts/init/domain_settings.json /etc/sogo/domain_settings.json)
  5. Run poetry with poetry run start OR with poetry run gunicorn -c app/gunicorn.conf.py app.run:app

Suggestion

Rework primary_keys argument in app/config/db/tables.py at line 125
for e.g.:

diff --git a/app/config/db/tables.py b/app/config/db/tables.py
index bb35c63..ac98cfd 100644
--- a/app/config/db/tables.py
+++ b/app/config/db/tables.py
@@ -122,7 +122,7 @@ ALL_USER_COL              = [COL_ID,
                              COL_USER_DELEGATION_GIVEN,
                              COL_USER_DELEGATION_GOT,
                              ]
-TABLE_USER = Table(name=process_config.SOGO_P_TABLE_USERS, columns=ALL_USER_COL, primary_keys=(COL_ID.name, COL_HASH.name, COL_USER_UID.name,))
+TABLE_USER = Table(name=process_config.SOGO_P_TABLE_USERS, columns=ALL_USER_COL, primary_keys=(COL_ID.name, COL_USER_UID.name,))

Version

6.0.0-alpha1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions