Symptoms
Provider registered VPS-based LDAP replica in POA after the update 5.4.13 was installed.
The task 'Configuring access for LDAP replica' fails with the following error message:
Destination host_id #367 : -1 : Can't perform "upload" operation: Cannot open destination file "/": Is a directory [21]
Also, task execution removed the /etc/openldap/slapd.conf file on the LDAP replica server being registered. As a result LDAP server cannot start on the replica server:
# /etc/init.d/ldap restart
Stopping slapd: [ OK ]
grep: /etc/openldap/slapd.conf: No such file or directory
egrep: /etc/openldap/slapd.conf: No such file or directory
egrep: /etc/openldap/slapd.conf: No such file or directory
Checking configuration files for slapd: [FAILED]
could not stat config file "/etc/openldap/slapd.conf": No such file or directory (2)
slaptest: bad configuration file!
Cause
The problem is caused by incorrect XML packet that POA sends to PVA Agent for temporary file creation, the part of content of the broken packet is provided in the example below:
<target>filer</target>
<ns3:dst><ns3:host>a44731b4-899f-8e43-97d8-e40d3cfe6434</ns3:host></ns3:dst>
<ns1:data><ns4:filer><ns4:upload>
<ns4:file>
<ns4:path/>
<ns4:size>47</ns4:size>
<ns4:offset>0</ns4:offset>
<ns4:body>L2luY2x1ZGUgXC9ldGNcL29wZW5sZGFwXC9zY2hlbWFcL21haWwuYWNjZXNzL2Q=</ns4:body>
</ns4:file>
</ns4:upload></ns4:filer>
The exact problem is in the <ns4:path/>
item - it contains empty path to the target file. So, during task execution the /etc/openldap/slapd.conf file is being removed.
Resolution
Actually, content of the /etc/openldap/slapd.conf remains as temporary file on LDAP replica server like /etc/openldap/.forbtmpSc1231 because transaction was not completed:
[root@ldaprep2 ~]# ll -a /etc/openldap/
total 36
drwxr-xr-x 4 root root 4096 Aug 9 06:29 .
drwxr-xr-x 51 root root 4096 Aug 8 11:18 ..
drwxr-xr-x 2 root root 4096 Jul 12 2012 cacerts
-rw-r----- 1 root ldap 921 Jul 12 2012 DB_CONFIG.example
-rw-r----- 1 root ldap 4065 Aug 9 06:28 .forbtmpSc1231
-rw-r--r-- 1 root root 246 Jul 12 2012 ldap.conf
drwxr-xr-x 3 root root 4096 Aug 9 06:29 schema
-rw-r----- 1 root root 4065 Aug 8 11:49 slapd.conf.bak
Rename the temporary file back on the LDAP replica to restore LDAP server functioning (replace .forbtmpSc1231 in the command below with the actual file name):
mv /etc/openldap/.forbtmpSc1231 /etc/openldap/slapd.conf
Then, copy the /etc/openldap/schema/mail.access file from the master LDAP server to the LDAP replica and add the following line to the /etc/openldap/slapd.conf file on replica:
include /etc/openldap/schema/mail.access
Restart the LDAP server on the replica:
/etc/init.d/ldap restart