Skip to content

Connection to the other side was lost in a non-clean fashion: Connection los #26

@idekel

Description

@idekel

Hi,
I am getting the error below when I try to open a connection using the example found at the readme file of this repo.

Python 3.11.5
Mac OS

`Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/twisted/python/log.py", line 96, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/log.py", line 80, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 117, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 82, in callWithContext
return func(*args, **kw)
--- ---
File "/usr/local/lib/python3.11/site-packages/twisted/internet/selectreactor.py", line 148, in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/local/lib/python3.11/site-packages/twisted/internet/tcp.py", line 615, in doConnect
self._connectDone()
File "/usr/local/lib/python3.11/site-packages/twisted/internet/tcp.py", line 643, in _connectDone
self.protocol.makeConnection(self)
File "/usr/local/lib/python3.11/site-packages/twisted/protocols/tls.py", line 226, in makeConnection
ProtocolWrapper.makeConnection(self, transport)
File "/usr/local/lib/python3.11/site-packages/twisted/protocols/policies.py", line 75, in makeConnection
self.wrappedProtocol.makeConnection(self)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/protocol.py", line 509, in makeConnection
self.connectionMade()
File "/usr/local/lib/python3.11/site-packages/twisted/internet/endpoints.py", line 144, in connectionMade
self._wrappedProtocol.makeConnection(self.transport)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/protocol.py", line 509, in makeConnection
self.connectionMade()
File "/Users/idekel/test_projects/OpenApiPy/ctrader_open_api/tcpProtocol.py", line 21, in connectionMade
self.factory.connected(self)
File "/Users/idekel/test_projects/OpenApiPy/ctrader_open_api/factory.py", line 11, in connected
self.client._connected(protocol)
File "/Users/idekel/test_projects/OpenApiPy/ctrader_open_api/client.py", line 32, in _connected
self._connectedCallback(self)
File "/Users/idekel/test_projects/OpenApiPy/main.py", line 26, in connected
deferred.addErrback(onError)
builtins.NameError: name 'deferred' is not defined

Disconnected: [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 "/Users/idekel/test_projects/OpenApiPy/main.py", line 41, in
reactor.run()
File "/usr/local/lib/python3.11/site-packages/twisted/internet/base.py", line 695, in run
self.mainLoop()
File "/usr/local/lib/python3.11/site-packages/twisted/internet/base.py", line 708, in mainLoop
self.doIteration(t)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/selectreactor.py", line 142, in doSelect
_logrun(selectable, _drdw, selectable, method)
--- ---
File "/usr/local/lib/python3.11/site-packages/twisted/python/log.py", line 96, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/log.py", line 80, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 117, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/python/context.py", line 82, in callWithContext
return func(*args, **kw)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/selectreactor.py", line 153, in _doReadOrWrite
self._disconnectSelectable(selectable, why, method == "doRead")
File "/usr/local/lib/python3.11/site-packages/twisted/internet/posixbase.py", line 113, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/usr/local/lib/python3.11/site-packages/twisted/internet/tcp.py", line 508, in connectionLost
self._commonConnection.connectionLost(self, reason)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/tcp.py", line 326, in connectionLost
protocol.connectionLost(reason)
File "/usr/local/lib/python3.11/site-packages/twisted/protocols/tls.py", line 409, in connectionLost
ProtocolWrapper.connectionLost(self, reason)
File "/usr/local/lib/python3.11/site-packages/twisted/protocols/policies.py", line 114, in connectionLost
self.wrappedProtocol.connectionLost(reason)
File "/usr/local/lib/python3.11/site-packages/twisted/internet/endpoints.py", line 163, in connectionLost
return self._wrappedProtocol.connectionLost(reason)
File "/usr/local/lib/python3.11/site-packages/twisted/application/internet.py", line 465, in connectionLost
self._lostNotification(reason)
File "/usr/local/lib/python3.11/site-packages/twisted/application/internet.py", line 658, in
self._factory, lambda _: self._clientDisconnected()
File "/usr/local/lib/python3.11/site-packages/automat/_methodical.py", line 235, in _clientDisconnected
(outputs, outTracer) = transitioner.transition(self)
File "/usr/local/lib/python3.11/site-packages/automat/_core.py", line 157, in transition
outState, outputSymbols = self._automaton.outputForInput(self._state,
File "/usr/local/lib/python3.11/site-packages/automat/_core.py", line 137, in outputForInput
raise NoTransition(state=inState, symbol=inputSymbol)
automat._core.NoTransition: no transition for MethodicalInput(method=<function _ClientMachine._clientDisconnected at 0x10efe6ca0>) in MethodicalState(method=<function _ClientMachine._connecting at 0x10efe5ee0>)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions