danth / pathfinder.vim

Vim plugin to suggest better movements
MIT License
290 stars 4 forks source link

Problem launching server on Neovim #28

Closed edleeman17 closed 4 years ago

edleeman17 commented 4 years ago
Error detected while processing function PathfinderLoop[6]..provider#python3#Call:                                                                                                                          
line   18:                                                                                                                                                                                                  
Error invoking 'python_execute' on channel 4 (python3-script-host):                                                                                                                                         
Traceback (most recent call last):                                                                                                                                                                          
  File "<string>", line 1, in <module>                                                                                                                                                                      
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/commands.py", line 72, in autorun                                                                                                                   
    run()                                                                                                                                                                                                   
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/commands.py", line 49, in run                                                                                                                       
    client.pathfind(start_state.view, current_state.view, show_output)                                                                                                                                      
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/client.py", line 125, in pathfind                                                                                                                   
    self.server_connection.send(                                                                                                                                                                            
AttributeError: 'NoneType' object has no attribute 'send'`

I have the latest python3 and did a pip3 install for timers and popupwin

danth commented 4 years ago

The child process used for doing the pathfinding has not launched, or not connected yet, hence server_connection is None instead of a connection object.

How soon did this occur after starting Vim? Perhaps it just hadn't started up fast enough to be ready to receive requests. Adding a check for that situation and displaying a better error message (or waiting for the server to load) would be a good idea, I'll do that soon.

edleeman17 commented 4 years ago

Thank you! here's an example of what is happening for me.

Peek 2020-06-05 13-24

danth commented 4 years ago

I just pushed some changes, could you update to at least d58490bfa2320a4202ede0e50f63145375331434 and let me know what happens then?

edleeman17 commented 4 years ago

Okay, new error this time


line   18:                                                                                                                                                                                                         
Error invoking 'python_execute' on channel 3 (python3-script-host):                                                                                                                                                
Traceback (most recent call last):                                                                                                                                                                                 
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/client.py", line 80, in poll_responses                                                                                                                     
    self.server_connection = connection.Client(self.file_path)                                                                                                                                                     
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 502, in Client                                                                                                                                     
    c = SocketClient(address)                                                                                                                                                                                      
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 630, in SocketClient                                                                                                                               
    s.connect(address)                                                                                                                                                                                             
FileNotFoundError: [Errno 2] No such file or directory                                                                                                                                                             

During handling of the above exception, another exception occurred:                                                                                                                                                

Traceback (most recent call last):                                                                                                                                                                                 
  File "<string>", line 1, in <module>                                                                                                                                                                             
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/client.py", line 86, in poll_responses                                                                                                                     
    raise Exception(                                                                                                                                                                                               
Exception: Pathfinding server process exited with return code {return_code}```                                                                                             
danth commented 4 years ago

Are you using Neovim? If you are I think I know the problem. --not-a-term isn't an option for Neovim, instead we should be using --headless.

edleeman17 commented 4 years ago

I am using neovim... :D

danth commented 4 years ago

Yeah, that's probably it then, I'll push a hopeful fix in a minute

danth commented 4 years ago

Ok can you try it with d72b38683be8f8744e35287b3996cb42e3df8916? I can't test since I only have regular Vim/GVim installed

edleeman17 commented 4 years ago
Error detected while processing function PathfinderLoop[2]..provider#python3#Call:                     
line   18:                                                                                             
Error invoking 'python_execute' on channel 3 (python3-script-host):                                    
Traceback (most recent call last):                                                                     
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/client.py", line 99, in poll_responses         
    self.server_connection = connection.Client(self.file_path)                                         
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 502, in Client                         
    c = SocketClient(address)                                                                          
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 630, in SocketClient                   
    s.connect(address)                                                                                 
FileNotFoundError: [Errno 2] No such file or directory                                                 

During handling of the above exception, another exception occurred:                                    

Traceback (most recent call last):                                                                     
  File "<string>", line 1, in <module>                                                                 
  File "/home/ed/.vim/plugged/pathfinder.vim/pathfinder/client.py", line 105, in poll_responses        
    raise Exception(                                                                                   
Exception: Pathfinding server process exited with return code 1

No luck, I'm afraid, thank you for your effort though!

danth commented 4 years ago

I think we need to add something to fetch and log stdout/stderr from the child process so that we can see what has gone wrong.