couchbase/sync_gateway

http: panic serving 127.0.0.1:59854: interface conversion: *rest.EncodedResponseWriter is not http.Hijacker: missing method Hijack

eadistar opened this issue · 5 comments

Hi , I'm trying to connect couchbase server via reverse proxy.I have configured public sync gateway port to specific subdomain on Apache HTTP . I get following error while connecting to server.

2020-07-06T11:41:43.749Z [INF] HTTP: #218: GET /getting-started-db/_blipsync 2020-07-06 11:41:52.604999 I | http: panic serving 127.0.0.1:59854: interface conversion: *rest.EncodedResponseWriter is not http.Hijacker: missing method Hijack goroutine 508 [running]: net/http.(*conn).serve.func1(0xc000566000) /usr/local/go/1.13.4/go/src/net/http/server.go:1767 +0x139 panic(0xcf2a60, 0xc00056ae40) /usr/local/go/1.13.4/go/src/runtime/panic.go:679 +0x1b2 golang.org/x/net/websocket.Server.serveWebSocket(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/golang.org/x/net/websocket/server.go:74 +0x9e golang.org/x/net/websocket.Server.ServeHTTP(...) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/golang.org/x/net/websocket/server.go:70 github.com/couchbase/sync_gateway/rest.(*handler).handleBLIPSync(0xc0003b00b0, 0x0, 0x0) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/github.com/couchbase/sync_gateway/rest/blip_sync.go:201 +0x756 github.com/couchbase/sync_gateway/rest.(*handler).invoke(0xc0003b00b0, 0xe4b430, 0x0, 0x0) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/github.com/couchbase/sync_gateway/rest/handler.go:218 +0x218 github.com/couchbase/sync_gateway/rest.makeHandler.func1(0xf7f1a0, 0xc0002501c0, 0xc00035a600) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/github.com/couchbase/sync_gateway/rest/handler.go:94 +0x80 net/http.HandlerFunc.ServeHTTP(0xc0001ba820, 0xf7f1a0, 0xc0002501c0, 0xc00035a600) /usr/local/go/1.13.4/go/src/net/http/server.go:2007 +0x44 github.com/gorilla/mux.(*Router).ServeHTTP(0xc0002de5a0, 0xf7f1a0, 0xc0002501c0, 0xc00035a600) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/github.com/gorilla/mux/mux.go:114 +0xdb github.com/couchbase/sync_gateway/rest.wrapRouter.func1(0xf7f1a0, 0xc0002501c0, 0xc00035a100) /home/couchbase/jenkins/workspace/sgw-unix-build/2.7.3/community/godeps/src/github.com/couchbase/sync_gateway/rest/routing.go:309 +0x8d8 net/http.HandlerFunc.ServeHTTP(0xc0001baea0, 0xf7f1a0, 0xc0002501c0, 0xc00035a100) /usr/local/go/1.13.4/go/src/net/http/server.go:2007 +0x44 net/http.serverHandler.ServeHTTP(0xc000250000, 0xf7f1a0, 0xc0002501c0, 0xc00035a100) /usr/local/go/1.13.4/go/src/net/http/server.go:2802 +0xa4 net/http.(*conn).serve(0xc000566000, 0xf82f20, 0xc00038e000) /usr/local/go/1.13.4/go/src/net/http/server.go:1890 +0x875 created by net/http.(*Server).Serve /usr/local/go/1.13.4/go/src/net/http/server.go:2927 +0x38e

bbrks commented

@eadistar The error should be seen when a non-upgradable HTTP request is made to the /_blipsync endpoint, which only accepts connections that can be upgraded to websockets.

What client are you using to connect to Sync Gateway? Is it Couchbase Lite? Or a web browser?
It may be that your Apache config is not allowing websocket upgrades to happen.

@bbrks I'm using Couchbase Lite.

Hi @bbrks Thanks for your response. I reconfigured apache to handle WS. This issue has been solved from my side.

bbrks commented

I've filed an issue to improve this error message in the future:

https://issues.couchbase.com/browse/CBG-949