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

Debugger broken on last release (2019.5) #5833

Closed
AllanDaemon opened this issue May 29, 2019 · 4 comments
Closed

Debugger broken on last release (2019.5) #5833

AllanDaemon opened this issue May 29, 2019 · 4 comments
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release

Comments

@AllanDaemon
Copy link

AllanDaemon commented May 29, 2019

After the last update, some parts of the debugger stop working. The setup is not simple, with multiple folders in the workspace, specific CWD in lauch.json, but it runs fine until version 2019.4.12954, but broke on update to 2019.5.17059.

I will try to give further details, like a minimal reproducible example, but due time constraints I'll give the minimum to report the bug.

Environment data

  • VS Code version:
    Version: 1.34.0
    Commit: a622c65b2c713c890fcf4fbf07cf34049d5fe758
    Date: 2019-05-15T21:55:35.507Z
    Electron: 3.1.8
    Chrome: 66.0.3359.181
    Node.js: 10.2.0
    V8: 6.6.346.32
    OS: Linux x64 5.0.16-300.fc30.x86_64

  • Extension version:
    [BROKEN VERSION]
    Name: Python
    Id: ms-python.python
    Description: Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.
    Version: 2019.5.17059
    Publisher: Microsoft
    VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
    [LATEST WORKING VERSION]
    Version: 2019.4.12954

  • OS and version: GNU/Linux Fedora 30 64bit

  • Python version: Python 3.7.3

Expected behaviour x Actual behaviour

After the upgrade, the debugger is somehow broken. Roughly, the CWD or source code mapping is trying the wrong path. The debugger starts, but when you try to set a breakpoint, it shows up in the console:
pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/user/work/company/project/back-end/project/back-end/app.py (will have no effect)

The correct path would be /home/user/work/company/project/back-end/app.py. Also, if you set up a breakpoint in a line before the debugger starts, it does not break on it when running.

My workspace have multiple folders, and my configuration on laucher sets CWD. I tried to adapt the launcher.json config to work on the new version, like removing the cwd in the laucher setting. It fixed this issue, but broke other stuff.

I tried this with fresh settings, and with all extensions disabled except the Python one.

Some parts (the relevant ones) of my workspace settings file. The file is in root_workspace/misc/project.code-workspace. More on the files tree above.

{
	"folders": [
		{
			"path": "..",
		},
		{
			"name": "backend",
			"path": "../project/back-end",
		},
		{
			"name": "frontend/src",
			"path": "../project/front-end/src",
		},
		{
			"path": "../libforproject",
		}
	],
	"settings": {
		"terminal.integrated.env.linux": {
			"PYTHONPATH": "${workspaceFolder:libforproject}",
		},
	}
}

My .vscode/launch.json file (relevant parts):

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Python: backend",
			"type": "python",
			"request": "launch",
			"cwd": "${workspaceFolder}/project/back-end/",
			// "envFile": "${workspaceFolder}/data/pg.prod.env",
			"envFile": "${workspaceFolder}/data/pg.dev.env",
			"env": {
				"PROJECT_REALOAD": "FALSE",
			},
			"program": "${workspaceFolder}/project/back-end/app.py",
			"console": "integratedTerminal"
		},
	]
}

PS: I renamed some names like my username or project name.

Also, if it can help, the redacted file tree of the project. I remove irrelevant parts. Generated by $ tree.

.
├── TODO
├── backend.rest
├── data
│   ├── doc
        (...)
│   ├── jupyter
             (...)
│   ├── pg.dev.env
│   ├── pg.prod.env
│   └── pg_db
              (...)
├── project
│   ├── README.md
│   ├── back-end
│   │   ├── Dockerfile
│   │   ├── Dockerfile-dev
│   │   ├── app.py
│   │   ├── app_factory.py
│   │   ├── bottle.py -> /usr/local/lib/python3.7/site-packages/bottle.py
│   │   ├── module1
│   │   │   ├── __init__.py
│   │   │   (...)
│   │   ├── database.py
│   │   ├── module2
│   │   │   ├── __init__.py
│   │   │   ├── file1.py
│   │   │   ├── file2.py
│   │   │   ├── file3.py
│   │   │   ├── log.py
│   │   │   ├── logging.ini
│   │   ├── libproject
│   │   │   ├── __init__.py
│   │   │   ├── libproject.py
│   │   │   ├── file1.py
│   │   │   ├── file2.py
│   │   │   ├── file3.py
│   │   │   ├── pyproject.toml
│   │   ├── module3
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── mod1.py
│   │   │   ├── mod2.py
│   │   │   ├── mod3.py
│   │   │   └── mod4.py
│   │   ├── somelib -> ../libs/somelib/somelib
│   │   ├── module4
│   │   │   ├── __init__.py
│   │   │   ├── file1.py
│   │   │   ├── file2.py
│   │   │   ├── file3.py
│   │   │   ├── file4.py
│   │   │   ├── file5.py
│   │   ├── requirements-dev.txt
│   │   ├── requirements.txt
│   │   ├── another_file.py
│   │   ├── module5
│   │   │   ├── __init__.py
│   │   │   ├── file1.py
│   │   │   ├── file2.py
│   │   │   ├── file3.py
│   │   │   ├── file4.py
│   │   │   ├── file5.py
│   │   │   ├── file6.py
│   │   ├── tests
│   │   │   ├── __init__.py
│   │   │   ├── test_1.py
│   │   │   └── test_2.py
│   ├── docker-compose.yml
│   ├── front-end
│   │   ├── Dockerfile
│   │   ├── node_modules
        (...)
│   │   ├── package-lock.json
│   │   ├── package.json
│   │   ├── public
                   (...)
│   │   ├── src
                   (...)
│   │   └── yarn.lock
│   ├── libs
│   └────── somelib
                        (...)
├── docker-compose.yml
├── libproject
│   ├── __init__.py
│   ├── jupyter
│   │   ├── filefile01.ipynb
│   │   ├── filefile02.ipynb
│   │   └── filefile03.ipynb
│   ├── libproject.py
│   ├── file1.py
│   ├── file2.py
│   ├── file3.py
│   ├── pyproject.toml
│   ├── test_all.py
│   └── tests
│       ├── __init__.py
│       └── test_1.py
├── misc
│   ├── project.code-workspace

5404 directories, 38902 files

Logs

Output for Python in the Output panel

Starting Jedi Python language engine.
##########Linting Output - pylint##########
************* Module app
86,11,error,no-member:Method 'app' has no 'default_error_handler' member
93,11,error,no-member:Method 'app' has no 'default_error_handler' member
100,11,error,no-member:Method 'app' has no 'default_error_handler' member
107,11,error,no-member:Method 'app' has no 'default_error_handler' member

------------------------------------------------------------------
Your code has been rated at 7.96/10 (previous run: 7.96/10, +0.00)
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 29, 2019
@AllanDaemon AllanDaemon changed the title Debugger broken on last release 2019.5 Debugger broken on last release (2019.5) May 29, 2019
@ghost
Copy link

ghost commented May 29, 2019

Also seeing this issue:

pydev debugger: warning: trying to add breakpoint to file that does not exist: c:\git\master-forecaster\forecaster\forecaster\localtesting\trainmodel.py (will have no effect)

@schperplata
Copy link

We are experiencing exactly the same issue.

@daydreamingwill
Copy link

Me and my colleague seem to be having a similar issue. We get a Windows popup saying "Timeout waiting for debugger connection". The terminal reads (user paths edited etc.):

C:\Users\user\Documents\project\>cd "c:\Users\user\Documents\project" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && "C:\Users\user\AppData\Local\Programs\Python\Python35\python.exe" """c:/Users/user/.vscode/extensions/ms-python.python-2019.5.17059/pythonFiles/ptvsd_launcher.py""" --default --client --host localhost --port 50000"c:\Users\user\Documents\project\example.py" "
C:\Users\user\AppData\Local\Programs\Python\Python35\python.exe: can't open file '"c:/Users/user/.vscode/extensions/ms-python.python-2019.5.17059/pythonFiles/ptvsd_launcher.py"': [Errno 22] Invalid argument

Reverting to the previous version (from 2019.5.17059 to 2019.4.12954) fixes the issue.

@DonJayamanne
Copy link

We're working on getting a point release out ASAP. Apologies for the inconvenience caused.

@ghost ghost removed the needs PR label May 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2019
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 regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

4 participants