{"action":"created","issue":{"url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/138","labels_url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/138/comments","events_url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/138/events","html_url":"https://github.com/couchbaselabs/cbfs/issues/138","id":51871814,"number":138,"title":"sporadic runtime error: invalid memory address or nil pointer dereference","user":{"login":"tleyden","id":296876,"avatar_url":"https://avatars.githubusercontent.com/u/296876?v=3","gravatar_id":"","url":"https://api.github.com/users/tleyden","html_url":"https://github.com/tleyden","followers_url":"https://api.github.com/users/tleyden/followers","following_url":"https://api.github.com/users/tleyden/following{/other_user}","gists_url":"https://api.github.com/users/tleyden/gists{/gist_id}","starred_url":"https://api.github.com/users/tleyden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tleyden/subscriptions","organizations_url":"https://api.github.com/users/tleyden/orgs","repos_url":"https://api.github.com/users/tleyden/repos","events_url":"https://api.github.com/users/tleyden/events{/privacy}","received_events_url":"https://api.github.com/users/tleyden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-13T01:35:07Z","updated_at":"2015-01-31T07:17:06Z","closed_at":"2014-12-20T20:51:19Z","body":"\r\nI'm getting this error:\r\n\r\n```\r\n2014/12/13 01:24:57 http: panic serving 127.0.0.1:49634: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 955 [running]:\r\nnet/http.func·009()\r\n\t/usr/lib/go/src/pkg/net/http/server.go:1093 +0xae\r\nruntime.panic(0x7b1100, 0xc9f2a8)\r\n\t/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106\r\nmain.doGetUserDoc(0x7f3dec9c60d8, 0xc21013d3e0, 0xc21030a750)\r\n\t/opt/go/src/github.com/couchbaselabs/cbfs/http.go:521 +0xe94\r\nmain.doGet(0x7f3dec9bbfe0, 0xc21022da00, 0xc21030a750)\r\n\t/opt/go/src/github.com/couchbaselabs/cbfs/http.go:701 +0x1582\r\nmain.httpHandler(0x7f3dec9bbfe0, 0xc21022da00, 0xc21030a750)\r\n\t/opt/go/src/github.com/couchbaselabs/cbfs/http.go:849 +0x12c\r\nnet/http.HandlerFunc.ServeHTTP(0x8eb768, 0x7f3dec9bbfe0, 0xc21022da00, 0xc21030a750)\r\n\t/usr/lib/go/src/pkg/net/http/server.go:1220 +0x40\r\nnet/http.serverHandler.ServeHTTP(0xc21008d190, 0x7f3dec9bbfe0, 0xc21022da00, 0xc21030a750)\r\n\t/usr/lib/go/src/pkg/net/http/server.go:1597 +0x16e\r\nnet/http.(*conn).serve(0xc2102ee280)\r\n\t/usr/lib/go/src/pkg/net/http/server.go:1167 +0x7b7\r\ncreated by net/http.(*Server).Serve\r\n\t/usr/lib/go/src/pkg/net/http/server.go:1644 +0x28b\r\n2014/12/13 01:24:57 Recorded myself as an owner of f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0: result=success\r\n```\r\n\r\nCode that reproduces the (sporadic) error:\r\n\r\n```\r\n\r\n\t// Create a cbfs client\r\n\tcbfs, err := cbfsclient.New(config.CbfsUrl)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\t// write to random cbfs file\r\n\toptions := cbfsclient.PutOptions{\r\n\t\tContentType: \"text/plain\",\r\n\t}\r\n\r\n\tcontent := \"Hello\"\r\n\tdestPath := \"env_check.txt\"\r\n\tbuffer := bytes.NewBuffer([]byte(content))\r\n\r\n\tif err := cbfs.Put(\"\", destPath, buffer, options); err != nil {\r\n\t\treturn fmt.Errorf(\"Error writing %v to cbfs: %v\", destPath, err)\r\n\t}\r\n\r\n\t// read contents from cbfs file\r\n\treader, err := cbfs.Get(destPath)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tdefer reader.Close()\r\n\r\n\tbytes, err := ioutil.ReadAll(reader)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif string(bytes) != content {\r\n\t\treturn fmt.Errorf(\"Content did not match expected\")\r\n\t}\r\n\r\n\t// delete contents on cbfs\r\n\tif err := cbfs.Rm(destPath); err != nil {\r\n\t\treturn err\r\n\t}\r\n\treturn nil\r\n```\r\n\r\nThe `err` object returned from above code seems to be on the GET request:\r\n\r\n```\r\nGet http://localhost:8484/env_check.txt: EOF\r\n```"},"comment":{"url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/comments/72307986","html_url":"https://github.com/couchbaselabs/cbfs/issues/138#issuecomment-72307986","issue_url":"https://api.github.com/repos/couchbaselabs/cbfs/issues/138","id":72307986,"user":{"login":"bchavez","id":478118,"avatar_url":"https://avatars.githubusercontent.com/u/478118?v=3","gravatar_id":"","url":"https://api.github.com/users/bchavez","html_url":"https://github.com/bchavez","followers_url":"https://api.github.com/users/bchavez/followers","following_url":"https://api.github.com/users/bchavez/following{/other_user}","gists_url":"https://api.github.com/users/bchavez/gists{/gist_id}","starred_url":"https://api.github.com/users/bchavez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bchavez/subscriptions","organizations_url":"https://api.github.com/users/bchavez/orgs","repos_url":"https://api.github.com/users/bchavez/repos","events_url":"https://api.github.com/users/bchavez/events{/privacy}","received_events_url":"https://api.github.com/users/bchavez/received_events","type":"User","site_admin":false},"created_at":"2015-01-31T07:17:06Z","updated_at":"2015-01-31T07:17:06Z","body":"@tleyden , could you possibly push a new release on http://cbfs-ext.hq.couchbase.com/dist/ . The binaries seem to be out of date as I'm currently running into this nil pointer issue."}}