View Issue Details

IDProjectCategoryView StatusLast Update
0006150SOGoBackend Generalpublic2025-10-08 03:01
ReporterCLSMCSMII Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformHyper-V OSUbuntuOS Version24.04.3
Product Version5.12.4 
Summary0006150: Column c_value in sogo_sessions_folder table is too small for sessions with openID token
Description

I'm using Azure EntraID as IDP, and webmail keep freezing after 2-3 minutes after reload.

I found an error on sogo.log:
Oct 07 17:07:03 sogod [48388]: [ERROR] <0x0x60cd386abfc0[GCSSessionsFolder]> -[GCSSessionsFolder writeRecordForEntryWithID:value:creationDate:lastSeenDate:]: cannot write record: <MySQL4Exception: 0x60cd385a1350> NAME:ExecutionFailed REASON:Data too long for column 'c_value' at row 1

After I alter c_value column from Varchar(4096) to text, this problem has been resolved.
"ALTER TABLE sogo_sessions_folder MODIFY COLUMN c_value TEXT NOT NULL;"
I think Varchar(4096) is too small for session with very long token.

Steps To Reproduce

Just install sogo with OpenID (I'm using MS EntraID) authentication.
You can find some useful configuration for sogo.conf here
https://bugs.sogo.nu/view.php?id=6123

After login and see your mailbox, wait for 2-6 minutes you'll get expired session log
Oct 07 22:16:31 sogod [52506]: <0x0x56890c22caa0[SOGoWebAuthenticator]> Expired session received, redirecting to login page.
Oct 07 22:16:31 sogod [52506]: <0x0x56890c22caa0[SOGoWebAuthenticator]> tried wrong password for user 'r6fvkqpKvQYnha5SK1wcX1VVDKBHthyzeie1qAM8DJmz2b6RDb/Cz3gF+O5WyiKmXVmFej7XA/1iNysso+33ppEEpf/DMVRA7M9UZ9/gJ64nOS2ya5pzsKPlO3RLC/uF/Fci1b+JSRa3RgOETtMygIwFXse94jrMvpw/IhuQ9um+9gUcK9D+TFXs5cm7lQXzHtLWYAxFDWXjPpLqWO+VuGxqb3352ooI4ZJqFox/M/t68S2s4KLCaAYvVn7Pyx7psYA6k5xQHmHUtOpyXqlthr11WK8vyBMgO4BIcI/9qRuhFTyYte+FuTRbHS6EO+A7LKGeBhAP26Mmc/cpzd3a51btn/VjYFkT0rjLgo/JMw6/0ux6Z9ChigfIdcOApIVPkvp6/ld0y1Z/HxyvDkAA/0TJzXXCA4mlX8/MgVXI71Adk7WcUrPkRK2RwgraVTHD56VpbgSgt4gNh0Sw0Gq2NIaf3p1f8TlLw2yDSqR8eJ2LkhsclFDQRErlzbT895M1RtS8RqRyU5Mm/nQDOyguYGJLx5UbeP8BSztT26TVeMBk3pd44vRF1KrTbeCOVHZH0lW46B8Hk3p6sN3x32ZXDypi77t8DQPncg4jQGe9X2cHFjE1lP/MWKURvXl/aqL612hJh6ga9whJqS4RaB+fD5a/je4H9u/gMQ0mrhCdHq7kzfOv6Dbcuh0wcfHoqicnylLSlZLUMzJTJaOISz7dloOpL62R+a9OgIPgW+xBMbJd4Cb8H8EB3tGI90PJHxp6lRg8eabf82hby8aCtPuyCBAEhCs4i5uxzy+TIJpwiBdqHI8p3aCY+3SmXac/29yGl/e5fv0gfK7wzw1DLd58CkwNqgSPpCXCtvMttVijv1H/OrmaPloWbkSpkZanDyapd1lR7yJyGBgmrNPgo8AOz7NomyvbsyYcfGF/GVE3FgLjierx57nRev5fEeGwjSDO6MXUVGAr61JDD4+0EZbZboE9f0rkvu8r/B04nj6XVTvgJxsCnovc5MlJO9iQMIdB

Eventaully I got redirect with 302 code, and it doesn't go anywhere.
Oct 07 22:16:32 sogod [52506]: ==my public IP==, ==private IP== "POST /SOGo/so/===myemail===/Mail/0/folderINBOX/changes HTTP/1.0" 302 0/150 0.222 - - 0 - 13

It will cause IMAP login failed, you cannot fetch emails until you refresh the whole SOGo webpage to get new ID token.
Oct 07 22:22:07 sogod [45662]: [ERROR] <0x0x636e8222e890[NGImap4ConnectionManager]> IMAP4 login failed:
url=imaps://==myname==@==myservername==/?tls=YES&tlsVerifyMode=default
= <0x0x636e81ea0e70[NGImap4Client]: login===myemail===(pwd) socket=<NGActiveSSLSocket[0x0x636e8257ad60]: mode=rw address=(null)>>

Additional Information

From github source code:
https://github.com/Alinto/sogo/blob/master/Scripts/mysql-utf8mb4.sql

CREATE TABLE sogo_sessions_folder (
c_id varchar(255) NOT NULL,
c_value varchar(4096) NOT NULL,
c_creationdate int(11) NOT NULL,
c_lastseen int(11) NOT NULL,
PRIMARY KEY (c_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

Change c_value from "varchar(4096) NOT NULL," to "text NOT NULL," will resolve the problem

Or modify the existing sogo database will also fix this problem.
ALTER TABLE sogo_sessions_folder MODIFY COLUMN c_value TEXT NOT NULL;

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2025-10-08 03:01 CLSMCSMII New Issue