"wrong attributetype" when using ldapadd
When attempting to load the following configuration
dn: olcDatabase={1}hdb,cn=config
changetype: modify
add: olcMirrorMode
olcMirrorMode: TRUE
I get the following error:
root@box:~# ldapadd -Y EXTERNAL -H ldapi:/// -f mirrormode.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
ldapadd: wrong attributeType at line 4, entry "olcDatabase={1}hdb,cn=config"
It looks fine to me -- what's the problem?
The problem turned out to be a trailing space on on this line:
add: olcMirrorMode
Grrr!
I've stepped on the same rake today, but there were no trailing spaces, there were another hidden joke.
My colleague have sent me a sample LDIF with a question, I tried to reproduce the problem he encountered by copying the text from the colleague's message. I've been struggling to understand what is wrong for an hour, before I understood that there was Unicode symbol U+00A0
(0xC2 0xA0
) instead of ASCII SPACE
(0x20
).
Thanks to vim and its syntax highlighting, vim was desperately trying to give me a clue: