I am new to Go and I am trying to setup a simple graph database using Cayley with BoltDB as the backend datastore. Right now I am trying to run cayley from the command line. Running this command:
cayley http --db="bolt"
Generates this error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x8 pc=0x2517e7]
goroutine 16 [running]:
runtime.panic(0x6ae9e0, 0xbc1f44)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/boltdb/bolt.(*Bucket).Get(0x0, 0xc208000b68, 0x4, 0x8, 0x0, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/boltdb/bolt/bucket.go:256 +0x57
github.com/google/cayley/graph/bolt.(*QuadStore).getInt64ForKey(0xc20800eff0, 0xc208028270, 0x750ac0, 0x4, 0x0, 0xc20800e0b8, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/graph/bolt/quadstore.go:437 +0xd9
github.com/google/cayley/graph/bolt.func·009(0xc208028270, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/graph/bolt/quadstore.go:452 +0x76
github.com/boltdb/bolt.(*DB).View(0xc20807e180, 0xc2080a9a90, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/boltdb/bolt/db.go:490 +0xe4
github.com/google/cayley/graph/bolt.(*QuadStore).getMetadata(0xc20800eff0, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/graph/bolt/quadstore.go:458 +0x5a
github.com/google/cayley/graph/bolt.newQuadStore(0x75be50, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/graph/bolt/quadstore.go:91 +0x226
github.com/google/cayley/graph.NewQuadStore(0x7fff5fbff2b1, 0x4, 0x75be50, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/graph/quadstore.go:174 +0x21b
github.com/google/cayley/db.OpenQuadStore(0xc208048180, 0x0, 0x0, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/db/db.go:53 +0x176
github.com/google/cayley/db.Open(0xc208048180, 0x4, 0x0, 0x0)
/Users/tbrown/Development/src/github.com/google/cayley/db/db.go:40 +0x3f
main.main()
/Users/tbrown/Development/src/database_comparison/cayley/src/cayley/cayley.go:234 +0x77e
goroutine 19 [finalizer wait]:
runtime.park(0x17a40, 0xbc8118, 0xbc63a9)
/usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xbc8118, 0xbc63a9)
/usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
/usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1445
goroutine 20 [chan receive]:
github.com/barakmich/glog.(*loggingT).flushDaemon(0xbcb000)
/Users/tbrown/Development/src/github.com/barakmich/glog/glog.go:923 +0x75
created by github.com/barakmich/glog.init·1
/Users/tbrown/Development/src/github.com/barakmich/glog/glog.go:408 +0x37a
goroutine 17 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1445
goroutine 22 [syscall]:
os/signal.loop()
/usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
/usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x32
I feel like I am missing a step somewhere but I can't find any good documentation on using Cayley with Bolt. Any suggestions?
At least bolt must be installed.
go get github.com/boltdb/bolt/...
and db_path to the persistent single Bolt database file must be provided
cayley init --db=bolt --dbpath=/tmp/someBoltDB