Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG Panics if _bulk_get is passed empty JSON object #1033

Closed
ajres opened this issue Aug 5, 2015 · 0 comments · Fixed by #1059
Closed

SG Panics if _bulk_get is passed empty JSON object #1033

ajres opened this issue Aug 5, 2015 · 0 comments · Fixed by #1059
Assignees
Labels
Milestone

Comments

@ajres
Copy link

ajres commented Aug 5, 2015

curl -H "Content-Type: application/json" -d '{}' -X POST "http://localhost:4985/db/_bulk_get"

2015/08/05 19:38:32 http: panic serving 127.0.0.1:64888: interface conversion: interface is nil, not []interface {}
goroutine 53 [running]:
net/http.func·011()
/usr/local/go/src/net/http/server.go:1130 +0xbb
github.com/couchbase/sync_gateway/rest.func·005(0xc2080f41b0, 0x0, 0x0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/bulk_api.go:307 +0xf1
github.com/couchbase/sync_gateway/rest.(_handler).writeMultipart(0xc2081601b0, 0x6ffd60, 0x5, 0xc2081298b8, 0x0, 0x0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/handler.go:463 +0x38d
github.com/couchbase/sync_gateway/rest.(_handler).handleBulkGet(0xc2081601b0, 0x0, 0x0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/bulk_api.go:360 +0x1b0
github.com/couchbase/sync_gateway/rest.(_handler).invoke(0xc2081601b0, 0x997ac8, 0x0, 0x0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/handler.go:159 +0x4b8
github.com/couchbase/sync_gateway/rest.func·015(0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/handler.go:86 +0x7d
net/http.HandlerFunc.ServeHTTP(0xc2081d7e60, 0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/usr/local/go/src/net/http/server.go:1265 +0x41
github.com/gorilla/mux.(_Router).ServeHTTP(0xc2081726e0, 0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/Users/andy/Projects/sync_gateway/src/github.com/gorilla/mux/mux.go:86 +0x29e
github.com/couchbase/sync_gateway/rest.func·017(0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/Users/andy/Projects/sync_gateway/src/github.com/couchbase/sync_gateway/rest/routing.go:236 +0x32f
net/http.HandlerFunc.ServeHTTP(0xc2081c5000, 0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/usr/local/go/src/net/http/server.go:1265 +0x41
net/http.serverHandler.ServeHTTP(0xc208068180, 0xe35cb0, 0xc20824c3c0, 0xc20801e0d0)
/usr/local/go/src/net/http/server.go:1703 +0x19a
net/http.(_conn).serve(0xc20824c140)
/usr/local/go/src/net/http/server.go:1204 +0xb57
created by net/http.(_Server).Serve
/usr/local/go/src/net/http/server.go:1751 +0x35e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants