Score:0

How to solve "Unexpected token" error while adding schac schema to openldap

cn flag

I'm trying to add the schac schema to my OpenLDAP installation using the provided LDIF file but this fails with an "Unexpected token" error:

root [2533] /etc/ldap/schema# ldapadd -Y EXTERNAL -H ldapi:/// -f schac-schema-1.5.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=schac,cn=schema,cn=config"
ldap_add: Other (e.g., implementation specific) error (80)
        additional info: olcAttributeTypes: Unexpected token before DESC 'RFC 3066 code for prefered language of communication'EQUALITY caseExactMatchSINGLE-VALUESYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

Here is the top of the LDIF file ; the error happens on the first olcAttributeTypes declaration.

dn: cn=schac,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: schac
olcObjectIdentifier: TERENA 1.3.6.1.4.1.25178
olcObjectIdentifier: schac TERENA:1
olcObjectIdentifier: schacExperimental schac:0
olcObjectIdentifier: schacObjectClass schac:1
olcObjectIdentifier: schacAttributeType schac:2
olcObjectIdentifier: schacExpObjClass schacExperimental:1
olcObjectIdentifier: schacExpAttr schacExperimental:2
olcAttributeTypes: ( schacAttributeType:1
 NAME 'schacMotherTongue'
 DESC 'RFC 3066 code for prefered language of communication'
 EQUALITY caseExactMatch
 SINGLE-VALUE
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
olcAttributeTypes: ( schacAttributeType:2
 NAME 'schacGender'
 DESC 'Representation of human sex (see ISO 5218)'
 EQUALITY integerMatch
 SINGLE-VALUE
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
.... etc...

Since this schema has a great user base I'd be surprised it is malformed so I'm guessing there might be some dependency between the schac schema and some other pre-required schema but this is a wild guess.

I already have 7 other schemas in this OpenLDAP 2.4.47 installation on Debian buster.

Any help is welcome.

tuna avatar
cn flag
Did you got that working? Having the same error :(
phep avatar
cn flag
No. This problem is still on our todo-list, unfortunately. Since it is still not a strict *requirement* for us we just worked around it but there shall be a day when... :-/.
tuna avatar
cn flag
I've solved it for me. You can find the actual schema file at GitHub (https://github.com/REFEDS/SCHAC/blob/master/schema/LDAP.txt). Now its just a matter of using `schema2ldif` to convert it to an LDIF file. I suspect that the provided LDIF file has different indentations which is causing the error.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.