Error in dgraphassigner when using prebuilt binaries

While setting up dgraph on an EC2 machine, I simply followed the automatic download instructions on the https://wiki.dgraph.io/Beginners_Guide

i.e. I ran

curl https://get.dgraph.io | bash

The binaries installed correctly in /usr/local/bin. However when I try to run dgraphassigner as follows:

dgraphassigner --numInstances 1 --instanceIdx 0 --rdfgzips benchmarks/data/rdf-films.gz --uids data/u

I get the following error:

INFO[0000] Set max procs to num cpus num_cpus=2 package=uidassigner_main prev_maxprocs=2
INFO[0000] Only XIDs with FP(xid)%numInstance == instanceIdx will be given UID instanceIdx=0 numInstances=1 package=uidassigner_main
INFO[0000] Handling… package=uidassigner_main path=benchmarks/data/rdf-films.gz
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x62ecb9]

goroutine 2915 [running]:
panic(0xafc160, 0xc82000e0d0)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/dgraph-io/dgraph/vendor/github.com/tecbot/gorocksdb.(*DB).Get(0x0, 0xc820028218, 0xc820105360, 0x10, 0x10, 0x0, 0x0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/vendor/github.com/tecbot/gorocksdb/db.go:224 +0xc9
github.com/dgraph-io/dgraph/store.(*Store).Get(0xc8201415c0, 0xc820105360, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/store/store.go:63 +0x93
github.com/dgraph-io/dgraph/posting.(*List).getPostingList(0xc82012a5b0, 0xc64948)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/posting/list.go:256 +0x281
github.com/dgraph-io/dgraph/posting.(*List).init(0xc82012a5b0, 0xc820105360, 0x10, 0x10, 0xc8201415c0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/posting/list.go:222 +0x25e
github.com/dgraph-io/dgraph/posting.GetOrCreate(0xc820105360, 0x10, 0x10, 0xc8201415c0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/posting/lists.go:234 +0x24a
github.com/dgraph-io/dgraph/uid.GetOrAssign(0xc8203b9cc1, 0xa, 0x0, 0x1, 0x0, 0x0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/uid/assigner.go:206 +0x120
github.com/dgraph-io/dgraph/loader.(*state).assignUid(0xc820079810, 0xc8203b9cc1, 0xa, 0x0, 0x0)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/loader/loader.go:197 +0x170
github.com/dgraph-io/dgraph/loader.(*state).assignUidsOnly(0xc820079810, 0xc820144330)
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/loader/loader.go:223 +0x1ab
created by github.com/dgraph-io/dgraph/loader.AssignUids
/home/ubuntu/go_work/src/github.com/dgraph-io/dgraph/loader/loader.go:317 +0x289

The same command runs on my mac with my custom built binary just fine.

This turns out to be because the directory data was missing. After I create it works fine. However on my manually built binary, it created the directory before proceeding and doesn’t crash.

Is there a reason prebuilt binaries have a different behavior? Or is it a Mac vs Linux difference?

The script picks up the latest release and installs that. When you do a custom build, you build from master. That’s the difference. Since the last release, we started automatically creating the directories.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.