Ticket #660 (new defect)

Opened 7 months ago

Last modified 3 months ago

mynctool with Nokia E61i just hangs, (but syncml-http-server works fine)

Reported by: AlainKnaff Assigned to: dgollub
Priority: high Milestone:
Component: Plugin: syncml Version:
Severity: major Keywords: http hang
Cc: felixmoeller

Description

Executing the msynctool just hangs, after printing some messages (including successful connection of the phone (member 2)):

> msynctool --sync noki2file --slow-sync contact
Synchronizing group "noki2file" [slow sync]
The previous synchronization was unclean. Slow-syncing
Member 1 of type file-sync just connected
received contact dsession
Member 2 of type syncml-http-server just connected
All clients connected or error
Member 1 of type file-sync just sent all changes

I do have libsyncml-0.4.5, and the syncml-http-server command included therein works just fine.

On the Nokia E61i, I've chosen "Server version 1.1" in both cases. With 1.2, it doesn't work with syncml-http-server either, as it doesn't recognize the devinfo.

For your information, here is the noki2file group definition that I use:

> msynctool --showgroup noki2file
Groupname: noki2file
Member 1: file-sync
        Configuration : <?xml version="1.0"?>
<config>
  <!-- directory path for file-sync -->
  <path>/home/alain/tmp/mysync/noki</path>

  <!-- should care of subdirectories (TRUE or FALSE) -->
  <recursive>FALSE</recursive>
</config>

Member 2: syncml-http-server
        Configuration : <?xml version="1.0"?>
<config>
  <!-- username to use. Leave empty to not require a username -->
  <username></username>

  <!-- the password for the username -->
  <password></password>

  <!-- The url that you want the server to listen on. This has to be set on the mobile as well. example: "/" -->
  <url></url>

  <!-- The port where to listen. This has to be set on the mobile as well. -->
  <port>9999</port>

  <!-- If wbxml is enabled, defines wether the wbxml should use string tables -->
  <usestringtable>0</usestringtable>

  <!-- Never send ADD command, but send REPLACE (not needed normally) -->
  <onlyreplace>0</onlyreplace>

  <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! -->
  <onlyLocaltime>0</onlyLocaltime>

  <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 -->
  <recvLimit>0</recvLimit>

  <maxObjSize>0</maxObjSize>

  <!-- The name of the contacts db. Must be the same as the phones sends -->
  <contact_db>addressbook</contact_db>

  <!-- The name of the calendar db. Must be the same as the phones sends -->
  <calendar_db>calendar</calendar_db>

  <!-- The name of the note db. Must be the same as the phones sends -->
  <note_db>notes</note_db>
</config>

Attachments

tcpdump.log (5.0 kB) - added by AlainKnaff on 01/24/08 09:05:26.
Tcpdump log of Nokia E61i trying to synchronize with syncml-http-server configured within msynctool

Change History

01/12/08 11:15:48 changed by felixmoeller

  • cc set to felixmoeller.

You might try the SVN version of libsyncml several issues were fixed there. You could try opensync 0.35 in addition too.

01/24/08 08:13:57 changed by AlainKnaff

Thanks

I'm just trying to compile opensync 0.35, but I can't seem to figure this cmake stuff out. Compiling libopensync itself works ok, but as soon as I move to the plugins, I get weird errors:

> cd /home/alain/compil/OpenSync/build/libopensync
> export UPDATE_TYPE=svn
> cmake -DLIB_SUFFIX=64 -DCMAKE_INSTALL_PREFIX=/usr/local/ ~/compil/opensync/libopensync-plugin-syncml-0.35
-- Cannot determine repository type. Please set UPDATE_TYPE to 'cvs' or 'svn'. CTest update will not work.
CMake Error: libopensync-plugin-syncml doesn't allow to build within the source directory. Please, create a seperate build directory and run 'cmake /home/alain/compil/opensync/libopensync-plugin-syncml-0.35 [options]'!
-- Configuring done

Any ideas?

Or is there a way to compile without cmake? Or are there precompiled .deb's out there?

Regards,

Alain

01/24/08 09:05:26 changed by AlainKnaff

  • attachment tcpdump.log added.

Tcpdump log of Nokia E61i trying to synchronize with syncml-http-server configured within msynctool

01/24/08 09:06:50 changed by AlainKnaff

  • version changed from 0.22 to 0.35.

Ok, solved the above problem by commenting out the offending test from cmake/modules/MacroEnsureOutOfSourceBuild.cmake (both the ${CMAKE_SOURCE_DIR} and ${CMAKE_BINARY_DIR} seem to point to the source directory, even if I start the compilation in a different build directory).

After that I noticed that I had to add <objformat>vcard30</objformat> etc to my database definition or it would complain about null formats. Wouldn't it be useful to supply this parameter within the example?

But even after adding this, it still doesn't work, it justs hangs:

> /usr/local/bin/msynctool  --sync noki2kabc --wait
Synchronizing group "noki2kabc"
The previous synchronization was unclean. Slow-syncing
Main sink of member 1 of type syncml-http-server just connected
event sink of member 2 of type kdepim-sync just connected
note sink of member 2 of type kdepim-sync just connected
contact sink of member 2 of type kdepim-sync just connected
Main sink of member 2 of type kdepim-sync just connected
contact sink of member 1 of type syncml-http-server just connected

Here is my syncml-http-server server config:

<?xml version="1.0"?>
<config>
  <!-- username to use. Leave empty to not require a username -->
  <username></username>
  
  <!-- the password for the username -->
  <password></password>
  
  <!-- The url that you want the server to listen on. This has to be set on the mobile as well. example: "/" -->
  <url>/</url>
  
  <!-- The port where to listen. This has to be set on the mobile as well. -->
  <port>8080</port>
  
  <!-- If wbxml is enabled, defines wether the wbxml should use string tables -->
  <usestringtable>0</usestringtable>
  
  <!-- Never send ADD command, but send REPLACE (not needed normally) -->
  <onlyreplace>0</onlyreplace>
  
  <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! -->
  <onlyLocaltime>0</onlyLocaltime>

  <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 -->
  <recvLimit>0</recvLimit>
  
  <maxObjSize>0</maxObjSize>
  
  <!-- Contact database -->
  <database>
     <name>Contacts</name>
     <objtype>contact</objtype>
     <objformat>vcard30</objformat>
  </database>
  
  <!-- Calendar database -->
  <database>
     <name>Calendar</name>
     <objtype>event</objtype>
     <objformat>vevent20</objformat>
  </database>

  
  <!-- Note database -->
  <database>
     <name>Notes</name>
     <objtype>note</objtype>
     <objformat>xmlformat-note</objformat>
  </database>

</config>

And attached is a tcpdump log It appears that the server never replies... i.e. even with 0.35, it still hangs...

Even adding the --wait options to msynctool didn't help.

02/09/08 19:46:40 changed by AlainKnaff

  • priority changed from normal to high.
  • version deleted.
  • severity changed from normal to major.

Problem still occurs with version 0.36

Strace shows that the phone succeeds to connect to the server, and even loads of data are exchanged between the phone and the server. During then hang, I only see "futex" syscalls... could this be some deadlocking issue internal to msyncroot?

02/09/08 21:34:54 changed by AlainKnaff

I tried doing some tracing using the OSYNC_TRACE environment variable.

One of the tracefiles has the following in it, before connecting with the phone to the http server:

[1202588864.889369]                     >>>>>>>  _osync_client_handle_connect(0x646c90, 0x66ace0, 0x42002f78)
[1202588864.889402]                             Searching sink for (null)
[1202588864.889445]                             osync_objtype_sink_set_slowsync: Setting slow-sync of object type "(null)" to 0
[1202588864.889492]                             >>>>>>>  osync_objtype_sink_connect(0x6583d0, 0x6546b0, 0x652790, 0x670a00)
[1202588864.889530]                                     >>>>>>>  connect_http_server(0x670a00)
[1202588864.889565]                                     <<<<<<<  connect_http_server
[1202588864.889596]                             <<<<<<<  osync_objtype_sink_connect
[1202588864.889861]                     <<<<<<<  _osync_client_handle_connect
[1202588864.889898]             <<<<<<<  _osync_client_message_handler
[1202588864.889932]     <<<<<<<  _incoming_dispatch: Done dispatching

Given the presence of connect_http_server, I suppose that's indeed the thread that handles the http connection from the phone.

After the phone connects, the following lines are appended:

[1202588890.875155]     >>>>>>>  _manager_event(0x659b60, 3, 0x67b540, (nil), 0x6546b0)
[1202588890.875264]             _manager_event: Just received a new session with ID 63
[1202588890.875412]             _manager_event: maxObjSize 10000000
[1202588890.875450]     <<<<<<<  _manager_event
[1202588892.270009]     >>>>>>>  _manager_event(0x659b60, 4, 0x67b540, (nil), 0x6546b0)
[1202588892.270118]             Session 63 reported final
[1202588892.270155]             gotChanges: 0 getChangesCtx: (nil) objtype: contact
[1202588892.270190]             gotChanges: 0 getChangesCtx: (nil) objtype: event
[1202588892.270222]     <<<<<<<  _manager_event

... and then nothing happens. From that point on, both msynctool and the phone hang. The phone displays "Connecting" forever, until I click cancel...

Why is it saying that Session 63 reported final, if it even hasn't started yet?

02/09/08 22:47:36 changed by AlainKnaff

Still broken in today's (Feb 9th) SVN version

05/11/08 17:54:08 changed by floe

I can confirm this bug, using libsyncml-0.4.6 and opensync-0.36 with a Motorola Razr V3xx. Using the syncml-http-server commandline tool works, however, opensync shows the same behavior as mentioned above (confirmed using OSYNC_TRACE): the session starts and immediately ends again.

05/21/08 13:25:35 changed by caeies

Hi all,

I can confirm the bug too, against a dev server (phpGW SyncML). Since I was not sure that the problem were "on your side" since I'm trying to validate our server. Anyway I can add the following :

Same messages like latest one from AlainKnaff? (version r3307 as requested by dgollub).

Things that I can add :

- There's a first demand from the msynctool to our server requesting for devinf. It's fails due to requesting authentication. A second request is made for devinf, with credential, which is successfull. Then the system wait until the note sink timeout. Then a 3rd request containing Alert for changes is done. But due to the timeout all others parts have been disconnected ...

Here the console output :

caeies@plouc486:~/sync/libsyncmlclient$ msynctool --sync evo2phpgw
Synchronizing group "evo2phpgw" 
The previous synchronization was unclean. Slow-syncing
note sink of member 2 of type file-sync just connected
Main sink of member 2 of type file-sync just connected

** (process:11188): WARNING **: status type : SyncHdr

** (process:11188): WARNING **: status type : Put

** (process:11188): WARNING **: status type : Get
Main sink of member 1 of type syncml-http-client just connected

** (process:11188): WARNING **: status type : SyncHdr

** (process:11188): WARNING **: status type : Put

** (process:11188): WARNING **: status type : Get
note sink of member 1 of type syncml-http-client had an error: Timeout.
The sync failed: No objtypes left without error. Aborting
note sink of member 2 of type file-sync just disconnected
Main sink of member 2 of type file-sync just disconnected

** (process:11188): WARNING **: status type : SyncHdr

** (process:11188): WARNING **: status type : Alert

-> Processus wait for a Ctrl-C for termination ... I try to go deeper in the code, but as I don't know so much how opensync works, I'm turning around trying to find a way to start ... As you can see I already put a g_warning when reading XML So I know that the 3rd message is done after the timeout (and if I put a highest value of timeout, it's still waiting for it ...).

I will be pleased to help.

Regards.

Caeies

05/21/08 17:20:24 changed by caeies

Back all,

I finally found my mistake. First of course it's not the syncml-http-server but the syncml-http-client that used in my case.

Second, the hang appears to be due to a bad configuration issue. In my case the first configuration was using 3 different databases. I was only using ones in the file-sync plugins. Removing 2 unneeded help me to make sync working ...

Perhaps you can try that ...

Regards.

Caeies