crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

proxy workers: better hanlding for denied backend connections #1799

Open oberstet opened 4 years ago

oberstet commented 4 years ago
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] <crossbar.worker.proxy.ProxyFrontendSession.onOpen> Proxy frontend session connected from peer tcp4:172.21.0.1:24264
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] <crossbar.worker.proxy.ProxyFrontendSession._process_Hello> No authentication configured for proxy frontend: using default anonymous access policy for incoming proxy frontend session
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] <crossbar.router.auth.anonymous.PendingAuthAnonymous.hello>(realm=myrealm1, details.realm=myrealm1, details.authid=None, details.authrole=None) [config={'type': 'static', 'authrole': 'anonymous', 'authid': 'XJAJ-6K3M-YPQP-5TCY-AY39-CARS'}]
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] <crossbar.worker.proxy.ProxyFrontendSession._accept> Frontend session accepted (Accept(realm=<myrealm1>, authid=<XJAJ-6K3M-YPQP-5TCY-AY39-CARS>, authrole=<anonymous>, authmethod=anonymous, authprovider=static, authextra=None)) - opening proxy backend session ...
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] Starting factory <autobahn.twisted.rawsocket.WampRawSocketClientFactory object at 0x0000000003bf1280>
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] 
node1     | Traceback (most recent call last):
node1     | --- <exception caught here> ---
node1     |   File "/usr/local/site-packages/crossbar/worker/proxy.py", line 514, in _process_Hello
node1     |     session = yield self._accept(hello_result)
node1     |   File "/usr/local/site-packages/crossbar/worker/proxy.py", line 1296, in map_backend
node1     |     backend_proto = yield make_backend_connection(backend_config, frontend, self._cbdir)
node1     | twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.
node1     | 
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] Stopping factory <autobahn.twisted.rawsocket.WampRawSocketClientFactory object at 0x0000000003bf1280>
node1     | 2020-07-31T17:21:16+0000 [Proxy          18] <crossbar.worker.proxy.ProxyFrontendSession.onClose>(wasClean=True)
oberstet commented 4 years ago

from a frontend client perspective, the client fails during WAMP authentication opening handshake with correct error:

(cpy382_1) oberstet@intel-nuci7:~/scm/crossbario/crossbar-examples/crossbarfx/webcluster$ python client-test1.py websocket-cbor
2020-07-31T19:21:16+0200 Starting factory <autobahn.twisted.websocket.WampWebSocketClientFactory object at 0x7f6d18ff13a0>
2020-07-31T19:21:16+0200 session leaving 'wamp.error.authentication_failed'
2020-07-31T19:21:16+0200 wamp.error.authentication_failed: Frontend connection accept failed (Connection was refused by other side: 111: Connection refused.)
2020-07-31T19:21:16+0200 Stopping factory <autobahn.twisted.websocket.WampWebSocketClientFactory object at 0x7f6d18ff13a0>

however, the error message is misleading .. it is the accepting proxy worker failing to establish a backend connection ..