I have a strange problem exporting my directory into LDIF format. I am using the "mdb" format with openldap.
/usr/local/sbin/slapcat -l MyDomain.net.ldif -b "dc=MyDomain,dc=net"
If I run this command after starting "slapd", it works fine. However, I have this configured to run from a CRON job at midnight. It fails with this message:
5460a615 mdb_db_open: database "dc=MyDomain,dc=net" cannot be opened: No such file or directory (2). Restore from backup! 5460a615 backend_startup_one (type=mdb, suffix="dc=MyDomain,dc=net"): bi_db_open failed! (2) slap_startup failed
This also occurs from the command line if the database has not been accessed for several hours, usually on a weekend. Restarting "slapd" immediately corrects the problem.
I have checked and "slapd" is running when the failure occurs. I tried accessing the database and then using the backup command; however, the failure still continues. That is assuming that it failed to begin with obviously.
Is there some sort of a "sleep" mode or something like that, that I am not aware of, or some really hard to debug "bug" somewhere?
--On November 10, 2014 at 7:00:58 AM -0500 Jerry jerry@seibercom.net wrote:
I have a strange problem exporting my directory into LDIF format. I am using the "mdb" format with openldap.
/usr/local/sbin/slapcat -l MyDomain.net.ldif -b "dc=MyDomain,dc=net"
slapcat does not require slapd to be running to export a DB. I would note your slapcat command is missing a -F option, which I would generally advise you provide. You also do not state if cron is running as the same user as slapd, which would also be advised.
Thousands of systems slapcat DB's each and every night out of cron, w/o issue, including my own.
--Quanah
On Mon, 10 Nov 2014 07:42:44 -0800 Quanah Gibson-Mount quanah@zimbra.com wrote:
--On November 10, 2014 at 7:00:58 AM -0500 Jerry jerry@seibercom.net wrote:
I have a strange problem exporting my directory into LDIF format. I am using the "mdb" format with openldap.
/usr/local/sbin/slapcat -l MyDomain.net.ldif -b "dc=MyDomain,dc=net"
slapcat does not require slapd to be running to export a DB. I would note your slapcat command is missing a -F option, which I would generally advise you provide. You also do not state if cron is running as the same user as slapd, which would also be advised.
Thousands of systems slapcat DB's each and every night out of cron, w/o issue, including my own.
--Quanah
That is why I cannot figure out why I am have this problem, even if it is only sporadic.
CRON sent me this message this morning: (I sanitized the actual name)
5461944c mdb_db_open: database "dc=MyDomain,dc=net" cannot be opened: No such file or directory (2). Restore from backup! 5461944c backend_startup_one (type=mdb, suffix="dc=MyDomain,dc=net"): bi_db_open failed! (2) slap_startup failed
This is the actual code I am using in CRON:
nice /usr/local/sbin/slapcat -f /usr/local/etc/openldap/slapd.conf -b "dc=MyDomain,dc=net" -l usr/home/gerard/LDAP_Backup/MyDomain.net.ldif
Originally, I had created a Bash script and had CRON call that script; however, when things were not working as planned, I thought that might be the problem. However, it does not appear to be so.
Any ideas what I could be doing wrong? Remember, this only happens when there has been several hours of inactivity; otherwise it works fine.
Jerry jerry@seibercom.net schrieb am 11.11.2014 um 13:46 in Nachricht
20141111074619.038904f6@scorpio: [...]
This is the actual code I am using in CRON:
nice /usr/local/sbin/slapcat -f /usr/local/etc/openldap/slapd.conf -b "dc=MyDomain,dc=net" -l usr/home/gerard/LDAP_Backup/MyDomain.net.ldif
Originally, I had created a Bash script and had CRON call that script; however, when things were not working as planned, I thought that might be the problem. However, it does not appear to be so.
How about this: Go back to your script for repeatable results. Then try to run your script in batch (so you get results soon). If it does not work, try to run "id;sh -x your_script". You you slapcat as ldap user, and does ldap user have write permissions on the target file?
Any ideas what I could be doing wrong? Remember, this only happens when there has been several hours of inactivity; otherwise it works fine.
(I doubt that) Are there any syslog messages that indicate problems with the database? If so you might have a memory problem (not so uncommon with recent RAM sizes and the bugs in Intel CPUs).
Regards, Ulrich
On Tue, Nov 11, 2014 at 07:46:19AM -0500, Jerry wrote:
This is the actual code I am using in CRON:
nice /usr/local/sbin/slapcat -f /usr/local/etc/openldap/slapd.conf -b "dc=MyDomain,dc=net" -l usr/home/gerard/LDAP_Backup/MyDomain.net.ldif
Try running it under 'strace' so you can see what file it really tried to open. e.g.
strace -o /tmp/slapcat-trace.`date +%Y%m%d%H%M` /usr/local/sbin/slapcat -f /usr/local/etc/openldap/slapd.conf -b "dc=MyDomain,dc=net" -l usr/home/gerard/LDAP_Backup/MyDomain.net.ldif
Originally, I had created a Bash script and had CRON call that script; however, when things were not working as planned, I thought that might be the problem. However, it does not appear to be so.
Any ideas what I could be doing wrong? Remember, this only happens when there has been several hours of inactivity; otherwise it works fine.
Do any of the paths involved in the config go through NFS or automount points?
Andrew
openldap-technical@openldap.org