8

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?

seb
  • 361
  • 1
  • 2
  • 7

3 Answers3

18

The problem turned out to be a trailing space on on this line:

add: olcMirrorMode 

Grrr!

seb
  • 361
  • 1
  • 2
  • 7
2

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: vim tries to give a clue

Volodymyr Melnyk
  • 577
  • 1
  • 5
  • 19
0

In my case I missed to put a hyphen between multiple updates.

Wrong:

dn: cn=John Doe,ou=user,dc=example,dc=com
changetype: modify
add: disabled
disabled: 0
add: activity
activity: INACTIVE
ldapmodify: wrong attributeType at line 5, entry "cn=John Doe,ou=user,dc=example,dc=com"

Correct:

dn: cn=John Doe,ou=user,dc=example,dc=com
changetype: modify
add: disabled
disabled: 0
-
add: activity
activity: INACTIVE
mgutt
  • 503
  • 1
  • 7
  • 24