sensein / etelemetry-client

Etelemetry client
Other
3 stars 9 forks source link

server offline? seems to cause delay upon invocation #35

Closed yarikoptic closed 1 year ago

yarikoptic commented 3 years ago

spotted heudiconv reporting

WARNING: Could not check for version updates: Connection to server could not be made

and checked in dandi-cli (etelemetry 0.2.2)

2021-08-10 11:24:36,513 [   DEBUG] Could not check dandi/dandi-cli for version updates: Connection to server could not be made

expected (e.g. server is under maintenance ATM)?

but also it results in a delay on every invocation since I guess it is not giving up for a few seconds. I wonder if such status ("can't reach server") should be cached locally and not reattempted for some time. Could be critical for use of etelemetry in tools which have many invocations etc

yarikoptic commented 3 years ago

just a note that server seems to be still (or again) offline ATM, heudiconv reports the same "WARNING: Could not check for version updates: Connection to server could not be made"

panlinux commented 2 years ago

Indeed:

$ python3                                                                                                                                                               
Python 3.10.6 (main, Aug 10 2022, 11:19:32) [GCC 12.1.0] on linux                                                                                                             
Type "help", "copyright", "credits" or "license" for more information.                                                                                                        
>>> import etelemetry                                                                                                                                                         
>>> etelemetry.get_project("nipy/nipype")                                                                                                                                     
Traceback (most recent call last):                                                                                                                                            
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 174, in _new_conn                                                                                         
    conn = connection.create_connection(                                                                                                                                      
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 96, in create_connection                                                                             
    raise err                                                                                                                                                                 
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 86, in create_connection                                                                             
    sock.connect(sa)                                                                                                                                                          
TimeoutError: timed out                                                                                                                                                       

During handling of the above exception, another exception occurred:                                                                                                           

Traceback (most recent call last):                                                                                                                                            
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 704, in urlopen                                                                                       
    httplib_response = self._make_request(                                                                                                                                    
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 387, in _make_request                                                                                 
    self._validate_conn(conn)                                                                                                                                                 
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1043, in _validate_conn                                                                               
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 179, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7fcabae630a0>, 'Connection to rig.mit.edu timed out. (connect timeout=5)')
(...)
nileshpatra commented 1 year ago

@satra can you do something about it? Server being offline essentially makes etelemetry-client un-usable.

satra commented 1 year ago

the client should have a timeout period when the server goes offline. so it will work but won't be useful.

i've restarted the server, so it should be working now.