fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
10.03k stars 1.13k forks source link

Stuck in "Setting up a new session" #701

Open ignaciorlando opened 4 years ago

ignaciorlando commented 4 years ago

I've been using Visdom for a while and it was working fine until today. Now, when I try to initialize the visdom object for visualization with viz = Visdom(server=hostname, port=port) the code stucks there with the legend Setting up a new session. It's been there for hours and nothing seems to happen.

I tried a few times and if I cancel the process, I can see that the following stack trace:

File "/home/iorlando/Research/fundus-image-quality/fundus-image-quality/learning/visualization.py", line 48, in __init__
    self.viz = Visdom(server=hostname, port=port) 
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/visdom/__init__.py", line 473, in __init__
    }, endpoint='env/' + env)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/visdom/__init__.py", line 711, in _send
    data=json.dumps(msg),
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/visdom/__init__.py", line 677, in _handle_post
    r = self.session.post(url, data=data)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/connection.py", line 394, in connect
    ssl_context=context,
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/home/iorlando/.conda/envs/fundus-image-quality/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1933, in do_handshake
    result = _lib.SSL_do_handshake(self._ssl)

So it seems that this line: result = _lib.SSL_do_handshake(self._ssl) is the one creating the problem. Do you know why this might be happening?

JackUrb commented 4 years ago

Not entirely sure, this seems to be something underlying visdom. Perhaps try updating python/requests/OpenSSL?

ignaciorlando commented 4 years ago

I tried updating OpenSSL and reinstalling visdom but the problem persists. I have absolutely no idea what might be going on. but it was working quite OK a few days ago, and now is stucked on this handshake :/

ignaciorlando commented 4 years ago

After a few hours I got the following error:

Traceback (most recent call last):                                                                                                                                                       
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket                                              
    cnx.do_handshake()                                                                                                                                                                   
  File "<path to my environment>/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake                                                          
    self._raise_ssl_error(self._ssl, result)                                                                                                                                             
  File "<path to my environment>/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1664, in _raise_ssl_error                                                      
    raise SysCallError(-1, "Unexpected EOF")                                                                                                                                             
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')                                                                                                                                         

During handling of the above exception, another exception occurred:                                                                                                                      

Traceback (most recent call last):                                                                                                                                                       
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen                                                     
    chunked=chunked,                                                                                                                                                                     
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request                                               
    self._validate_conn(conn)                                                                                                                                                            
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/connection.py", line 394, in connect
    ssl_context=context,
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "<path to my environment>/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
JackUrb commented 4 years ago

Is your server remote? Perhaps the security configuration has changed and now you may need to use proxies? I really don't have any guidance for this beyond searching the errors you're getting.

huangzhao1 commented 4 years ago

I also met this issue,have you solve it ??

huangzhao1 commented 4 years ago

I solved it by set same value(8097) on port of chrom and server.

nileshkulkarni commented 2 years ago

I think it might be related to HTTP vs HTTPS. Please check that. Worked for me with HTTP but not with HTTPS.

tianyu06030020 commented 2 years ago

maybe the visdom port is being used by other process, find the process and kill it or change another free port