ethereum/go-ethereum · error

not supported

Error message

not supported

What it means

remotedb.Database is a read-only key-value view over a remote node's debug RPC namespace (debug_dbGet / debug_dbAncient). AncientRange bulk-reads from the freezer; because no equivalent streaming RPC exists, the method panics with 'not supported' instead of returning data or an error.

Source

Thrown at ethdb/remotedb/remotedb.go:61

	var resp hexutil.Bytes
	err := db.remote.Call(&resp, "debug_dbGet", hexutil.Bytes(key))
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (db *Database) Ancient(kind string, number uint64) ([]byte, error) {
	var resp hexutil.Bytes
	err := db.remote.Call(&resp, "debug_dbAncient", kind, number)
	if err != nil {
		return nil, err
	}
	return resp, nil
}

func (db *Database) AncientRange(kind string, start, count, maxBytes uint64) ([][]byte, error) {
	panic("not supported")
}

func (db *Database) Ancients() (uint64, error) {
	var resp uint64
	err := db.remote.Call(&resp, "debug_dbAncients")
	return resp, err
}

func (db *Database) Tail(group string) (uint64, error) {
	panic("not supported")
}

func (db *Database) AncientSize(kind string) (uint64, error) {
	panic("not supported")
}

func (db *Database) ReadAncients(fn func(op ethdb.AncientReaderOp) error) (err error) {
	return fn(db)

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. Do not call AncientRange on a remotedb; use Ancient(kind, number) repeatedly via debug_dbAncient for individual records.
  2. Run the tooling locally against the node's datadir (leveldb/freezer) if bulk ancient reads are required.
  3. Expose a custom RPC on the remote node that streams the range, and call that instead.

Example fix

// before
items, err := db.AncientRange("headers", 0, 100, 1<<20) // panics

// after
for i := uint64(0); i < 100; i++ {
    item, err := db.Ancient("headers", i)
    if err != nil { break }
    _ = item
}
Defensive patterns

Strategy: validation

Validate before calling

if _, remote := db.(*remotedb.Database); remote {
    // no bulk ancient reads over RPC: fall back to per-item reads
    for i := start; i < start+count; i++ {
        item, err := db.Ancient(kind, i)
        if err != nil { return nil, err }
        items = append(items, item)
    }
    return items, nil
}
return db.AncientRange(kind, start, count, maxBytes)

Type guard

func isRemoteReadOnly(db ethdb.Database) bool {
    _, ok := db.(*remotedb.Database)
    return ok
}

Try / catch

If a third-party path may call it: wrap with defer/recover, detect the 'not supported' panic string, and retry with per-item Ancient() reads.

Prevention

When it happens

Trigger: Creating a db via remotedb.New(rpcClient) and calling AncientRange(kind, start, count, maxBytes) on it — typically from generic ethdb-consuming code such as chain iteration, snapshot tooling, or freezer readers.

Common situations: Diagnostics tools built on remotedb that are later handed to generic components expecting a full ethdb.AncientReader/AncientWriter; reusing analysis scripts against new code paths that bulk-read ancient data.

Related errors


AI-assisted analysis of ethereum/go-ethereum@6bb0588ad8 (2026-08-15). Data as JSON: /api/errors/eb6a9a1444034d73. Report an issue: GitHub.