Skip to content
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

remote debugging - remote server is different OS from local server #44932

Closed
Loreton opened this issue Mar 2, 2018 · 5 comments
Closed

remote debugging - remote server is different OS from local server #44932

Loreton opened this issue Mar 2, 2018 · 5 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster

Comments

@Loreton
Copy link

Loreton commented Mar 2, 2018

  • VSCode Version: 1.17.2
  • OS Version: Windows 7

Steps to Reproduce:

  1. prepare code on linux using netiface module
    2.run debug from windows to remote linux
    When the local module (windows), in my case "netifaces", has different characteristics from remote module (linux) we get error reading the network interface caracteristics. Why? It should run remote code and not local code.
    Regards

Does this issue occur when all extensions are disabled?: Yes/No

@vscodebot
Copy link

vscodebot bot commented Mar 2, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@isidorn
Copy link
Contributor

isidorn commented Mar 2, 2018

Sounds like a potential duplicate of the wsl issues, forwarding to @weinand

@isidorn isidorn assigned weinand and unassigned isidorn Mar 2, 2018
@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label Mar 2, 2018
@weinand
Copy link
Contributor

weinand commented Mar 2, 2018

@Loreton How does your launch config look like?

@weinand weinand added the info-needed Issue requires more information from poster label Mar 2, 2018
@Loreton
Copy link
Author

Loreton commented Mar 5, 2018

my main.py code

# ####################################
# #### R E M O T E  - Linux OS #############
# ####################################

# ******** D E B U G *********************************
import ptvsd
ptvsd.enable_attach("my_secret", address=('localhost', 3000))
ptvsd.wait_for_attach() # only in the remote node
# ******** D E B U G *********************************


import sys; sys.dont_write_bytecode = True
import  Source as Prj

myLibName = ['LnPyLib', 'DDNS_v2018-02-27.zip'] 
LnLib     = Prj.SPE.LibPath(myLibName, fDEBUG=False)



# ####################################
# #### L O C A L    Windows OS ############
# ####################################

# ******** D E B U G *********************************
import ptvsd
ptvsd.enable_attach("my_secret", address=('localhost', 3000))
# ptvsd.wait_for_attach() # only in the remote node
# ******** D E B U G *********************************


import sys; sys.dont_write_bytecode = True
import  Source as Prj

myLibName = ['LnPyLib', 'DDNS_v2018-02-27.zip']   **_<=== BreakPoint_**
LnLib     = Prj.SPE.LibPath(myLibName, fDEBUG=False)

Problem

When I start the debugger I can STEP just the first two line and the I get an error regarding a missing feature of netifaces module (AF_PACKET).

File "y:\GIT-REPO\Python3\DDNS_main_.py", line 79, in
Prj.Main(gv.args.firstPosParameter)
File "y:\GIT-REPO\Python3\DDNS\Source\Main\DDNS_Main.py", line 83, in Main
interfaces = Ln.getInterfaces(dictType=Ln.Dict)
File "y:\GIT-REPO\Python3\DDNS\LnPyLib\Net\InterfacesCl.py", line 418, in getInterfaces
ifc = Interfaces(ifcName)
File "y:\GIT-REPO\Python3\DDNS\LnPyLib\Net\InterfacesCl.py", line 116, in init
self.arpPing(self._gatewayIpAddress)
File "y:\GIT-REPO\Python3\DDNS\LnPyLib\Net\InterfacesCl.py", line 319, in arpPing
macAddressHex = bytes.fromhex(self._MAC_address.replace(':',''))
AttributeError: 'NoneType' object has no attribute 'replace'

But this feature is missed just in windows module and not in linux one.
In any case:

  1. it doesn't stop in the breakpoint line.
  2. the TCP connection to remote machine NOT starts

launch extract configuration

   "configurations": [
        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceRoot}",
            "env": {},
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                // "WaitOnAbnormalExit",
                // "WaitOnNormalExit",
                "RedirectOutput"
            ],
            "args": [
                "update",
                "--profile",
                "LnPi23"
            ]
        },
    ....
    i have the following tunnel ssh -L 3001:destMaschine:3000 
        {
            "name": "Attach (Remote Debug)",
            "type": "python",
            "request": "attach",
            "localRoot": "${workspaceRoot}",
            "remoteRoot": "/home/pi/GIT-REPO/Python3/DDNS",
            "port": 3001,    
            "secret": "my_secret",
            "host": "localhost"
        }
    ]

Kind Regards

@weinand
Copy link
Contributor

weinand commented Mar 5, 2018

This issue was moved to microsoft/vscode-python#948

@weinand weinand closed this as completed Mar 5, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants