Open ivanovv opened 6 years ago
Were you ever able to debug this?
Nope.
We are sort of satisfied with what we have now, though lack of observability and community pushes me to rewrite everything WS related with something that has all of the above. I chose Elixir/Phoenix
But back to Nchan (which is a great tool nonetheless and I think nchan's problem and blessing is that it built atop of nginx, so many things come for free, but debugging is really problematic)
I used a fork of NchanSubscriber
that uses several transport one after another (https://github.com/interviewstreet/nchan.js), stopped using one connection for several tabs, but other than that – I don't remember what we changed exactly. Oh, there were changes to nchan itself since the issue was opened. My best guess would be that there is some firewall or something that prevents normal WS connection and longpoll fallback would be the best workaround in that case. But it's just a guess.
So long story short – like I said, we are sort of satisfied for now, everything works. We had issues with nchan segfaulting, but switching to single nginx worker mostly mitigates the crashes as nginx just restarts. And the last crash was almost half a year ago.
nchan's problem and blessing is that it built atop of nginx
tell me about it...
I'm trying to debug strange connections issues and I don't know what step to take next.
Here is all the info I have right now:
1) overview: the app is a collaboration app, with one (or more) presenter and several viewers. Presenters and viewers are connected to
nginx
withnchan
via websockets usingNchanSubscriber
. Presenters can send simplePOST
requests to the Rails app, Rails will publish the events vianchan
to all connected viewers.2) There are several server configs (servers listening on different domains with their own SSL certs), all of them have the same
nchan
relatednginx
configAnd there is a single
pub
server, available only locally:3)
nginx -V
OK, to the problem itself.
Here are several logs from client side:
and another example
PUBSUB: Connected
is emitted bypubsub.js
So
connect
event was triggered, butNchanSubscriber
has received no events that were sent to/pub
endpointLooking at the
nginx
access.log
I see a lot of lines with 499 response code:So, long story short:
NchanSubscriber
says we are connected, but won't receive anything from the server.The questions I have: 1) it is a correct config when the
pub
server is a separate server that listen local IP only? And there is a number ofsub
locations in different servers 2) Is there a way to track connection errors withinNchanSubscriber
? 3) Is there a way to makeNchanSubscriber
reconnect when connection is lost?