View Issue Details

IDProjectCategoryView StatusLast Update
0004217SOGoActiveSyncpublic2017-07-10 11:26
Reportertom Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformMobile clientOSGoogle AndroidOS Version5.1.x, 7.1.x
Product Version3.2.9 
Summary0004217: EAS - Android contact sync
Description

We are using SOGo in iRedMail suite, but we have a problem that we cannot solve. We have a production and developing server, both have latest SOGo 3.X nightly installed. but the developing server has the latest dev iRedMail and we can test different settings there. But the problem is present in both servers as we imported a user into dev server and tested.

Steps To Reproduce

This happens to multiple users, but for example, we have 1 client that uses Android (tried on 5.1.x, 7.1.x) and Windows Outlook clients (works OK, can see all contacts) through EAS protocol. We want to sync Contacts to Android phone. We tried to set up Exchange account on Android, connect account to SOGo server address and sync only contacts. This client has more then 3000 contacts, but we can only see around 150 contacts (sometimes 0) in the phone.

Also tried with different user, with around 400 contacts, same problem.

We tried setting different timeout settings and some other settings in SOGo and Nginx (as reverse proxy), but no luck.

Additional Information

the following error (we think it's related, because there are no other errors) in sogo.log:
ERROR][WOHttpTransaction] client disconnected during delivery of response for WORequest method=POST uri=/SOGo/Microsoft-Server-ActiveSync?Cmd=PingandUser=client@client.comandDeviceId=androidc1457andDeviceType=Android app=SOGo rqKey=Microsoft-Server-ActiveSync rqPath=(null) (len=13): the socket was shutdown

We also figured, by putting SOGo in debug mode, that all contacts are pushed to the phone, but phone doesn't list them all. We tried to sync contacts on BlackBerry phone and it worked OK, all the contacts are visible.

So we now eliminated other possible problems, and we narrowed it down to a point that the problem is just between SOGo and Android. Now we cannot get it working on 5+ different Android phones, so the problem is most possibly in SOGo.

Any ideas what could be the problem? If more information is needed regarding this problem, please let me know.
Thank you very much for checking this problem and possibly fixing it.

TagsNo tags attached.

Activities

Christian Mack

Christian Mack

2017-07-06 06:49

developer   ~0012039

Please show your ActiveSync settings in sogo.conf and your reverse proxy (Apache or nginx).

tom

tom

2017-07-06 12:27

reporter   ~0012043

SOGo (anything else needed?):

WOPort = 127.0.0.1:20000;
SOGoEASDebugEnabled = YES;
WOMaxUploadSize = 15360;
SOGoMaximumMessageSizeLimit = 15360;
WOWorkersCount = 10;
SxVMemLimit = 500;
SOGoXSRFValidationEnabled = YES;

WOWatchDogRequestTimeout = 60;
SOGoMaximumPingInterval = 360;
SOGoMaximumSyncInterval = 360;
SOGoInternalSyncInterval = 60;
SOGoMaximumSyncResponseSize = 512;
SOGoMaximumSyncWindowSize = 100;

Also tried with this tune:

WOWatchDogRequestTimeout = 10;
SOGoMaximumPingInterval = 354;
SOGoMaximumSyncInterval = 354;
SOGoInternalSyncInterval = 30;
SOGoMaximumSyncResponseSize = 512;
SOGoMaximumSyncWindowSize = 256;

NGINX:
location ~ ^/sogo { rewrite ^ https://$host/SOGo; }
location ~ ^/SOGO { rewrite ^ https://$host/SOGo; }

Redirect /mail to /SOGo

#location ~ ^/mail { rewrite ^ https://$host/SOGo; }

For Mac OS X and iOS devices.

rewrite ^/.well-known/caldav /SOGo/dav permanent;
rewrite ^/.well-known/carddav /SOGo/dav permanent;
rewrite ^/principals /SOGo/dav permanent;

location ^~ /SOGo {
include /etc/nginx/templates/hsts.tmpl;

proxy_pass http://127.0.0.1:20000;

# forward user's IP address
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;

# always use https
proxy_set_header x-webobjects-server-port $server_port;
proxy_set_header x-webobjects-server-name $host;
proxy_set_header x-webobjects-server-url  https://$host;

proxy_set_header x-webobjects-server-protocol HTTP/1.0;

}

location ^~ /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;

proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;

}

location ^~ /SOGo/Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync;

proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;

}

location /SOGo.woa/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
expires max;
}
location /SOGo/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
expires max;
}
location ^/SOGo/so/ControlPanel/Products/([^/])/Resources/(.)$ {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}
location (^/SOGo/so/ControlPanel/Products/[^/]UI/Resources/..(jpg|png|gif|css|js)$) {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}

tom

tom

2017-07-06 14:27

reporter   ~0012045

Also tried to tune mysql with:
max_allowed_packet = 64M

And dovecot with:
imap_max_line_length = 2m

tfu

tfu

2017-07-07 05:26

reporter   ~0012054

Try without SOGoMaximumSyncWindowSize in sogo.conf and recreate the account on a problem device.

tom

tom

2017-07-07 13:28

reporter   ~0012062

@tfu, thank you for suggestion, that actually works! Thank you very much!

zhb

zhb

2017-07-09 13:57

reporter   ~0012069

According to SOGo document:

########
SOGoMaximumSyncWindowSize

Parameter used to overwrite the maximum number of items returned during a Sync operation.

Defaults to 0, which means no overwrite is performed.

Setting this parameter to a value greater than 512 will have unexpected behaviour with various ActiveSync clients.
#######

With "SOGoMaximumSyncWindowSize = 256;", Android OS 5/7 cannot sync contacts. It doesn't reach the "512" limit as mentioned in doc. So what's the recommended setting? Simply use default setting, or we need a tuning in some cases?

Christian Mack

Christian Mack

2017-07-10 07:50

developer   ~0012070

AS you have set SOGoMaximumSyncResponseSize, you do not need to limit with SOGoMaximumSyncWindowSize too.
SOGoMaximumSyncWindowSize is for limiting how many objects are synchronized in on go at max.
SOGoMaximumSyncResponseSize limits the maximum size of one synchronization round.
So only as many objects as fit in that size will be transfered, or 1 object at a time, if greater than the given limit.

zhb

zhb

2017-07-10 07:55

reporter   ~0012071

So we'd better use either one for limit? And which one is better? ResponseSize or WindowSize? What's the "always working" setting?

Christian Mack

Christian Mack

2017-07-10 11:26

developer   ~0012072

As object size is differing wildly (e.g. email with attachment versus one event). the ResponseSize is the restriction with better results.
You have a faster synchronization for small objects, while preventing too huge responses (and response times) for bigger ones.

In my experience this works good, but I didn't test the other one as explicitly, so it probably works equally good.

Issue History

Date Modified Username Field Change
2017-07-05 22:41 tom New Issue
2017-07-06 00:26 ludovic Priority high => normal
2017-07-06 00:26 ludovic Severity major => minor
2017-07-06 06:49 Christian Mack Note Added: 0012039
2017-07-06 12:27 tom Note Added: 0012043
2017-07-06 14:27 tom Note Added: 0012045
2017-07-07 05:26 tfu Note Added: 0012054
2017-07-07 13:28 tom Note Added: 0012062
2017-07-09 13:57 zhb Note Added: 0012069
2017-07-10 07:50 Christian Mack Note Added: 0012070
2017-07-10 07:55 zhb Note Added: 0012071
2017-07-10 11:26 Christian Mack Note Added: 0012072