View Single Post
Posts: 4 | Thanked: 1 time | Joined on Dec 2011
#1545
I think the cert issue is a red herring.

I was able to capture a syslog that contains a successful MfE session, a failed MfE session, all subsequent MfE session failures, and then resolve without a reboot/full resync/etc:

The successful MfE case was on fresh reboot, wifi ap, external power. It looks like the ASDaemon-conn process kicks off a curl call back that returns http 200 (and I would guess the data from the post.)

Code:
HTTP REQUEST:  POST https://m.google.com/Microsoft-Server-ActiveSync?Cmd=Sync&DeviceId=XXXXXXXXXX&DeviceType=SmartPhone
ASDAEMON-CONN: startSession start, aWait=30 seconds
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=2                                                                        
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=1                             
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=4                                      
ASDAEMON-CONN: startSession end, ret=0           
AS-PERF: Transfered 1804 bytes in 0 seconds. Transfer rate is 0 Kb/sec
CurlConnectionManager: sendReceive attempt 1: CancelErr=0
HTTP STATUS: 200                                                       
AS-PERF: Content-Length:                                     
AS-LIB: Sync response received (200)
The subsequent MfE failure was when the phone transitioned from the aforementioned wifi to Tmobile 3.5G (3 bars), battery power. It looks like cURL is unable to contact the server after 2 tries (error code 7 enum is CURLE_COULDNT_CONNECT) and that catches into an AS-Lib 707 error. Fair enough, sync failed for this POST attempt.

Code:
HTTP REQUEST:  POST https://m.google.com/Microsoft-Server-ActiveSync?Cmd=FolderSync&DeviceId=XXXXXXXXXX&DeviceType=SmartPhone                                    
ASDAEMON-CONN: startSession start, aWait=30 seconds                                                                                                                   
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=2                                                                                                                           
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=1                                                                                                                           
activesync: AsStatusIndicator::displayEvent(0)                                                                                                                                  
activesync: AsStatusIndicator::updateState(): Sync                                                                                                                              
ASDAEMON-CONN: Cancel connection                                                                                                                                      
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=4                                                                                                     
ASDAEMON-CONN: startSession end, ret=0                                                                                                                                
AS-PERF: Transfered 0 bytes in 30 seconds. Transfer rate is 0 Kb/sec                                                                            
CurlConnectionManager: sendReceive attempt 1: CancelErr=901                                                                                     
ASDAEMON: ICListener IAPs count = 1                                                                                                             
ASDAEMON: ICListener proxyHost: usessl = 1, proxy_host = (null)                                                                   
HTTP REQUEST:  POST https://m.google.com/Microsoft-Server-ActiveSync?Cmd=FolderSync&DeviceId=XXXXXXXXXX&DeviceType=SmartPhone              
ASDAEMON-CONN: startSession start, aWait=90 seconds                                                                                             
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=1                                                                                                     
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=4                                                                                       
ASDAEMON-CONN: startSession end, ret=7                                                                                            
AS-PERF: Transfered 0 bytes in 1 seconds. Transfer rate is 0 Kb/sec                                                                 
CurlConnectionManager: sendReceive attempt 2: CancelErr=0                                                                         
CurlConnectionManager: cURL errorcode = 7, Couldn't connect to server                                                             
AS-LIB: FolderSync response received (707)                                                                                        
AS-LIB: FolderSync ends with status 707                                                                                     
AS-LIB: Action execution ends with status 707                                                                                     
AS-LIB: Synchronizing folders finished with action status 707.

Now here is where I return to the known-good sync environment at the beginning of this post. All automated or Manual attempts at sync automatically fail with no retries. I suspect there is some state the CurlConnectionManager gets in where it thinks it hit the max retry limit and will no longer try.

Code:
HTTP REQUEST:  POST https://m.google.com/Microsoft-Server-ActiveSync?Cmd=FolderSync&DeviceId=XXXXXXXXXX&DeviceType=SmartPhone
ASDAEMON-CONN: startSession start, aWait=30 seconds             
ASDAEMON-CONN: Session already completed, ret=7
ASDAEMON-CONN: startSession end, ret=7                                           
AS-PERF: Transfered 0 bytes in 0 seconds. Transfer rate is 0 Kb/sec
CurlConnectionManager: sendReceive attempt 1: CancelErr=0                    
CurlConnectionManager: cURL errorcode = 7, Couldn't connect to server
So let's try restarting AS-daemon and retry the sync (should happen on as' start)

Code:
/etc/init.d/as-daemon-0 stop
/etc/init.d/as-daemon-0 start
Sure enough, sync returns just fine:

Code:
HTTP REQUEST:  POST https://m.google.com/Microsoft-Server-ActiveSync?Cmd=Sync&DeviceId=XXXXXXXXXX&DeviceType=SmartPhone
ASDAEMON-CONN: startSession start, aWait=30 seconds
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=2                       
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=1                                
ASDAEMON-CONN: CURL-CONN-CALLBACK: Action=4                 
ASDAEMON-CONN: startSession end, ret=0                      
AS-PERF: Transfered 1804 bytes in 1 seconds. Transfer rate is 1 Kb/sec
CurlConnectionManager: sendReceive attempt 1: CancelErr=0    
HTTP STATUS: 200
I will look at the code for the asdaemon when I get a chance but if anyone out there with asdaemon/n900 chops gets a chance this might help out.

Last edited by shoonmcgregor; 2011-12-12 at 15:07.
 

The Following User Says Thank You to shoonmcgregor For This Useful Post: