Socket io issue?



  • Hello.

    I have runing 0.5.5 nodebb forum. Sometimes The right sidebar plugin (Recent posts) can't fill nor load notifications, as you can see in the image. When I hit CTRL + F5 on Chrome 5 times, all the site runs ok, but most of the time not. Can I do something to fis this issue?

    I am using MongoDB as backend, Node 0.10.33 on a Centos 6 64bits server.

    Thanks for the help.

    upload-83aeff74-308c-4755-9b5c-7462c1e557f0



  • I have some issues too.. if its open for too much time.. i got lots of socket io errors on the console.. and the browser gets heavy.. :(


  • Admin

    Hm, interesting. @Normando can you confirm @Leonardo-Galani's claim that this happens only when the browser session is open too long?

    @baris is looking to upgrade NodeBB to socket.io 1.0, which may address this.


  • Admin

    Are you guys using clustering and did you setup redis? Is the browser doing xhr polling?



  • hmmm... not for me, the browser run smothly. At least as I can see.

    @julian I am not using clustering, so I not set the "cluster" key in config.json, nor setup redis. Thanks

    EDIT: Also this happens when I writing a post and the right side to preview does not fill with the parsed content I writing

    Sorry my bad english ๐Ÿ˜


  • Admin

    How do you start nodebb? Are you using nginx to proxy requests? What is the version of nginx?



  • Yes, I am using nginx:

    rpm -q nginx
    nginx-1.6.2-1.el6.ngx.x86_64
    

    Starting with ./nodebb start

    This is my config.json file:

    cat config.json
    {
        "base_url": "xxxxxxxxxxxxx",
        "port": "10000",
        "secret": "xxxxxxxxxxxxxx",
        "bind_address": "127.0.0.1",
        "database": "mongo",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "xxxxxxx",
            "password": "xxxxxxx",
            "database": "nodebb"
        },
        "bcrypt_rounds": 12,
        "upload_path": "/public/uploads",
        "use_port": false,
        "relative_path": ""
    }
    

  • Admin

    Did you setup nginx to proxy websockets check out this guide https://docs.nodebb.org/en/latest/configuring/proxies/nginx.html



  • @baris yes.

    server {
      listen       80;
      server_name *.xxxxxxxxxx.com.ar;
      return 301 $scheme://xxxxxxxxxx.com.ar$request_uri;
    }
    
    
    server {
        listen 80;
    
        server_name xxxxxxxxxx.com.ar;
    
        access_log  /var/log/nginx/vapor-access.log;
        error_log   /var/log/nginx/vapor-error.log;
    
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_redirect off;
    
        # Socket.io Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    
        gzip            on;
        gzip_min_length 1000;
        gzip_proxied    off;
        gzip_types      text/plain application/xml application/x-javascript text/css application/json;
    
        location @nodebb {
            proxy_pass http://127.0.0.1:10000;
        }
    
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js(\.map)?|stylesheet\.css|admin\.css) {
            root /opt/vapor/nodebb/public;
            try_files $uri $uri/ @nodebb;
        }
    
        location / {
            proxy_pass http://127.0.0.1:10000/;
        }
    #    error_page 405 = $uri;
    }
    
    

  • Admin

    If nodebb is running smoothly for awhile and later decides to stop working then there may be an issue with socket.io connections expiring or timing out...



  • I can confirm that there is no nginx issues, because I was switched proxy off and use port and I get the same issue.

    Also I was disabled all plugins and the issue continues. So, I am thinking about the Lavender template. Tell me if I am wrong.

    This issue with socket.io is very very irritating because 50% of forum features not working.

    Thanks guys for the help.



  • Why not happens this issue here and is present in my forum? Can you test it?

    This is the nginx timeout error, because socket.io

    2014/12/01 02:09:12 [error] 29961#0: *166 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 201.235.8.88, server: vapeandoargentina.com.ar, request: "GET /socket.io/1/xhr-polling/r3XfrKkqSy2ywgDXKA6S?t=1417410491280 HTTP/1.1", upstream: "http://127.0.0.1:20000/socket.io/1/xhr-polling/r3XfrKkqSy2ywgDXKA6S?t=1417410491280", host: "vapeandoargentina.com.ar", referrer: "http://vapeandoargentina.com.ar/"
    
    

  • Admin

    Are you using cloudflare? They don't have websocket support on the lower plans.



  • @baris said:

    Are you using cloudflare? They don't have websocket support on the lower plans.

    I can't understand your question. We are not using cloudflare. We have only activated "Spam Be Gone" plugin and only use reCaptcha.

    You mean this?

    	<!--[if lt IE 9]>
      		<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.3.0/es5-shim.min.js"></script>
      		<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
      		<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
      		<script>__lt_ie_9__ = 1;</script>
    	<![endif]-->
    

    I donยดt know where come this. I suspect from lavender template?


  • Admin

    Those should be fine we have them on this site as well and sockets work. I meant https://www.cloudflare.com/ but apparently you don't use them so I am not sure what the problem is.

    2014/12/01 02:09:12 [error] 29961#0: *166 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 201.235.8.88, server: vapeandoargentina.com.ar, request: "GET /socket.io/1/xhr-polling/r3XfrKkqSy2ywgDXKA6S?t=1417410491280 HTTP/1.1", upstream: "http://127.0.0.1:20000/socket.io/1/xhr-polling/r3XfrKkqSy2ywgDXKA6S?t=1417410491280", host: "vapeandoargentina.com.ar", referrer: "http://vapeandoargentina.com.ar/"
    

    Sounds like proxying is not configured properly.


  • Admin

    @Normando Give the latest commits a go ๐Ÿ˜„ Socket.IO 1.0 is merged in, undergoing testing at the moment.


  • Global Moderator

    @Julian, aand the smilies are broken again. ๐Ÿ˜† You'll probably have this in your console:

    1/12 13:57 [20209] - warn: Route requested but not found: /topic/1127/undefined/plugins/nodebb-plugin-emoji-extended/images/thumbsup.png
    1/12 13:57 [20209] - warn: Route requested but not found: /topic/1127/undefined/plugins/nodebb-plugin-emoji- extended/images/thumbsup.png
    

    But many times.



  • @baris No, proxy is ok. This happens without the proxy. I posted the nginx error onlyfor reference.

    About cloudflare I was removed from header.tpl and relodad nodebb, but the issue still there.

    I will test the new merged with Socket.Io 1.0.

    Thanks!


  • Global Moderator

    @Normando I suspect what you removed was the ie9 compatibility.



  • @a_5mith yes. I now restore again.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.