[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
MDB_INVALID: File is not an LMDB file
- To: openldap-technical@openldap.org
- Subject: MDB_INVALID: File is not an LMDB file
- From: Chris Trenkamp <chris@christrenkamp.com>
- Date: Wed, 30 May 2018 11:10:41 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christrenkamp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=2nA0aL0J6SF+n8IN5OVOmc3aATU9q2g5wYjJCtN2hTc=; b=S13EYKlKkBJ5yUPhcpuXvDunWMgIlJZ4N9T62BPrRGdYmByC69bZMrYK9F9405L039 lTFSgdWQsMB2DrGOpF+znS5RDbJBBCWY9DrA6wOGpYHIqivxDpPaedskdV8rihPVAdFH uIZprw8oz6KeQxKSARo+rVorodRCS31mV9aX+bhNqzn7I6pPNC7dHc3kRPACJ4SFCyJf Owt6xUhQxql74M9ACazG8xrwoWZoWIK5j4F7nfUrvr9RHhOLi5+I/nBy5WiQDPW6iP3y UdTWcDhuGXV5HsPzwv9LmM3ZNyHU5Iv9G6ciE3VkV/5kCcOJysK5Wz8WQS4lo7t78v3W Ub0w==
My program suddenly started returning this error, "MDB_INVALID: File
is not an LMDB file" whenever it tries to open the database file. It
is running on Windows.
I made a copy of the database, compiled lmdb with MDB_DEBUG set to 2
and ran this program:
#include <stdio.h>
#include "lmdb.h"
int main(int argc, char* argv[]) {
int rc;
MDB_env *env;
rc = mdb_env_create(&env);
printf("%d\n", rc);
rc = mdb_env_open(env, "./brokedb", 0, 0644);
printf("%d\n", rc);
}
And it gave this output:
0
mdb_env_read_header:4040 page 0 not a meta page
-30793
Does anyone know how this might have happened, and things to look for
in my program that might have caused this? Is there a way to recover
the data from the file?
Thanks.