Score:0

Issue with not being able to pars LDIF file (invalid format (line 5) entry: "cn=schema")

lb flag

Trying to add a new attribute to a schema by using this command:

ldapmodify -f ./add-id-attribute.ldif -h localhost -p 50389 -D "cn=Directory Manager" -w mySecretPassword

And this LDIF file

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications )
    DESC 'The attribute'

But it gives me the following response: ldapmodify: invalid format (line 5) entry: "cn=schema"

I already changed the line endings to UNIX but that did not help. I am using a docker image of OpenAM 6.5.2 which using OpenDJ as the directory server.

Score:1
in flag

Your LDiF is not formatted correctly.

The DESC line comes after the closing bracket ) on the USAGE line and can therefore not be parsed.

You need to move the ) so the attributeTypes definition becomes fully enclosed by ( )

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.32474 NAME 'myAttribute'
    USAGE userApplications 
    DESC 'The attribute' )
Wilko van der Veen avatar
lb flag
Thanks that works!
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.