1

Topic: GUI login error: Unhandled error response

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? Easy
- Linux/BSD distribution name and version: CentOS Linux release 7.9.2009 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Just a couple days ago, I started getting this error when trying to log into SOGO's gui. Unhandled error response.  I checked sogo's log and saw this:

Mar 18 10:32:46 sogod [10933]: |SOGo| starting method 'POST' on uri '/SOGo/connect'
Mar 18 10:32:46 sogod [10933]: SOGoRootPage successful login from 'x.x.x.x' for user 'thang@housevo.us' - expire = -1  grace = -1
Mar 18 10:32:46 sogod [10933]: |SOGo| request took 0.031466 seconds to execute
Mar 18 10:32:46 sogod [10933]: x.x.x.x "POST /SOGo/connect HTTP/1.0" 200 48/89 0.034 - - 672K - 15

I thought this was an expired password? I jumped on iredmail admin and changed my password. Still getting the same expire = -1 grace = -1

Any suggestions? Thanks in advance!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by PetrG 2022-03-21 18:20:38)

Re: GUI login error: Unhandled error response

I'm getting same error on very similar setup on Ubuntu 20.04 just with PGSQL ...
It started with SOGo update to the 5.5.1.20220320-1 version,

DB log:
sogo@sogo ERROR:  value too long for type character varying(255)
sogo@sogo STATEMENT:  INSERT INTO sogo_sessions_folder ... looks like sogo is trying to store longer c_value into the table than expected

Temporary FIX (not sure if the best one but works for me) is:
1. alter the table sogo_sessions_folder and set c_value to text so it can hold longer data than 255 chars
2. add following lines to the /etc/nginx/templates/sogo.tmpl
in to the section location ^~ /SOGo:

    proxy_busy_buffers_size   512k;
    proxy_buffers             4 512k;
    proxy_buffer_size         256k;

3

Re: GUI login error: Unhandled error response

PetrG wrote:

1. alter the table sogo_sessions_folder and set c_value to text so it can hold longer data than 255 chars

Better drop this sql table and restart sogo service to let sogo create it again.

4

Re: GUI login error: Unhandled error response

I am facing the same problem ever since I updated SOGO

Zhang - can you assist ?

5

Re: GUI login error: Unhandled error response

sudhanshu wrote:

I am facing the same problem ever since I updated SOGO

Zhang - can you assist ?

Solutions are offered in this thread.

6 (edited by alec 2022-03-29 16:17:55)

Re: GUI login error: Unhandled error response

ZhangHuangbin wrote:

Solutions are offered in this thread.

Hi Zhang, I tried your solution. Now psql isn't complaining anymore about values too long.

But "Unhandled error response" is still posted when I try to login.

In sogo logs:

SOGoRootPage successful login from '10.0.1.243' for user 'alec@domain.com' - expire = -1  grace = -1

10.0.1.243 "POST /SOGo/connect HTTP/1.0" 200 55/110 0.362 - - 3M - 13

With Developer Tools of Firefox I found this error

POST https: //domain.com/SOGo/connect   [HTTP/2 502 Bad Gateway 353ms]

So I checked the log of nginx and it says:

*4055 upstream sent too big header while reading response header from upstream, client: 10.0.1.243, server: _, request: "POST /SOGo/connect HTTP/2.0", upstream: "http://127.0.0.1:20000/SOGo/connect", host: "domain.com", referrer: "https: //domain.com/SOGo/so/alec@domain.com/Mail/view"

7

Re: GUI login error: Unhandled error response

I finally managed to fix this problem.

For the error in Sogo that was trying to insert a c_value too long in psql DB, I have dropped the table sogo_sessions_folder, then restarted sogo.

Since the "Unhandled Error Response" was persisting, I changed ngix configuration as reported here by Zhang.
The config file need those changes.

After restarting nginx it all worked perfectly.

Thanks a lot Zhang!

8

Re: GUI login error: Unhandled error response

Hi Alec,
What Zhang said about dropping and recreating table sogo_sessions_folder is correct. You are only missing one more thing:
Look for file /etc/nginx/templates/sogo.tmpl
Edit it with your favourite editor, i.e. nano
Look for section:
location ^~ /SOGo {
and within that section, add this:
    # fix error unhandled error response
    proxy_busy_buffers_size 512k;
    proxy_buffers         4 512k;
    proxy_buffer_size       256k;
it has to be within the brackets { }
save the file and restart nginx
sudo systemctl restart nginx or reload: sudo nginx -s reload
That's it. Sogo will work again like charm.