Tuesday, August 14, 2012

LDAP - Error - Unable to open log file

Description:
It's a good idea to log the progress of a LDAP import/export to see what entities have successfully imported/exported and what entities are not. To enable logging, we need to use '-j' option in the command with a valid location where log files will be created.

Command:


ldifde -i -f export.ldif -s localhost -t 10389 -a "uid=admin,ou=system" secret -k -j c:\logs

Explanation:
-i = enables import (default is export)
-f = indicate import/export file. After -f user has to provide a valid file to import data from 
-s = server info. Value after -s is server info
-t = port info after the option
-a = execute the command using supplied distinguish name and password
-k = to ignore 'Constraint Violation' and 'Object Already Exists' errors. This is import specific       
       option.
-j = enable logging. Value after this option has to be a valid location

Log Location:
If log location is valid, the command will create two log files ldif.err and ldif.log. First one includes all the errors, second one is for more verbose information


Errors:
1. Log file location must follow -j
2. Unable to open log file

Solution of errors:
1. -j must follow with valid log location and need to make sure no file name
2. Need to make sure file name not provided as log location