gcash/bchd

Crash on call to /pb.bchrpc/GetAddressUnspentOutputs

FreeTrade opened this issue · 3 comments

This is shortly after starting the node, syncing from 0 - looking for a utxo from block 20

[INF] GRPC: Unary method /pb.bchrpc/GetAddressUnspentOutputs invoked by 127.0.0.1:54207
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x837b8f]

goroutine 31856 [running]:
github.com/gcash/bchd/database/ffldb.rollbackOnPanic(0xc0051dc0a0)
/home/travis/gopath/src/github.com/gcash/bchd/database/ffldb/db.go:1903 +0x7e
panic(0xc5efc0, 0x15abcb0)
/home/travis/.gimme/versions/go1.14.2.linux.amd64/src/runtime/panic.go:969 +0x174
github.com/gcash/bchd/database/ffldb.rollbackOnPanic(0xc0051dc140)
/home/travis/gopath/src/github.com/gcash/bchd/database/ffldb/db.go:1903 +0x7e
panic(0xc5efc0, 0x15abcb0)
/home/travis/.gimme/versions/go1.14.2.linux.amd64/src/runtime/panic.go:969 +0x174
github.com/gcash/bchd/blockchain/indexers.dbFetchAddrIndexEntries(0x0, 0x0, 0x2b0c9841fd33500, 0x4353dee4779c849d, 0xd856a86796, 0x271000000000, 0xfb9201, 0xc000277488, 0x203000d, 0x8, ...)
/home/travis/gopath/src/github.com/gcash/bchd/blockchain/indexers/addrindex.go:254 +0x17f
github.com/gcash/bchd/blockchain/indexers.(*AddrIndex).TxRegionsForAddress.func1(0xff3d80, 0xc0051dc140, 0xc0051dc140, 0x0)
/home/travis/gopath/src/github.com/gcash/bchd/blockchain/indexers/addrindex.go:797 +0x191
github.com/gcash/bchd/database/ffldb.(*db).View(0xc000058000, 0xc0028d6140, 0x0, 0x0)
/home/travis/gopath/src/github.com/gcash/bchd/database/ffldb/db.go:1926 +0xa0
github.com/gcash/bchd/blockchain/indexers.(*AddrIndex).TxRegionsForAddress(0xc000058140, 0xff3d80, 0xc0051dc0a0, 0xfe7020, 0xc0005f67b0, 0x271000000000, 0xc004386201, 0x10, 0x10, 0xc9be40, ...)
/home/travis/gopath/src/github.com/gcash/bchd/blockchain/indexers/addrindex.go:787 +0x12b
github.com/gcash/bchd/bchrpc.(*GrpcServer).fetchTransactionsByAddress.func1(0xff3d80, 0xc0051dc0a0, 0xc0051dc0a0, 0x0)
/home/travis/gopath/src/github.com/gcash/bchd/bchrpc/server.go:1765 +0xbd
github.com/gcash/bchd/database/ffldb.(*db).View(0xc000058000, 0xc00311bae0, 0x0, 0x0)
/home/travis/gopath/src/github.com/gcash/bchd/database/ffldb/db.go:1926 +0xa0
github.com/gcash/bchd/bchrpc.(*GrpcServer).fetchTransactionsByAddress(0xc0001ac0a0, 0xfe7020, 0xc0005f67b0, 0x0, 0x2710, 0x0, 0x0, 0xc00012a200, 0x70, 0x78, ...)
/home/travis/gopath/src/github.com/gcash/bchd/bchrpc/server.go:1764 +0x1c9
github.com/gcash/bchd/bchrpc.(*GrpcServer).GetAddressUnspentOutputs(0xc0001ac0a0, 0xfe6520, 0xc002eb33b0, 0xc0028d60c0, 0xc0001ac0a0, 0xc002eb27e0, 0x2)
/home/travis/gopath/src/github.com/gcash/bchd/bchrpc/server.go:954 +0x2b3
github.com/gcash/bchd/bchrpc/pb._Bchrpc_GetAddressUnspentOutputs_Handler.func1(0xfe6520, 0xc002eb33b0, 0xd05ca0, 0xc0028d60c0, 0x2, 0x2, 0xc00004c700, 0x181500)
/home/travis/gopath/src/github.com/gcash/bchd/bchrpc/pb/bchrpc.pb.go:3986 +0x8d
main.interceptUnary(0xfe6520, 0xc002eb33b0, 0xd05ca0, 0xc0028d60c0, 0xc003462cc0, 0xc003462d60, 0xc002c65ba0, 0x4fe24f, 0xcf1240, 0xc002eb33b0)
/home/travis/gopath/src/github.com/gcash/bchd/grpcserver.go:120 +0x18b
github.com/gcash/bchd/bchrpc/pb._Bchrpc_GetAddressUnspentOutputs_Handler(0xd4f8e0, 0xc0001ac0a0, 0xfe6520, 0xc002eb33b0, 0xc001ff4480, 0xedb1d8, 0xfe6520, 0xc002eb33b0, 0xc003a0c060, 0x2c)
/home/travis/gopath/src/github.com/gcash/bchd/bchrpc/pb/bchrpc.pb.go:3988 +0x152
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000641a0, 0xff0a60, 0xc00035e3f0, 0xc004490600, 0xc00061b3b0, 0x15b9420, 0x0, 0x0, 0x0)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.29.1/server.go:1082 +0x511
google.golang.org/grpc.(*Server).handleStream(0xc0000641a0, 0xff0a60, 0xc00035e3f0, 0xc004490600, 0x0)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.29.1/server.go:1405 +0xcd2
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc004a26240, 0xc0000641a0, 0xff0a60, 0xc00035e3f0, 0xc004490600)
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.29.1/server.go:746 +0xa8
created by google.golang.org/grpc.(*Server).serveStreams.func1
/home/travis/gopath/pkg/mod/google.golang.org/grpc@v1.29.1/server.go:744 +0xa8

preceeding status is -
[INF] SYNC: Processed 6910 blocks in 10s (6974 transactions, height 30805/652266 (4.72%), 2009-12-21 12:35:58, ~0 MiB cache)

Seems to be to do with combining
prune=1
prunedepth=4320

with

addrindex=1

Was hoping addrindex would not require full txhistory. Seems like maybe it does. Still testing.

Looks like I can prune manually by deleting old .fdb files (half gig files) and getaddressunspentoutputs still works, so maybe prune/addrindex are not inherently incompatible. Continuing to test.