Repository: DamnWidget/anaconda

Issue #820: Cannot connect to localhost
Created: 2019-06-10T23:32:22Z
I've used anaconda for months no problem, today I restarted sublime, and it just stopped working with the below error message.
ST3, Anaconda and OS versions
ST3 3.2.1 on macOS 10.14.5
ST3 Console Logs
can not connect to localhost in port 50857. tried to connect 21 times during 2.0 seconds

check that there is Python process executing the anaconda jsonserver.py script running in your system. If there is, check that you can connect to your localhost writing the following script in your Sublime Text 3 console:

import socket; socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(("localhost", 50857))

If anaconda works just fine after you received this error and the command above worked you can make anaconda to do not show you this error anymore setting the 'swallow_startup_errors' to 'true' in your configuration file.
 ...last message repeated one more time in the last 10s
anacondaST3: ERROR - <Anaconda.anaconda_lib.workers.local_worker.LocalWorker object at 0x106445250> initial check failed because:

Anaconda's JsonServer Logs
2019-06-10 19:25:30,427: ERROR   : Traceback (most recent call last):
  File "/Users/carson/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 338, in <module>
    server = JSONServer(('localhost', port))
  File "/Users/carson/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 157, in __init__
    if address_family == socket.AF_UNIX:
NameError: name 'address_family' is not defined

2019-06-10 19:25:30,427: ERROR   : name 'address_family' is not defined
2019-06-10 19:25:37,367: ERROR   : Traceback (most recent call last):
  File "/Users/carson/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 338, in <module>
    server = JSONServer(('localhost', port))
  File "/Users/carson/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 157, in __init__
    if address_family == socket.AF_UNIX:
NameError: name 'address_family' is not defined

2019-06-10 19:25:37,367: ERROR   : name 'address_family' is not defined

Duplicate issue #793: Sublime Text 3: [Errno 48] Address already in use
Created: 2018-10-15T15:36:07Z
The problem
I get an error message box when starting Sublime on macOS.  Autocomplete doesn't seem to work all the way, but things are okay I guess.  Am looking for improvement or some resolution.  Thanks.
It doesn't happen all the time, and no other python instances are running in ps -e|grep python.
ST3 Console Logs
$ subl user.py
MyPy is enabled but we could not import it
DEBUG:root:bind: address=('localhost', 55888)
DEBUG:root:listen: backlog=5
INFO:root:Anaconda Server started in 55888 for PID 94155 with cache dir /Users/sjaroch/Library/Caches/Jedi/anaconda-2
INFO:root:Incomming connection from ('127.0.0.1', 55910)
INFO:root:Incomming connection from ('127.0.0.1', 55911)
INFO:root:client requests: lint
{'vid': 14, 'errors': [{'level': 'E', 'raw_error': '[E] invalid syntax', 'lineno': 30, 'offset': 36, 'message': '[e] %s', 'underline_range': True}], 'uid': u'd86ce12c65614b6298e0e30931a028b8', 'success': True}
INFO:root:client requests: lint
{'vid': 14, 'errors': [{'level': 'E', 'raw_error': '[E] invalid syntax', 'lineno': 30, 'offset': 36, 'message': '[e] %s', 'underline_range': True}], 'uid': u'fddff863d0fe49b2b611e53c9f09cba2', 'success': True}
MyPy is enabled but we could not import it
ERROR:root:Traceback (most recent call last):
  File "/Users/sjaroch/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 335, in <module>
    server = JSONServer(('localhost', port))
  File "/Users/sjaroch/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 156, in __init__
    self.bind(self.address)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 342, in bind
    return self.socket.bind(addr)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 48] Address already in use

ERROR:root:[Errno 48] Address already in use
Traceback (most recent call last):
  File "/Users/sjaroch/Library/Application Support/Sublime Text 3/Packages/Anaconda/anaconda_server/jsonserver.py", line 357, in <module>
    server.shutdown()
NameError: name 'server' is not defined
2018-10-15 11:26:36.462 Sublime Text[94153:1319877] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9800)

Anaconda's JsonServer Logs
See attached logs, I have not gone through them yet
anaconda.zip

Closing comment (2019-06-11T16:06:00Z): Working on it. Related to #820

Man, thank you, you are my hero!