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

Panic on enable user_subscribe_to_personal #436

Closed
xjtdy888 opened this issue Apr 3, 2021 · 3 comments · Fixed by #437
Closed

Panic on enable user_subscribe_to_personal #436

xjtdy888 opened this issue Apr 3, 2021 · 3 comments · Fixed by #437

Comments

@xjtdy888
Copy link
Contributor

xjtdy888 commented Apr 3, 2021

version: Centrifugo v2.8.3 (Go version: go1.16.2)
primary config:

   "proxy_connect_endpoint": "http://localhost:8000/api/cent/connect",
   "user_subscribe_to_personal" : true,
   "user_personal_channel_namespace": "personal",

  "namespaces": [
  	{
  		"name": "personal"
  	}
panic: assignment to entry in nil map

goroutine 53 [running]:
github.com/centrifugal/centrifugo/internal/client.(*Handler).OnClientConnecting(0xc000290240, 0x1b7b658, 0xc0000ac198, 0xc0001ac930, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/runner/work/centrifugo/centrifugo/internal/client/handler.go:295 +0x34b
github.com/centrifugal/centrifugo/internal/client.(*Handler).Setup.func1(0x1b7b658, 0xc0000ac198, 0xc0001ac930, 0x24, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0004cc3d8, ...)
	/home/runner/work/centrifugo/centrifugo/internal/client/handler.go:82 +0xeb
github.com/centrifugal/centrifuge.(*Client).connectCmd(0xc0002be000, 0xc00008c140, 0xc0004d4078, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/client.go:1596 +0x1ad8
github.com/centrifugal/centrifuge.(*Client).handleConnect(0xc0002be000, 0xc0004cc100, 0xd, 0x10, 0xc0004d4078, 0x0, 0x19b4b60)
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/client.go:929 +0x1e5
github.com/centrifugal/centrifuge.(*Client).handleCommand(0xc0002be000, 0xc0004ca000, 0x0)
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/client.go:812 +0x519
github.com/centrifugal/centrifuge.(*Client).Handle(0xc0002be000, 0xc0004c6000, 0x1f, 0x200, 0x200)
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/client.go:721 +0x411
github.com/centrifugal/centrifuge.(*WebsocketHandler).ServeHTTP.func2(0x5d21dba00, 0x3b9aca00, 0x0, 0x1a14653, 0x4, 0x1a14653, 0x4, 0xc0001cc000, 0xc0000bfb00, 0xc000090400)
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/handler_websocket.go:343 +0x559
created by github.com/centrifugal/centrifuge.(*WebsocketHandler).ServeHTTP
	/home/runner/go/pkg/mod/github.com/centrifugal/centrifuge@v0.14.2/handler_websocket.go:304 +0x2a5
@xjtdy888
Copy link
Contributor Author

xjtdy888 commented Apr 3, 2021

It looks like

subscriptions = connectReply.Subscriptions

This overwrites the previously initialized variable and becomes nil if the endpoint does not return channel information

@FZambia
Copy link
Member

FZambia commented Apr 4, 2021

@xjtdy888 hello, thanks for finding and fixing! Let's keep this open till release.

@FZambia
Copy link
Member

FZambia commented Apr 4, 2021

v2.8.4 with #437 released

@FZambia FZambia closed this as completed Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants