Pectojin / duplicati-client

A command line client for controlling the Duplicati Server
GNU Lesser General Public License v2.1
75 stars 20 forks source link

Doesn't handle a non-responsive server #1

Closed swilkey closed 6 years ago

swilkey commented 6 years ago

@Pectojin I'm guessing you've always had a working duplicati server when you run this. Below is the error you get if duplicati isn't running. I figured it might be helpful to document it for you.

Connecting to http://loopback:8200... Traceback (most recent call last): File "site-packages\urllib3\connection.py", line 141, in _new_conn File "site-packages\urllib3\util\connection.py", line 83, in create_connection File "site-packages\urllib3\util\connection.py", line 73, in create_connection ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "site-packages\urllib3\connectionpool.py", line 601, in urlopen File "site-packages\urllib3\connectionpool.py", line 357, in _make_request File "http\client.py", line 1239, in request File "http\client.py", line 1285, in _send_request File "http\client.py", line 1234, in endheaders File "http\client.py", line 1026, in _send_output File "http\client.py", line 964, in send File "site-packages\urllib3\connection.py", line 166, in connect File "site-packages\urllib3\connection.py", line 150, in _new_conn urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x059A1D30>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "site-packages\requests\adapters.py", line 440, in send File "site-packages\urllib3\connectionpool.py", line 639, in urlopen File "site-packages\urllib3\util\retry.py", line 388, in increment urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='loopback', port=8200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x059A1D30>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "duplicati_client.py", line 1453, in File "duplicati_client.py", line 89, in main File "duplicati_client.py", line 744, in login File "site-packages\requests\api.py", line 72, in get File "site-packages\requests\api.py", line 58, in request File "site-packages\requests\sessions.py", line 508, in request File "site-packages\requests\sessions.py", line 618, in send File "site-packages\requests\adapters.py", line 508, in send requests.exceptions.ConnectionError: HTTPConnectionPool(host='loopback', port=8200): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x059A1D30>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',)) [8380] Failed to execute script duplicati_client

Pectojin commented 6 years ago

Ah, yes. It's super poor at handling unexpected responses at the moment.

It doesn't break anything as the client was going to exit after this anyway, but it's not pretty and it's not user friendly.

I'll need to go through it all and add error handling at some point.

Pectojin commented 6 years ago

I fixed this in the 0.1.26 release along with some other cool stuff