You are not logged in.

#1 2007-03-17 12:07:10

stb
Member
Registered: 2007-03-13
Posts: 40

SyncML + ldap-sync: Getting started

Hi,

<short_introduction>
I set up opensync to sync my mobile phone Nokia E60 with my laptop. Works without problems. Now I want the data from the phone to be stored in a LDAP server. The main target is to have a centralized address database for use with mail, phone, office, ...
</short_introduction>

I compiled the plugin libopensync-plugin-ldap-0.21 from source and installed it. Then  I set up a new group within multisync:

[dennis@x40 ~]$ msynctool --showgroup fileldap
Groupname: fileldap
Member 1: file-sync
        Configuration : <?xml version="1.0"?>
<config>
  <path>/home/dennis/sync2</path>
  <recursive>FALSE</recursive>
</config>

Member 2: ldap-sync
        Configuration : <?xml version="1.0"?>
<config>
   <!-- Server address and port -->
   <servername>localhost</servername>
   <serverport>389</serverport>
   <binddn>cn=Manager,dc=home-bs,dc=intern</binddn>
   <password>XXX</password>
   <anonymous>0</anonymous>
   <searchbase>ou=kontakte,dc=home-bs,dc=intern</searchbase>
   <searchfilter></searchfilter>
   <!-- BaseDN for storing contacts (using searchbase, if leaved blank) -->
   <storebase></storebase>
   <keyattr>cn</keyattr>
   <scope>sub</scope>
   <authmech>SIMPLE</authmech>
   <encryption>0</encryption>
   <ldap_read>1</ldap_read>
   <ldap_write>1</ldap_write>
</config>

When I run msynctool --sync fileldap the entries of the file member (1) get read but the ldap member (2) returns an error (broken pipe):

Synchronizing group "fileldap" 
Member 1 of type file-sync just connected
Member 2 of type ldap-sync just connected
All clients connected or error
Member 2 of type ldap-sync had an error while getting changes: Broken Pipe
Member 2 of type ldap-sync had an error while disconnecting: Broken Pipe
Received an entry 1 with data of size 24 from member 1 (file-sync). Changetype A
DDED
Received an entry 10 with data of size 24 from member 1 (file-sync). Changetype 
ADDED
[...]
Member 1 of type file-sync just sent all changes
Member 1 of type file-sync just disconnected
All clients have disconnected
The sync failed: Unable to read from one of the members
Error while synchronizing: Unable to read from one of the members

When I manually search via ldapsearch from the commandline, I can see my yet empty directory:

[dennis@x40 ~]$ ldapsearch -x
# extended LDIF
#
# LDAPv3
# base <> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# home-bs.intern
dn: dc=home-bs,dc=intern
objectClass: top
objectClass: dcObject
objectClass: organization
dc: home-bs
o: home-bs

# kontakte, home-bs.intern
dn: ou=kontakte,dc=home-bs,dc=intern
objectClass: top
objectClass: organizationalUnit
ou: kontakte
description: Addressbuch

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

I would be glad if someone can point me where to look. I'm going through the source right now but I'm not into opensync development so it's kinda hard to find the (possible) solution quickly.

Cheers

Dennis

Offline

#2 2007-03-17 13:00:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: SyncML + ldap-sync: Getting started

It's possible someone here will have the answer, but I'd recommend you try the opensync ML as well.

Offline

#3 2007-03-18 16:44:45

stb
Member
Registered: 2007-03-13
Posts: 40

Re: SyncML + ldap-sync: Getting started

It's possible someone here will have the answer, but I'd recommend you try the opensync ML as well.

I did post to the list yesterday. Let's see what happens. smile I will post any solutions I found myself here too. So if someone else has the same problem and searches the forum, he wil get some results.

UPDATE: The plugin is very bad documented IMO. I'm going through the source now and noticed you have to specify a search filter in its configuration, like (cn=*). Then the first (read) part succeeds. Now I'm fiddling with the data written into the LDAP tree.

Error writing entry 1 to member 2 (ldap-sync): LDAP Error: Undefined attribute type
Mapping Write Error: LDAP Error: Undefined attribute type
Error writing entry 10 to member 2 (ldap-sync): LDAP Error: Undefined attribute type
Mapping Write Error: LDAP Error: Undefined attribute type
Error writing entry 11 to member 2 (ldap-sync): LDAP Error: Internal (implementation specific) error
Mapping Write Error: LDAP Error: Internal (implementation specific) error

Offline

#4 2007-03-18 22:38:22

stb
Member
Registered: 2007-03-13
Posts: 40

Re: SyncML + ldap-sync: Getting started

After some further investigation I finally did it: I synced from file-sync -> ldap-sync. The bad: I won't use this sync method because it is far from being  useful IMO. The caveats are (in case I am not completely brain-damaged through the use of dwm yikes ):

Needs data already in database

The plugin needs the data already been stored into the LDAP server. It searches for a DN with a uid field set from the records of opensync but it does not set it by itself. (can be modified, see below)

Needs additional LDAP schema

Furthermore, it *requires* the use of the additional LDAP scheme evolutionperson.schema in case common fields like 'birthday' are in your records. (The schema can be found here).

Modify the sourcecode

I had to explicitly add the objectclass = { inetorgperson, evolutionperson } attribute  to each of my records. I had to set the uid from opensync as the first dn entry in the LDAP record. For the id, I had to modify  the function signature.

Common fields are not set

Fields like address(!) are still missing.

After I made the changes the plugin still does not end successful. It ends in an infinite loop, although the entries are stored within my LDAP database. I won't investigate on this one. Conclusion: I better search for another solution or add some fixes myself *searchesforCbeginnersguide*, I'm not turned off editing source by myself, but since there is only an empty ChangeLog and an empty README I'm a bit pissed now. At least it could have been stated that there are some missing fields.

Offline

Board footer

Powered by FluxBB