JarbasHiveMind / HiveMind-cli

OpenVoiceOS Remote CLI
Apache License 2.0
7 stars 7 forks source link

Unclean disconn after auth failure, client does not receive feedback #3

Closed builderjer closed 3 years ago

builderjer commented 3 years ago

I posted this on the chat channel also, but this is my full log.

So I got this to work!!! Kind of.

The server starts well:

2021-03-05 09:09:48.148 - OVOS - jarbas_hive_mind.master:start_announcing:176 - INFO - Registering zeroconf:HiveMind-websocket wss://192.168.0.252:5678
2021-03-05 09:09:48.177 - OVOS - jarbas_hive_mind.discovery.ssdp:register:108 - INFO - Registering upnp:HiveMind-websocket (http://192.168.0.252:8088/device.xml)
2021-03-05 09:09:48.184 - OVOS - jarbas_hive_mind:secure_listen:201 - INFO - HiveMind Listening: wss://0.0.0.0:5678

Connect the client and send a message:

2021-03-05 09:10:44.896 - OVOS - jarbas_hive_mind:secure_connect:68 - INFO - Connecting securely to wss://192.168.0.252:5678
2021-03-05 09:10:44.958 - OVOS - jarbas_hive_mind.slave.terminal:onConnect:20 - INFO - HiveMind connected: tcp4:192.168.0.252:5678
2021-03-05 09:10:44.960 - OVOS - jarbas_hive_mind.slave.terminal:onOpen:25 - INFO - HiveMind websocket connection open. 
Input:what time is it

It sends it to the bus correctly, but then shuts down wit an error:

Traceback (most recent call last):
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/log.py", line 101, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/log.py", line 85, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py", line 83, in callWithContext
    return func(*args, **kw)
--- <exception caught here> ---
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/posixbase.py", line 687, in _doReadOrWrite
    why = selectable.doRead()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py", line 246, in doRead
    return self._dataReceived(data)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py", line 251, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py", line 324, in dataReceived
    self._flushReceiveBIO()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py", line 290, in _flushReceiveBIO
    ProtocolWrapper.dataReceived(self, bytes)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/policies.py", line 107, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 290, in dataReceived
    self._dataReceived(data)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1207, in _dataReceived
    self.consumeData()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1219, in consumeData
    while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1579, in processData
    fr = self.onFrameEnd()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1704, in onFrameEnd
    self._onMessageEnd()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 318, in _onMessageEnd
    self.onMessageEnd()
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 628, in onMessageEnd
    self._onMessage(payload, self.message_is_binary)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 321, in _onMessage
    self.onMessage(payload, isBinary)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py", line 33, in onMessage
    self.factory.handle_incoming_message(data)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py", line 154, in handle_incoming_message
    self.on_message(payload)
  File "/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py", line 180, in on_message
    msg_type = msg["msg_type"]
builtins.KeyError: 'msg_type'

2021-03-05 09:10:50.649 - OVOS - jarbas_hive_mind.slave.terminal:onClose:36 - WARNING - HiveMind websocket connection closed: connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2021-03-05 09:10:50.650 - OVOS - jarbas_hive_mind.slave.terminal:clientConnectionLost:213 - ERROR - HiveMind connection lost: [Failure instance: Traceback: <class 'KeyError'>: 'msg_type'
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/log.py:85:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py:118:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py:83:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/posixbase.py:700:_doReadOrWrite
--- <exception caught here> ---
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/posixbase.py:687:_doReadOrWrite
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py:246:doRead
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py:251:_dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py:324:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py:290:_flushReceiveBIO
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/policies.py:107:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:290:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1207:_dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1219:consumeData
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1579:processData
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1704:onFrameEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:318:_onMessageEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:628:onMessageEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:321:_onMessage
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:33:onMessage
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:154:handle_incoming_message
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:180:on_message
] .. retrying ..
2021-03-05 09:10:50.651 - OVOS - jarbas_hive_mind.slave.terminal:clientConnectionLost:220 - ERROR - HiveMind connection lost: [Failure instance: Traceback: <class 'KeyError'>: 'msg_type'
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/log.py:85:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py:118:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/python/context.py:83:callWithContext
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/posixbase.py:700:_doReadOrWrite
--- <exception caught here> ---
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/posixbase.py:687:_doReadOrWrite
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py:246:doRead
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/tcp.py:251:_dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py:324:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/tls.py:290:_flushReceiveBIO
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/twisted/protocols/policies.py:107:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:290:dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1207:_dataReceived
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1219:consumeData
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1579:processData
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:1704:onFrameEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:318:_onMessageEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/websocket/protocol.py:628:onMessageEnd
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/autobahn/twisted/websocket.py:321:_onMessage
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:33:onMessage
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:154:handle_incoming_message
/home/jbrodie/Software/Mycroft/builderjer/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/slave/terminal.py:180:on_message
]

and on the server:

2021-03-05 09:10:17.101 - OVOS - jarbas_hive_mind.master:handle_incoming_mycroft:389 - INFO - Forwarding message to mycroft bus from client: tcp4:192.168.0.191:40358
2021-03-05 09:10:17.187 - OVOS - jarbas_hive_mind.master:unregister_client:273 - INFO - deregistering client: tcp4:192.168.0.191:40358
2021-03-05 09:10:17.192 - OVOS - jarbas_hive_mind.master:connectionLost:116 - INFO - WebSocket connection lost: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion: Connection lost.
]
Unhandled Error
Traceback (most recent call last):
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/__init__.py", line 222, in listen
    return self.secure_listen(factory=factory, protocol=protocol)
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/jarbas_hive_mind/__init__.py", line 203, in secure_listen
    reactor.run()
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/base.py", line 1423, in run
    self.mainLoop()
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/base.py", line 1433, in mainLoop
    reactorBaseSelf.runUntilCurrent()
--- <exception caught here> ---
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/twisted/internet/base.py", line 999, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/txaio/_common.py", line 136, in _notify_bucket
    notify_one_chunk(calls, self._chunk_size, max(0.0, delay_ms))
  File "/home/jbrodie/Mycroft/mycroft-core/.venv/lib/python3.7/site-packages/txaio/_common.py", line 130, in notify_one_chunk
    raise RuntimeError(msg)
builtins.RuntimeError: Error(s) processing call_later bucket:
'NoneType' object has no attribute 'shutdown'

Thanks for any help

builderjer commented 3 years ago

Solved this by adding the --crypto_key option.