It looks like you're new here. If you want to get involved, click one of these buttons!
kws.on_ticks = on_ticks
kws.on_close = on_close
kws.on_error = on_error
kws.on_connect = on_connect
kws.on_reconnect = on_reconnect
kws.on_noreconnect = on_noreconnect
kws.on_order_update = on_order_update
kws.connect(threaded=True)
ticker running in threaded modelkite.exit_order(data['product'], order_id=data['order_id'], parent_order_id=data['parent_order_id'])
rval = self.protocol.dataReceived(data)
File "/usr/lib/python3/dist-packages/twisted/protocols/tls.py", line 330, in dataReceived
self._flushReceiveBIO()
File "/usr/lib/python3/dist-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
ProtocolWrapper.dataReceived(self, bytes)
File "/usr/lib/python3/dist-packages/twisted/protocols/policies.py", line 120, in dataReceived
self.wrappedProtocol.dataReceived(data)
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 291, in dataReceived
self._dataReceived(data)
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1213, in _dataReceived
self.consumeData()
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1225, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1591, in processData
fr = self.onFrameEnd()
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 1713, in onFrameEnd
self._onMessageEnd()
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 319, in _onMessageEnd
self.onMessageEnd()
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/websocket/protocol.py", line 634, in onMessageEnd
self._onMessage(payload, self.message_is_binary)
File "/home/mr/.local/lib/python3.7/site-packages/autobahn/twisted/websocket.py", line 322, in _onMessage
self.onMessage(payload, isBinary)
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/ticker.py", line 71, in onMessage
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/ticker.py", line 677, in _on_message
File "pyroteleupstox.py", line 407, in on_ticks
kite.exit_order(data['product'], order_id=data['order_id'], parent_order_id=data['parent_order_id'])
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 358, in exit_order
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 353, in cancel_order
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 709, in _delete
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 766, in _request
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "pyroteleupstox.py", line 373, in threadFun
kt.exit_order(data['product'], order_id=data['order_id'], parent_order_id=data['parent_order_id'])
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 358, in exit_order
self.cancel_order(variety, order_id, parent_order_id=parent_order_id)
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 353, in cancel_order
"parent_order_id": parent_order_id
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 709, in _delete
return self._request(route, "DELETE", params)
File "/home/mr/.local/lib/python3.7/site-packages/kiteconnect-3.7.7-py3.7.egg/kiteconnect/connect.py", line 766, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
it's also returning same kiteconnect.exceptions.InputException: Invalid `api_key` or `access_token`.
You may also run it in debug mode to print all the request and response logs.
yes, api_key and access token are correct.
is it something to do with the thread?
it should have been data['variety'] instead of data['product']
I didn't pay much attention since both shows
cover order.
but the problem is
data['variety'] = "co", whereas
data['product'] = "CO" (in caps)
I didn't thought, it would be case sensitive. and the error message didn't convey anything
problem is solved, with "co"
this thread can be closed now.