OUD11g: Iimport LDIF Data Which Including the UTF-8 BOM(byte order mark) Code Fails With "Error at or near line 1 in LDIF file work"

(Doc ID 2355328.1)

Last updated on JANUARY 31, 2018

Applies to:

Oracle Unified Directory - Version 11.1.2.2.0 to 12.2.1.3.0 [Release 11g to 12c]
Information in this document applies to any platform.

Symptoms

OUD fails to import the LDIF data which including UTF-8 BOM(byte order mark) code.

Example use case:

$cat bom.ldif
dn: uid=2018_01,ou=People,dc=example,dc=com
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: top
uid: 2018_01
cn: 2018_01
sn: 2018_01
givenName: 2018_01


bom.ldif file is created with UTF-8 format and BOM code included.

$od -tx1 bom.ldif
-------------------
0000000 ef bb bf 64 6e 3a 20 75 69 64 3d 32 30 31 38 5f
0000020 30 31 2c 6f 75 3d 50 65 6f 70 6c 65 2c 64 63 3d
0000040 65 78 61 6d 70 6c 65 2c 64 63 3d 63 6f 6d 0d 0a
0000060 6f 62 6a 65 63 74 43 6c 61 73 73 3a 20 70 65 72
0000100 73 6f 6e 0d 0a 6f 62 6a 65 63 74 43 6c 61 73 73
0000120 3a 20 6f 72 67 61 6e 69 7a 61 74 69 6f 6e 61 6c
0000140 70 65 72 73 6f 6e 0d 0a 6f 62 6a 65 63 74 43 6c
0000160 61 73 73 3a 20 69 6e 65 74 6f 72 67 70 65 72 73
0000200 6f 6e 0d 0a 6f 62 6a 65 63 74 43 6c 61 73 73 3a
0000220 20 74 6f 70 0d 0a 75 69 64 3a 20 32 30 31 38 5f
0000240 30 31 0d 0a 63 6e 3a 20 32 30 31 38 5f 30 31 0d
0000260 0a 73 6e 3a 20 32 30 31 38 5f 30 31 0d 0a 67 69
0000300 76 65 6e 4e 61 6d 65 3a 20 32 30 31 38 5f 30 31
0000320 0d 0a 6d 61 69 6c 3a 20 74 65 73 74 6d 61 69 6c
0000340
----------------------

ERROR:

$ldapmodify -p 30000 -D "cn=Directory Manager" -j pwd-file -a -f bom.ldif
Error at or near line 1 in LDIF file work/bom.ldif:
org.opends.server.util.LDIFException: Unable to parse LDIF entry starting at
line 1 because the first line does not contain a DN (the first line was
"???dn: uid=2018_01,ou=People,dc=example,dc=com")

 
 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms