-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anaconda mode lost rpc connection after some time #376
Comments
I'm getting very similar errors recently |
Can you see if reverting to commit 3ede03d fixes the issue? cc @falloutphil |
Hi, I'm the author of 1bc301b which was recently reintroduced. I've just tested doing method look-ups on TRAMP over an approx 25 min period on a version containing 1bc301b, but without other recent changes. Things seemed fine, but my use-case and setup could be different to others. So I'll add a bit more explanation. My commit does 3 things - all of which are to do with the underlying creation of an ssh tunnel as a separate process for RPC calls to travel through:
If you're not using TRAMP then it's hard to see how my commit would have any effect. If you are using TRAMP, I have a theory!
This scenario would match the reported symptoms, so although I'm making a pretty wild guess, it sounds plausible to me. So if my theory is correct - all you need to do is add a keep alive to your ~/.ssh/config file - Google will help here, but something like the below should work:
Note I don't want to make the keep alive part of anaconda-mode itself as this is too intrusive. The end user should configure this as required. Also note as I've mentioned previously you also need to make sure that each remote host and proxy jump used must have been previously added to the If this doesn't help, then please can you reply with more details of exactly how to recreate the problem - some helpful questions:
Sorry for the long message - hopefully it helps! |
This line does not seem related to tramp. Why was it changed? |
After creating the local tunnel you want the RPC requests to go down the tunnel, not direct to the host. The original code was completely disregarding the tunnel it had created, which I believe was a bug - it was working sometimes by fluke (when the randomly generated RPC port happened to be open on both servers), but was sending data as cleartext, which is a bad idea. This change ensures RPC requests go down the tunnel (on port 22) and pops-out on the server where the TRAMP file is hosted. This avoids issues with firewalls blocking direct RPC requests as well being secure. |
Closed with #379 |
Hi.
I'm constantly getting the same error: after some time (tens of minutes),
anaconda mode could not get the response. If I kill the buffer anaconda-mode,
and after that all works fine.
Below is status of buffers after failure:
anaconda-mode
anaconda_mode port 36909
127.0.0.1 - - [05/Dec/2019 15:01:08] ================================================================================
Traceback (most recent call last):
File "/home/oleg/.config/emacs/anaconda-mode/0.1.13/service_factory-0.1.5-py3.7.egg/service_factory/service.py", line 101, in apply
result = method(**params)
File "", line 98, in wrapper
result = f(jedi.Script(source, line, column, path, environment=virtual_environment))
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/jedi/api/init.py", line 118, in init
cache_path=settings.cache_directory,
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/jedi/evaluate/init.py", line 388, in parse_and_get_code
return self.grammar.parse(code=code, path=path, **kwargs), code
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/grammar.py", line 76, in parse
return self._parse(code=code, **kwargs)
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/grammar.py", line 126, in _parse
new_lines=lines
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/python/diff.py", line 152, in update
self._copy_from_old_parser(line_offset, i2, j2)
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/python/diff.py", line 211, in copy_from_old_parser
from = copied_nodes[0].get_start_pos_of_prefix()[0] + line_offset
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/tree.py", line 264, in get_start_pos_of_prefix
return self.children[0].get_start_pos_of_prefix()
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/python/tree.py", line 125, in get_start_pos_of_prefix
previous_leaf = self.get_previous_leaf()
File "/home/oleg/.conda/envs/pytorch/lib/python3.7/site-packages/parso/tree.py", line 74, in get_previous_leaf
i = c.index(node)
ValueError: <Function: create_dirs@1168-1179> is not in list
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/oleg/.config/emacs/anaconda-mode/0.1.13/service_factory-0.1.5-py3.7.egg/service_factory/providers/basehttp.py", line 40, in do_POST
status, response = self.server.service(data)
File "/home/oleg/.config/emacs/anaconda-mode/0.1.13/service_factory-0.1.5-py3.7.egg/service_factory/service.py", line 50, in call
result = self.apply(method, args)
File "/home/oleg/.config/emacs/anaconda-mode/0.1.13/service_factory-0.1.5-py3.7.egg/service_factory/service.py", line 105, in apply
server_error(args['id'], error)
File "/home/oleg/.config/emacs/anaconda-mode/0.1.13/service_factory-0.1.5-py3.7.egg/service_factory/errors.py", line 91, in server_error
raise ServiceException(500, dumps(response))
service_factory.exceptions.ServiceException: (500, '{"jsonrpc": "2.0", "id": 1, "error": {"code": -32000, "message": "Server error", "data": "ValueError('<Function: create_dirs@1168-1179> is not in list')"}}')
The text was updated successfully, but these errors were encountered: