-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Errors when debugging with remote kernel #18330
Comments
Hi @shankyemcee thank you for the feedback! I think this is not possible at the moment :/ but maybe @ccordoba12 or @impact27 could have some ideas? |
It should work now as you describe, but you have to make sure the version of spyder-kernels matches the version on spyder. I am working on a pr to use the control channel for debugging which should be more reliable, but because this won’t work with python 2.7, it won’t be available before spyder 6. Can you confirm the version on spyder you are using and the version of spyder-kernels on the remote server? |
I am using spyder 5.3.1 on my system and spyder_kernels 2.3.1 on both the remote server and my own system. To me the error looks like its trying to look for the file in the remote system, but I am trying to debug it on my own system. Basically I just want to use the compute resources and packages on the remote server, but all file access and debugging should happen on my own system. |
Si the way it works is that spyder sends the content of the editor to the remote kerne. I’ll have a look to see if I can reproduce |
@shankyemcee, you posted above:
Please run |
Output of %tb: Traceback (most recent call last): File "/project/6027213/shankar5/envs/lit/lib/python3.8/site-packages/spyder_kernels/customize/spydercustomize.py", line 512, in get_file_code File "/project/6027213/shankar5/envs/lit/lib/python3.8/site-packages/spyder_kernels/comms/commbase.py", line 557, in call File "/project/6027213/shankar5/envs/lit/lib/python3.8/site-packages/spyder_kernels/comms/commbase.py", line 440, in _get_call_return_value File "/project/6027213/shankar5/envs/lit/lib/python3.8/site-packages/spyder_kernels/comms/commbase.py", line 496, in _sync_error File "/project/6027213/shankar5/envs/lit/lib/python3.8/site-packages/spyder_kernels/comms/commbase.py", line 90, in raise_error OSError: [Errno 22] Invalid argument: '/project/6027213/shankar5/envs/lit/C:/Users/Dell G7 User 2/Documents/PROJECTS/vision_transformer/vision_transformer/vit_jax/main.py' Here '/project/6027213/shankar5/envs/lit/' is where I hosted the remote kernel and 'C:/Users/Dell G7 User 2/Documents/PROJECTS/vision_transformer/vision_transformer/vit_jax/main.py' is the file on my system I am trying to debug |
When you press debug, what exactly appears in your console? do you have |
I have tried:
With that, the bebugging starts normally. |
I think I found it, it is a problem of windows vs linux paths:
|
@shankyemcee Could you check if spyder-ide/spyder-kernels#389 solves the issue? |
Hi, Can I please know how I can access this update? Is it through updating spyder_kernels or spyder? |
On the remote machine: |
Hi, |
That is strange, could you give me the steps you follow to launch and connect, and the exact error you see? |
Hi, I refreshed the connections, and it appears to be working. But one problem is that I don't know which line is executing. For example here is the screenshot of when i used debugging with remote kernel: and here is a screenshot with debugging in local kernel: The arrow is missing in remote kernel connection. Can this be added? Thanks. |
spyder-ide/spyder-kernels#389 has been updated, can you try again? |
Thankyou, it's working brilliantly! Would this update be directly available through the next spyder_kernels release through conda or pip? |
Yes it should if we have time to merge it, otherwise the next one |
Sounds good, Thanks a lot for all your help! |
We need this open so we don't forget to address it. |
Hi,
I am working on a similar problem as this post(#3587 (comment)) and all the comments are helpful. But for my use case I would like to debug my python script locally with a python kernel hosted on a cloud server, and I get similar issues:
This command failed to be executed because an error occurred while trying to get the file code from Spyder's editor. The error was:
An exception has occurred, use %tb to see the full traceback.
OSError: [Errno 22] Invalid argument: '....'
For reference, I am using windows with spyder 5.3.1 and I am connecting to a remote linux kernel having python 3.7. The steps I followed to set it up using Mobaxterm:
login to your remote server, create your python environment there and start your python kernel using the following line:
python -m spyder_kernels.console --ip=127.0.0.1 -f=./remotemachine.json
(Note: ip address should can also be localhost)
Open another local terminal in mobaxterm and enter:
ssh -L ::<control-port from remotemachine.json @
Copy the generated remotemachine.json file to your local system, open spyder, click on connect to existing kernel:
enter the remotemachine.json path in Connection File,
in hostname put the ,
in username enter the for your cloud server,
in port put 22(default ssh port on mobaxterm),
and enter the password for remote server login.
And it should connect then. After these steps I am able to send simple command line functions, but not able to debug the file. Is there any new support added for this already?
Thanks.
The text was updated successfully, but these errors were encountered: