mosuka / blast

Blast is a full text search and indexing server, written in Go, built on top of Bleve.
Apache License 2.0
1.08k stars 76 forks source link

segfault when port 8080 is already bound #27

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

Thanks again for your last bugfix. Here is another issue:

./bin/blast-index start --node-id=index1 --data-dir=/tmp/blast/index1 --bind-addr=:6060 --grpc-addr=:5050 --http-addr=:8080 --index-mapping-file ./example/index_mapping.json 2019/03/14 16:26:27.068886 github.com/mosuka/blast/index/server.go:131 [ERR] listen tcp :8080: bind: address already in use panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xb51108]

goroutine 39 [running]: github.com/mosuka/blast/index.(*Server).Start(0x0) /home/rbastic/go-src/src/github.com/mosuka/blast/index/server.go:147 +0x68 created by main.execStart /home/rbastic/go-src/src/github.com/mosuka/blast/cmd/blast-index/start.go:78 +0x802

ghost commented 5 years ago

This happened because I was running dgraph already on my system, which also binds to port 8080. Stopping dgraph resolved this but I figured I would report the segfault anyway.

mosuka commented 5 years ago

@rbastic Thank you for your report. I fixed by following: https://github.com/mosuka/blast/pull/28

ghost commented 5 years ago

Thanks! This works 👍