Hi, I have some weird error.
All functions needing RPC calls stop working after being used once or twice. Before that M-. C-c C-d etc. work well but then I just get "Timeout during RPC call" errors. Calling elpy-rpc-restart fixes the problem for the next one or two calls.
E.g. the error I get when trying to go to definition: elpy-rpc--call-blocking: Timeout during RPC call get_definition from backend
Virtualenv........: None
RPC Python........: 2.7.3 (/usr/bin/python)
Interactive Python: ipython (/usr/local/bin/ipython)
Emacs.............: 24.4.1
Elpy..............: 1.12.0
Jedi..............: 0.9.0
Rope..............: 0.10.3
Importmagic.......: 0.1.7
Autopep8..........: 1.2.4
Yapf..............: 0.10.0
Syntax checker....: flake8 (/usr/local/bin/flake8)
Disabling the timeout via (setq elpy-rpc-timeout nil) just leads to emacs hanging indefinitely
Output of strace before I give the command getting the timeout:
Process 6452 attached - interrupt to quit
read(0,
After issuing a M-.
Process 6452 attached - interrupt to quit
read(0, "{\"id\":7,\"method\":\"get_definition"..., 4096) = 187
futex(0x29de670, FUTEX_WAIT_PRIVATE, 0, NULL
The rpc-process-buffer is empty
Any idea what this could be?
I tried around a little bit more and when I am using a virtualenv the problem goes away.
Hello, and thanks for the report and excellent debugging there!
What's the output of elpy-config within the virtualenv?
Could you add the -f -s 4096 options to the strace output and see if that gives more information?
Output of elpy-config in the virtualenv that works:
Virtualenv........: (/home/c7031105/.emacs.d/python/python2/)
RPC Python........: 2.7.3 (/home/c7031105/.emacs.d/python/python2/bin/python)
Interactive Python: ipython (/usr/local/bin/ipython)
Emacs.............: 24.4.1
Elpy..............: 1.12.0
Jedi..............: 0.9.0
Rope..............: 0.10.3
Importmagic.......: 0.1.7
Autopep8..........: 1.2.4
Yapf..............: 0.10.0
Syntax checker....: flake8 (/usr/local/bin/flake8)
strace -f -s 4096 -p 5805 before failing:
Process 5805 attached with 5 threads - interrupt to quit
[pid 5819] restart_syscall(<... resuming interrupted call ...>[pid 5818] restart_syscall(<... resuming interrupted call ...> [pid 5809] restart_syscall(<... resuming interrupted call ...> [pid 5808] futex(0x7fe366df8764, FUTEX_WAIT_PRIVATE, 1, NULL [pid 5805] read(0,
strace after failing
Process 5805 attached with 5 threads - interrupt to quit
[pid 5819] restart_syscall(<... resuming interrupted call ...>[pid 5818] restart_syscall(<... resuming interrupted call ...> [pid 5809] restart_syscall(<... resuming interrupted call ...> [pid 5808] futex(0x7fe366df8764, FUTEX_WAIT_PRIVATE, 1, NULL [pid 5805] read(0, "{\"id\":7,\"method\":\"get_calltip\",\"params\":[\"\/home\/c7031105\/Dropbox\/16_16_ss\/disney_motion\/dataset_extract.py\",{\"filename\":\"\/tmp\/elpy-rpc-5648UfJ\",\"delete_after_use\":true},4582]}\n", 4096) = 184
[pid 5805] futex(0x224b6d0, FUTEX_WAIT_PRIVATE, 0, NULL
If I am fast after the first M-. I can get quite a bit of stuff using strace (about 40MB). The log of this can be found here: https://dl.dropboxusercontent.com/u/97142252/elpy_strace.log.xz
Hrm. Elpy reads the get_calltip call succesfully, but then hangs. I have no idea why it would do so. It should do other stuff after that, really. The difference in behavior is also very weird – the library versions are exactly the same. The only thing I can think of is that in one case, some file system is hanging (I see Dropbox there), but nothing really hints to that.
Sorry, I'm quite at a loss here :-(
Since it works in a virtualenv and it doesn't seem to affect a lot of people I guess it's not really a big deal. If I ever find out what might be causing it I will report back :)
Thanks for looking into it anyway :+1:
Thank you very much – I'll close this issue then, but please do not hesitate to re-open it or open a new one if you find out more or have further problems. And enjoy Elpy!
I've encountered a similar problem. The error message I get is
Timeout during RPC call get_docstring from backend
My elpy-config is as follows:
Virtualenv........: mysql_accounting (/home/shawn/.virtualenvs/mysql_accounting)
RPC Python........: 3.5.2 (/home/shawn/.virtualenvs/mysql_accounting/bin/python)
Interactive Python: python3 (/home/shawn/.virtualenvs/mysql_accounting/bin/python3)
Emacs.............: 24.5.1
Elpy..............: 1.21.0
Jedi..............: 0.12.0
Rope..............: 0.10.7
Autopep8..........: 1.3.5
Yapf..............: 0.22.0
Syntax checker....: flake8 (/usr/local/bin/flake8)
I've linked to a strace -f -s 4096 -p 10958 -o ~/Desktop/trac.txt which is me trying to call C-c C-d to get_docstring for a pandas DataFrame's method .to_pickle, as well as my virtualenv and my init.el.
Thank you in advance for looking at this, I've been having trouble trying to fix this on my own and this is the only thread that comes up after googling around...
I also experience this with get_definition, and other calls, in a virtualenv and not with dropbox or any other suspicious filesystem stuff.
It's definitely getting responses—I hacked handle_request and write_json in rpc.py to record output into a temp file:
>> {u'params': [{u'project_root': u'/home/benwolfson/src/<etc>'}], u'id': 1, u'method': u'init'}
<< {"result": {"jedi_available": true}, "id": 1}
>> {u'params': [u'/home/benwolfson/src/<etc>, {u'delete_after_use': True, u'filename': u'/tmp/elpy-rpc-1379TDM'}, 776], u'id': 2, u'method': u'get_definition'}
<< {"result": ["/home/benwolfson/src/<etc>", 221], "id": 2}
so it's a little odd that it reports timeouts in the rpc call…
I'm seeing this when I try to use C-c C-e. It was working initially, then stopped working with this error.
Does it still errors with a higher timeout ?
(setq elpy-rpc-timeout 10) for example.
I'll try it with (setq elpy-rpc-timeout 10), and let you know.
It does not happen immediately. It starts happening after a few minutes.
Note that I'm directly using the Debian package from unstable on stable. (There isn't a elpy Debian package for stable.) I haven't tried rebuilding it for stable. There are other problems with C-c C-e. When it works, it seems to randomly select a subset of the applicable strings.
Does it still errors with a higher timeout ?
(setq elpy-rpc-timeout 10)for example.
This has worked for me. If the code file is too big, the timeout gets triggered. Increasing the timeout value works.
I found that with large files, I had to bump this up to 2 (the default seems to be 1) on an older MacBook Pro Retina to completely avoid it.
Most helpful comment
Does it still errors with a higher timeout ?
(setq elpy-rpc-timeout 10)for example.