---
name: "mdb_errors"
section: "3"
platform: "linux"
package: "lmdb-doc"
version: "0.9.31-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mdb_errors"
---

# mdb\_errors(3)

Return Codes

## NAME

errors - Return Codes

## SYNOPSIS

### Macros

\#define **MDB\_SUCCESS**   0\
 \#define **MDB\_KEYEXIST**   (-30799)\
 \#define **MDB\_NOTFOUND**   (-30798)\
 \#define **MDB\_PAGE\_NOTFOUND**   (-30797)\
 \#define **MDB\_CORRUPTED**   (-30796)\
 \#define **MDB\_PANIC**   (-30795)\
 \#define **MDB\_VERSION\_MISMATCH**   (-30794)\
 \#define **MDB\_INVALID**   (-30793)\
 \#define **MDB\_MAP\_FULL**   (-30792)\
 \#define **MDB\_DBS\_FULL**   (-30791)\
 \#define **MDB\_READERS\_FULL**   (-30790)\
 \#define **MDB\_TLS\_FULL**   (-30789)\
 \#define **MDB\_TXN\_FULL**   (-30788)\
 \#define **MDB\_CURSOR\_FULL**   (-30787)\
 \#define **MDB\_PAGE\_FULL**   (-30786)\
 \#define **MDB\_MAP\_RESIZED**   (-30785)\
 \#define **MDB\_INCOMPATIBLE**   (-30784)\
 \#define **MDB\_BAD\_RSLOT**   (-30783)\
 \#define **MDB\_BAD\_TXN**   (-30782)\
 \#define **MDB\_BAD\_VALSIZE**   (-30781)\
 \#define **MDB\_BAD\_DBI**   (-30780)\
 \#define **MDB\_LAST\_ERRCODE**   **MDB\_BAD\_DBI**\

## Detailed Description

BerkeleyDB uses -30800 to -30999, we'll go under them

## Macro Definition Documentation

### #define MDB\_SUCCESS 0

Successful result

### #define MDB\_KEYEXIST (-30799)

key/data pair already exists

### #define MDB\_NOTFOUND (-30798)

key/data pair not found (EOF)

### #define MDB\_PAGE\_NOTFOUND (-30797)

Requested page not found - this usually indicates corruption

### #define MDB\_CORRUPTED (-30796)

Located page was wrong type

### #define MDB\_PANIC (-30795)

Update of meta page failed or environment had fatal error

### #define MDB\_VERSION\_MISMATCH (-30794)

Environment version mismatch

### #define MDB\_INVALID (-30793)

File is not a valid LMDB file

### #define MDB\_MAP\_FULL (-30792)

Environment mapsize reached

### #define MDB\_DBS\_FULL (-30791)

Environment maxdbs reached

### #define MDB\_READERS\_FULL (-30790)

Environment maxreaders reached

### #define MDB\_TLS\_FULL (-30789)

Too many TLS keys in use - Windows only

### #define MDB\_TXN\_FULL (-30788)

Txn has too many dirty pages

### #define MDB\_CURSOR\_FULL (-30787)

Cursor stack too deep - internal error

### #define MDB\_PAGE\_FULL (-30786)

Page has not enough space - internal error

### #define MDB\_MAP\_RESIZED (-30785)

Database contents grew beyond environment mapsize

### #define MDB\_INCOMPATIBLE (-30784)

Operation and DB incompatible, or DB type changed. This can mean:

- •

  The operation expects an **MDB\_DUPSORT** / **MDB\_DUPFIXED** database.

- •

  Opening a named DB when the unnamed DB has **MDB\_DUPSORT** / **MDB\_INTEGERKEY**.

- •

  Accessing a data record as a database, or vice versa.

- •

  The database was dropped and recreated with different flags.

### #define MDB\_BAD\_RSLOT (-30783)

Invalid reuse of reader locktable slot

### #define MDB\_BAD\_TXN (-30782)

Transaction must abort, has a child, or is invalid

### #define MDB\_BAD\_VALSIZE (-30781)

Unsupported size of key/DB name/data, or wrong DUPFIXED size

### #define MDB\_BAD\_DBI (-30780)

The specified DBI was changed unexpectedly

### #define MDB\_LAST\_ERRCODE MDB\_BAD\_DBI

The last defined error code

## Author

Generated automatically by Doxygen for LMDB from the source code.
