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 debug cursor missing in VSCode #899

Closed
DJManas opened this issue Feb 26, 2018 · 13 comments
Closed

Remote debug cursor missing in VSCode #899

DJManas opened this issue Feb 26, 2018 · 13 comments
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@DJManas
Copy link

DJManas commented Feb 26, 2018

Environment data

VS Code version: 1.20.1 (1.20.1)
Python Extension version: 2018.1.0
Python Version: 3.6.4 MacOS, 3.6.4 FreeBSD (both ptvsd 3.0.0)
OS and version: MacOS 10.13.3, Remote FreeBSD 11.1

Actual behavior

I can’t see stepper cursor for debugger, where it is on the line
2018-02-26_16-52-30

Configuration is correct, but I guess it might have something to do with „Unknown source“ in call stack, but I have correct directories there.

    {
      "name": "BSDAdmin: Remote",
      "type": "python",
      "request": "attach",
      "localRoot": "${workspaceFolder}",
      "remoteRoot": "/home/djmanas/python",
      "port": 4000,
      "secret": "my_secret",
      "host": "127.0.0.1",
    }

Expected behavior

I guess it should show me hilighted line, on which the debugger is

Steps to reproduce:

  • Launch any script on remote server via remote debugging,
  • It gets attached, but cursor is nowhere

Logs

Output from Python output panel

Nothing.

Output from Console window (Help->Developer Tools menu)

Nothing.
@DonJayamanne
Copy link

Looks like the debugger has stopped at some location that doesn't have a corresponding source.
If you look at the call stack you can see it has stopped at some module and the source isn't available.

  • The file you have opened is BSDAdmin.py, is this the file that waits for the remote debugger to attach or are you not waiting for it to attach?

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug area-debugging info-needed Issue requires more information from poster labels Feb 26, 2018
@DJManas
Copy link
Author

DJManas commented Feb 26, 2018

Remote side ls -al /home/djmanas/python:

djmanas@LittleDevilSB ~/python $ ls -al
total 28
drwxr-xr-x   5 djmanas  djmanas     7 Feb 26 19:54 .
drwxr-xr-x  12 djmanas  djmanas    26 Feb 26 18:28 ..
-rw-rw-rw-   1 djmanas  djmanas  1280 Feb 26 19:54 BSDAdmin.py
drwxr-xr-x   2 djmanas  djmanas     4 Feb 26 19:54 __pycache__
-rw-rw-rw-   1 djmanas  djmanas   416 Feb 26 19:54 _helper.py
drwxr-xr-x   3 djmanas  djmanas     5 Feb 26 17:58 jailCommon
drwxr-xr-x   4 djmanas  djmanas     5 Feb 26 19:54 nixCommon

Local side ls -al /Users/djmanas/Dropbox/Projekty/Python/BSDAdmin.git:

RinceWind:BSDAdmin.git djmanas$ ls -al /Users/djmanas/Dropbox/Projekty/Python/BSDAdmin.git
total 40
drwxr-xr-x@  9 djmanas  staff   288 26 úno 19:53 .
drwxr-xr-x@  8 djmanas  staff   256 26 úno 14:27 ..
-rw-r--r--@  1 djmanas  staff   146 26 úno 11:33 .env
drwxr-xr-x@ 12 djmanas  staff   384 26 úno 19:54 .git
-rw-r--r--@  1 djmanas  staff   742 26 úno 13:06 .gitignore
drwxr-xr-x@  4 djmanas  staff   128 26 úno 16:49 .vscode
-rw-r--r--@  1 djmanas  staff  1284 26 úno 19:54 BSDAdmin.py
-rw-r--r--@  1 djmanas  staff    66 26 úno 10:34 README.md
-rw-r--r--@  1 djmanas  staff   416 26 úno 19:53 _helper.py

Script to be run BSDAdmin.py you can see on both sides the file is present, the size difference is the comment in front of ptvsd commands:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import time
import ptvsd

from _helper import Helper

# ptvsd.enable_attach("my_secret", address=('127.0.0.1', 4000))
# ptvsd.wait_for_attach()
time.sleep(5)
# Command parser
try:
  # Prepare argument parser
  p = argparse. ArgumentParser(prog="BSDAdmin")
  p.set_defaults(func="help", force_upgrade=True)

  # Add subparesers -> additional commands
  subParsers = p.add_subparsers()

  # Update ports tree
  portsTreeUpdate = subParsers.add_parser("portsUpdate", aliases=["pu"],
                                          help="Portsnap wrapper to update ports system and jails.")
  portsTreeUpdate.add_argument("-s", "--system", action="store_false",
                               help="Include main system ports tree. Default True.")
  portsTreeUpdate.add_argument("-j", "--jails", action="store_false", help="Include base jail. Default True.")
  portsTreeUpdate.set_defaults(func="portsUpdate")

  # Parse options
  options = p.parse_args()

  # According to selected option do...
  if options.func == "portsUpdate":
    app = Helper()
    app.portsTreeUpdate(system=options.system, jails=options.jails)

  else:
    p.print_help()

except KeyboardInterrupt:
  print("\nYou have interrupted the program processing.")

Launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "BSDAdmin: Remote",
      "type": "python",
      "request": "attach",
      "localRoot": "/Users/djmanas/Dropbox/Projekty/Python/BSDAdmin.git",
      "remoteRoot": "/home/djmanas/python",
      "port": 4000,
      "secret": "my_secret",
      "host": "127.0.0.1",
    }
  ]
}

MacOS pip3 list:

RinceWind:BSDAdmin.git djmanas$ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
astroid (1.6.1)
flake8 (3.5.0)
isort (4.3.4)
lazy-object-proxy (1.3.1)
mccabe (0.6.1)
mysqlclient (1.3.12)
pep8 (1.7.1)
pip (9.0.1)
ptvsd (3.0.0)
pycodestyle (2.3.1)
pyflakes (1.6.0)
pylint (1.8.2)
PyMySQL (0.8.0)
rope (0.10.7)
setuptools (36.5.0)
six (1.11.0)
wheel (0.30.0)
wrapt (1.10.11)

FreeBSD pip3 list:

djmanas@LittleDevilSB ~/python $ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
ptvsd (3.0.0)
setuptools (38.5.1)
sqlite3 (0.0.0)

It looks like it attaches, even though when I click on the unknown module I see variables that should be there filled in, but wondering what happens, that it is not correctly read by VSC?

I am connecting through SSH to the server with -L 4000:127.0.0.1:4000 parameter and it connects. SSH connection is established, nc suceeds.

nc -z 127.0.0.1 4000

RinceWind:BSDAdmin.git djmanas$ nc -z 127.0.0.1 4000
Connection to 127.0.0.1 port 4000 [tcp/terabase] succeeded!

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Feb 26, 2018
@DonJayamanne
Copy link

I'm assuming you have opened the folder /Users/djmanas/Dropbox/Projekty/Python/BSDAdmin.git in VS Code.
If you have, then please change your launch.json as follows:

"localRoot": "${workspaceFolder}",

Please try that.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Mar 20, 2018
@DJManas
Copy link
Author

DJManas commented Mar 21, 2018

Nope, still the same.

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "BSDAdmin: Remote",
      "type": "python",
      "request": "attach",
      "localRoot": "${workspaceFolder}",
      "remoteRoot": "/home/djmanas/python",
      "port": 4000,
      "secret": "my_secret",
      "host": "10.211.55.10",
    }
  ]
}

2018-03-21_15-14-31

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Mar 21, 2018
@DonJayamanne
Copy link

@DJManas
Please could you test this in the latest version of the extension.
I'm unable to replicate this at my end, however we did identify an fix a related issue #87

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels May 8, 2018
@DJManas
Copy link
Author

DJManas commented May 8, 2018

Just to make sure. You mean last stable 2018.4.0?

@DonJayamanne
Copy link

Yes

@DJManas
Copy link
Author

DJManas commented May 9, 2018

Still the same. Unknown Source, no cursor.

Just wondering isn’t there any „caches rebuild“ button, just to ensure, it is not within come caches?

2018-05-09_15-30-53

@DonJayamanne
Copy link

That's very unusual.

@DJManas
Copy link
Author

DJManas commented May 9, 2018

I have always been „special“ :-(

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels May 10, 2018
@nikhilweee
Copy link

@DonJayamanne I have the same error. The call stack shows Unknown Source on every function call.

@DJManas
Copy link
Author

DJManas commented Jun 12, 2018

According to the other issue #819, I had tested this one with the experimental python debugger.

Used:
ptvsd 4.1.1a5

Configuration,${workspace} didn’t work, since I use workspace with more folders and it launched it only localy, dunno if it is another bug or not, but when I switched it with local path it started to work:

  "configurations": [
    {
      "name": "BSDAdmin: Remote",
      "type": "pythonExperimental",
      "request": "attach",
      "localRoot": "/Users/djmanas/Dropbox/Projekty/Python/BSDAdmin",
      "remoteRoot": "/home/djmanas/python",
      "port": 4000,
      "host": "10.211.55.10",
    }
  ]

Result:
2018-06-12_13-36-46

Thank you guys.

@DonJayamanne
Copy link

It should be fixed, please test the latest development version of the extension. Instructions can be found here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

I'm closing this issue has I believe it has been resolved in the latest development version.
Please verify, and if it hasn't been resolved please re-open the issue or feel free to comment on this issue (& i'll re-open it).

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants