crossbario / crossbario/autobahn-python

nginx proxy 502 error after update to crossbar==19.10.1

Open
#1,257 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-investigation
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

Hello,
after crossbar update to 19.10.1, nginx throws 502, crossbar is started without any errors, but proxy doesn't works for some reason...

after that I reverted to crossbar 19.6.2, restarted crossbar server and reloaded app in browser and everything is fine - connected.

working setup:

 Crossbar.io        : 19.6.2
   txaio            : 18.8.1
   Autobahn         : 19.10.1
     UTF8 Validator : autobahn
     XOR Masker     : autobahn
     JSON Codec     : stdlib
     MsgPack Codec  : msgpack-0.6.2
     CBOR Codec     : cbor-1.0.0
     UBJSON Codec   : ubjson-0.14.0
     FlatBuffers    : flatbuffers-1.11
   Twisted          : 19.7.0-EPollReactor
   LMDB             : 0.97/lmdb-0.9.22
   Python           : 3.5.3/CPython
 Frozen executable  : no
 Operating system   : Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
 Host machine       : x86_64
 Release key        : RWTS7Lf+Zks97Pu2hRHkjaVPjjbDCUVc2tOAHjsd1a1W5cKKciAoSIRE

non-working setup (after update)

 Crossbar.io        : 19.10.1
   txaio            : 18.8.1
   Autobahn         : 19.10.1
     UTF8 Validator : autobahn
     XOR Masker     : autobahn
     JSON Codec     : stdlib
     MsgPack Codec  : msgpack-0.6.2
     CBOR Codec     : cbor-1.0.0
     UBJSON Codec   : ubjson-0.14.0
     FlatBuffers    : flatbuffers-1.11
   Twisted          : 19.7.0-EPollReactor
   LMDB             : 0.97/lmdb-0.9.22
   Python           : 3.5.3/CPython
 Frozen executable  : no
 Operating system   : Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
 Host machine       : x86_64
 Release key        : RWRlUB1klnmQWao9JKtkTu5GeI74LHoQnhH8q7vvT+oRlbyWRmd74kbw

NGINX upstream config

        map $http_upgrade $connection_upgrade {
            default upgrade;
            '' close;
        }

        upstream websocket {
            server 127.0.0.1:3110;
        }

NGINX proxy server config

server {
    listen 80;
    server_name ws.xxxxxx.com;

    access_log off;
    log_not_found off;

    location / {
        expires -1;
    }

    location /ws {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;

        proxy_pass http://websocket;
        proxy_redirect off;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

        location ~ /\. {
            log_not_found off;
            deny all;
        }
}

crossbar transports layer (working setup on crossbar==19.6.2)

.
.
.
      "transports": [
        {
          "type": "websocket",
          "endpoint": {
            "type": "tcp",
            "port": 3110
          },
          "options": {
            "enable_webstatus": false,
            "max_frame_size": 1048576,
            "max_message_size": 1048576,
            "auto_fragment_size": 65536,
            "fail_by_drop": true,
            "open_handshake_timeout": 6000,
            "close_handshake_timeout": 5000,
            "auto_ping_interval": 6000,
            "auto_ping_timeout": 6000,
            "auto_ping_size": 4,
            "compression": {
              "deflate": {
                "request_no_context_takeover": false,
                "request_max_window_bits": 11,
                "no_context_takeover": false,
                "max_window_bits": 11,
                "memory_level": 4
              }
            }
          }
        }
      ]

.
.
.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported 502 with the supplied NGINX upstream and /ws proxy configuration, comparing Crossbar.io 19.6.2 and 19.10.1 on the stated Python and Linux setup. Start with the Crossbar WebSocket transport configuration and the version change; done means the 19.10.1 setup connects successfully through NGINX without the 502 regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx, python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.