ldap_modify: Other (e.g., implementation specific) error (80), <olcAccess> handler exited with 1

When modifying the Open-LDAP configuration using:

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to *
 by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write
 by * none

I get the error:

ldap_modify: Other (e.g., implementation specific) error (80)
    additional info: <olcAccess> handler exited with 1

This is because the line continuation in the ldif file removes the first space and the attribute is considered to be: {0}to *by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" writeby * none (which is invalid)

So, put an extra space in front of the line continuations:

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to *
  by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write
  by * none

Keep in mind that this error is thrown when your olcAccess statement has other syntax problems, too. For instance, I used a keyword in one of my 'by' clauses that didn't belong there and rather than telling me "you can't use 'UID' here" it kept saying "slapd: line 0: expecting 'access' got [my DN]". The errors for this thing are obtuse.