I want to import some schemas into the LDAP. But I get this error:

ldapadd: invalid format (line 21) entry: ""

This is the file with the schemas:

# ****-Schema-Datei.
# OID prefix:
# Attributes:
# Depends on: nis.schema, which depends on cosine.schema
attributetype: ( NAME 'domain'
        DESC 'A mail domain'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SINGLE-VALUE )

attributetype: ( NAME 'forward'
        DESC 'Forward to mail address'
        EQUALITY caseIgnoreIA5Match
        SUBSTR caseIgnoreIA5SubstringsMatch
        SYNTAX{256} )

objectclass: ( NAME '****Domain' SUP top STRUCTURAL
        DESC 'Domain used for mail server'
        MUST ( domain )
        MAY ( description ) )

objectclass: ( NAME '****MailAccount' SUP top STRUCTURAL
        DESC 'Mail account object'
        MUST ( mail $ uidNumber $ gidNumber $ userPassword )
        MAY ( description ) )

objectclass: ( NAME '****MailAlias' SUP top STRUCTURAL
        DESC 'Mail aliasing forwarding entry'
        MUST ( mail $ forward )
        MAY ( description ) )

objectclass: ( NAME '****Account' SUP top AUXILIARY
        DESC 'User account'
        MUST ( homeDirectory )
        MAY ( uidNumber $ gidNumber $ uid $ cn $ description $ loginShell $ userPassword $ mail ) )

I just replaced the name of our organisation with **** for this website.

Why do I get this error?

Thank you for your help.




ldapadd loads LDIF files, you're trying to load a schema file. Either load the LDIF version of the schema if it's available or there's a way to convert a schema file into its LDIF equivalent by following the instructions here https://www.lisenet.com/2015/convert-openldap-schema-to-ldif/ to create a minimal slapd.conf including the schema and converting it to the cn=config form.

  • So I have to convert the schema, and than I can add it with this command ldapadd -Y EXTERNAL -H ldapi:/// -f /home/foo/*****.schema – leet Aug 4 '16 at 19:53
  • I did this, but now I get this error: slaptest -f /home/foo/****.schema -F /tmp/ldif-test 57a3abd2 /home/foo/****.schema: line 28 objectclass: AttributeType not found: "mail" slaptest: bad configuration directory! – leet Aug 4 '16 at 20:58
  • You probably need to include the core.schema and inetorgperson.schema schemas in the minimal slapd.conf file to satisfy any object and attribute dependencies. – bodgit Aug 5 '16 at 12:59
  • but there is no sldapd.conf. There is only the slapd.con/ (the database). – leet Aug 5 '16 at 19:28
  • Read what I wrote and linked to again. You have to create the minimal slapd.conf, literally just containing the two or three include directives for the schema files. – bodgit Aug 6 '16 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.