varun2784 / weed-fs

Automatically exported from code.google.com/p/weed-fs
0 stars 0 forks source link

Building it manually results into nil pointer dereference on starting master #84

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. go get code.google.com/p/weed-fs/go/weed
2. go build code.google.com/p/weed-fs/go/weed
3. mkdir 1
4. ./weed server -master.port=9333 -dir=./1 -volume.port=8080

What is the expected output? What do you see instead?
[Expected]
I0825 14:17:16 06336 file_util.go:19] Folder ./1 Permission: -rwxr-xr-x
I0825 14:17:16 06336 file_util.go:19] Folder ./1 Permission: -rwxr-xr-x
I0825 14:17:16 06336 file_util.go:19] Folder ./1/filer Permission: -rwx------
I0825 14:17:16 06336 topology.go:84] Using default configurations.
I0825 14:17:16 06336 master_server.go:56] Volume Size Limit is 30000 MB
I0825 14:17:16 06336 server.go:181] Start Weed Master 0.62 at :9333
I0825 14:17:16 06336 raft_server.go:97] Recovered from log
I0825 14:17:16 06336 store.go:202] Store started on dir: ./1 with 0 volumes max 
7
I0825 14:17:16 06336 server.go:214] Start Weed volume server 0.62 at :8080

What we see instead:
I0825 13:17:59 06129 file_util.go:19] Folder ./1 Permission: -rwxr-xr-x
I0825 13:17:59 06129 file_util.go:19] Folder ./1 Permission: -rwxr-xr-x
I0825 13:17:59 06129 file_util.go:19] Folder ./1/filer Permission: -rwx------
I0825 13:17:59 06129 topology.go:84] Using default configurations.
I0825 13:17:59 06129 master_server.go:56] Volume Size Limit is 30000 MB
I0825 13:17:59 06129 server.go:181] Start Weed Master 0.63 beta at :9333
I0825 13:17:59 06129 raft_server.go:84] Initializing new cluster
I0825 13:17:59 06129 raft_server.go:92] raft: Has been stopped
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0xfced9]

goroutine 28 [running]:
runtime.panic(0x5e5920, 0x9a7604)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/panic.c:279 +0xf5
code.google.com/p/weed-fs/go/weed/weed_server.(*MasterServer).SetRaftServer(0xc2
0806e500, 0x0)
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/weed_server/master_server.go:79 +0x5e9
main.func·009()
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/server.go:196 +0x1f5
created by main.func·010
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/server.go:198 +0x565

goroutine 16 [semacquire]:
sync.runtime_Semacquire(0xc208036e3c)
    /private/tmp/go-ux1A/go/src/pkg/runtime/sema.goc:199 +0x30
sync.(*WaitGroup).Wait(0xc20804e5e0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/sync/waitgroup.go:129 +0x14b
main.runServer(0x9a49c0, 0xc20800e050, 0x0, 0x0, 0x0)
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/server.go:206 +0xc9a
main.main()
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/weed.go:76 +0x612

goroutine 19 [finalizer wait]:
runtime.park(0x29da0, 0x9aacb8, 0x9a96c9)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x9aacb8, 0x9a96c9)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]:
os/signal.loop()
    /usr/local/Cellar/go/1.3/libexec/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
    /usr/local/Cellar/go/1.3/libexec/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 21 [chan receive]:
code.google.com/p/weed-fs/go/glog.(*loggingT).flushDaemon(0x9adb00)
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/glog/glog.go:833 +0x75
created by code.google.com/p/weed-fs/go/glog.init·1
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/glog/glog.go:402 +0x2b2

goroutine 17 [syscall]:
runtime.goexit()
    /usr/local/Cellar/go/1.3/libexec/src/pkg/runtime/proc.c:1445

goroutine 23 [select]:
code.google.com/p/weed-fs/go/stats.(*ServerStats).Start(0xc20803af80)
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/stats/stats.go:92 +0x385
created by code.google.com/p/weed-fs/go/weed/weed_server.init·1
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/weed_server/common.go:23 +0x43

goroutine 24 [IO wait]:
net.runtime_pollWait(0xac1e90, 0x72, 0x0)
    /private/tmp/go-ux1A/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080a3a30, 0x72, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080a3a30, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).accept(0xc2080a39d0, 0x79c170, 0x0, 0xac0618, 0x23)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/fd_unix.go:409 +0x343
net.(*TCPListener).AcceptTCP(0xc20803c280, 0xac0f20, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/tcpsock_posix.go:234 +0x5d
net.(*TCPListener).Accept(0xc20803c280, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/tcpsock_posix.go:244 +0x4b
code.google.com/p/weed-fs/go/util.(*Listener).Accept(0xc20804f560, 0x0, 0x0, 
0x0, 0x0)
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/util/net_timeout.go:18 +0x6d
net/http.(*Server).Serve(0xc2080ccd20, 0xac1f40, 0xc20804f560, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/server.go:1698 +0x91
net/http.Serve(0xac1f40, 0xc20804f560, 0xac1f78, 0xc2080c8190, 0x0, 0x0)
    /usr/local/Cellar/go/1.3/libexec/src/pkg/net/http/server.go:1576 +0x7c
main.func·010()
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/server.go:201 +0x5df
created by main.runServer
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/weed/server.go:204 +0xc87

goroutine 25 [sleep]:
time.Sleep(0x253fca1c0)
    /private/tmp/go-ux1A/go/src/pkg/runtime/time.goc:39 +0x31
code.google.com/p/weed-fs/go/topology.func·005()
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/topology/topology_event_handling.go:17 +0xf3
created by 
code.google.com/p/weed-fs/go/topology.(*Topology).StartRefreshWritableVolumes
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/topology/topology_event_handling.go:19 +0x63

goroutine 27 [select]:
code.google.com/p/weed-fs/go/topology.func·007()
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/topology/topology_event_handling.go:30 +0x49f
created by 
code.google.com/p/weed-fs/go/topology.(*Topology).StartRefreshWritableVolumes
    /Users/parth.mudgal/Documents/local/gocode/src/code.google.com/p/weed-fs/go/topology/topology_event_handling.go:41 +0xd0

What version of the product are you using? On what operating system?

Checkout from source and building it on the machine.
OS - Have tried the following host and target combinations
- Compile from darwin,amd64 for darwin,amd64 and run on darwin,amd64
- Compile from darwin,amd64 for linux,amd64 and run on linux,amd64
- Compile from linux,amd64 for linux,amd64 and run on linux,amd64

If you have used "-peers" option before, have you cleared the sticky
cluster configuration file? Usually it is /tmp/conf file.

/tmp/conf: No such file or directory

Please provide any additional information below.

Have tried `go build`, and also `goxc` [https://github.com/laher/goxc]
The file on the download server you provided works fine
The file which i am building does not work with new folders.
If I start a master with your compile first, and then use the existing folder 
to run my compiled version, it works

Original issue reported on code.google.com by art...@gmail.com on 25 Aug 2014 at 8:59

GoogleCodeExporter commented 8 years ago
It works for me:

GOPATH=`pwd` go get code.google.com/p/weed-fs/go/weed
GOPATH=`pwd` go build code.google.com/p/weed-fs/go/weed
mkdir 1

./weed server -master.port=9333 -dir=./1 -volume.port=8080
I0825 15:14:22 01313 file_util.go:19] Folder ./1 Permission: -rwxrwxr-x
I0825 15:14:22 01313 file_util.go:19] Folder ./1 Permission: -rwxrwxr-x
I0825 15:14:22 01313 file_util.go:19] Folder ./1/filer Permission: -rwx------
I0825 15:14:22 01313 topology.go:84] Using default configurations.
I0825 15:14:22 01313 master_server.go:56] Volume Size Limit is 30000 MB
I0825 15:14:22 01313 server.go:181] Start Weed Master 0.63 beta at :9333
I0825 15:14:22 01313 raft_server.go:84] Initializing new cluster
I0825 15:14:22 01313 master_server.go:86] [ localhost:9333 ] I am the leader!
I0825 15:14:22 01313 store.go:202] Store started on dir: ./1 with 0 volumes max 
7
I0825 15:14:22 01313 server.go:214] Start Weed volume server 0.63 beta at :8080
I0825 15:14:22 01313 node.go:207] topo adds child DefaultDataCenter
I0825 15:14:22 01313 node.go:207] topo:DefaultDataCenter adds child DefaultRack
I0825 15:14:22 01313 node.go:207] topo:DefaultDataCenter:DefaultRack adds child 
127.0.0.1:8080
^CI0825 15:14:30 01313 volume_server.go:81] Shutting down volume server...
I0825 15:14:30 01313 volume_server.go:83] Shut down successfully!

go version
go version go1.2.2 linux/amd64

Maybe it's a problem with golang 1.3?

Original comment by claudiu....@gmail.com on 25 Aug 2014 at 12:18

GoogleCodeExporter commented 8 years ago
artpar, I could not reproduce this. Did you have a raft library before? Maybe 
you need to do

  go get -u github.com/goraft/raft/protobuf

to update the library.

Original comment by chris...@gmail.com on 25 Aug 2014 at 6:07

GoogleCodeExporter commented 8 years ago
Alright thanks. The protobuf library was the issue. There was this other issue 
which said protobuf was breaking the build because of the "Undefinds". And 
there was some other project which was broken by this issue and some said the 
temp solution was to use this

https://github.com/otoolep/raft/tree/master/protobuf 

instead of those files. so i pulled those. That worked when building but 
breaking at runtime.

Thanks.

Original comment by art...@gmail.com on 26 Aug 2014 at 10:52

GoogleCodeExporter commented 8 years ago

Original comment by chris...@gmail.com on 26 Aug 2014 at 5:28