dgraph-io/badger · error

manifest has unsupported version: %d (we support %d). Please

Error message

manifest has unsupported version: %d (we support %d).
Please see https://github.com/dgraph-io/badger/blob/main/docs/troubleshooting.md#i-see-manifest-has-unsupported-version-x-we-support-y-error on how to fix this

What it means

Error "manifest has unsupported version: %d (we support %d). Please see https://github.com/dgraph-io/badger/blob/main/docs/troubleshooting.md#i-see-manifest-has-unsupported-version-x-we-support-y-error on how to fix this" thrown in dgraph-io/badger.

Source

Thrown at manifest.go:370

// that).  In normal conditions, truncOffset is the file size.
func ReplayManifestFile(fp *os.File, extMagic uint16, opt Options) (Manifest, int64, error) {
	r := countingReader{wrapped: bufio.NewReader(fp)}

	var magicBuf [8]byte
	if _, err := io.ReadFull(&r, magicBuf[:]); err != nil {
		return Manifest{}, 0, errBadMagic
	}
	if !bytes.Equal(magicBuf[0:4], magicText[:]) {
		return Manifest{}, 0, errBadMagic
	}

	extVersion := y.BytesToU16(magicBuf[4:6])
	version := y.BytesToU16(magicBuf[6:8])

	if version != badgerMagicVersion {
		return Manifest{}, 0,
			//nolint:lll
			fmt.Errorf("manifest has unsupported version: %d (we support %d).\n"+
				"Please see https://github.com/dgraph-io/badger/blob/main/docs/troubleshooting.md#i-see-manifest-has-unsupported-version-x-we-support-y-error"+
				" on how to fix this",
				version, badgerMagicVersion)
	}
	if extVersion != extMagic {
		return Manifest{}, 0,
			fmt.Errorf("cannot open DB because the external magic number doesn't match, "+
				"expected: %d, version present in manifest: %d", extMagic, extVersion)
	}

	stat, err := fp.Stat()
	if err != nil {
		return Manifest{}, 0, err
	}

	build := createManifest()
	var offset int64
	for {

View on GitHub (pinned to 2a001d466f)

Solutions

  1. Check the on-disk version in the error against your binary: the MANIFEST was written by a newer (or much older) Badger release than the code you are running
  2. Upgrade the badger/v4 dependency to at least the version that wrote the database, then reopen
  3. If downgrade is intended, export/dump the data with the newer version and re-import into a database created by the older version
  4. Alternatively start a fresh database directory with the current binary and restore data from backup
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at manifest.go:370 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dgraph-io/badger@2a001d466f (2026-09-05). Data as JSON: /api/errors/b6a29c443c52c59a. Report an issue: GitHub.