Does this occur consistently? Yes
Repro steps:
Create launch config: https://code.visualstudio.com/docs/containers/debug-common#_python
"configurations": [
{
"name": "Docker: Python - Django",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"python": {
"pathMappings": [
{
"localRoot": "${workspaceFolder}/foo",
"remoteRoot": "/srv/foo"
}
],
"projectType": "django",
"django": true
}
},...
Action: docker-launch
Error type: TypeError
Error Message: Cannot read property 'python' of undefined
Version: 1.3.0
OS: darwin
OS Release: 19.5.0
Product: Visual Studio Code
Product Version: 1.46.0
Language: en
Call Stack
PythonDebugHelper.resolveDebugConfiguration extension.bundle.js:423:352918
DockerDebugConfigurationProvider.resolveDebugConfigurationInternal extension.bundle.js:492:322397
processTicksAndRejections task_queues.js:85:5
extension.bundle.js:492:322145extension.bundle.js:492:322145
@uchenkadicode is this the debugpy issue you mentioned?
Nope, this is something else.
@revmischa Did you add this launch config directly to launch.json or did you use one of the commands Add Dockerfiles to workspace or Initialize for debugging to add it?
I am able to reproduce this issue if the dependent pre-launch task docker-run: debug does not exist.
@bwateratmsft I just copied it from https://code.visualstudio.com/docs/containers/debug-common#_python
Ok. If you already have a dockerfile can you try doing Docker: Initialize for debugging, or if not Docker: Add Dockerfiles to workspace? This will add all the necessary launch and tasks. However, debugging will still be blocked due to #2080 which we are working on fixing ASAP.
@ucheNkadiCode, we need to update the docs to make it clearer that copying the launch config isn't sufficient. I filed https://github.com/microsoft/vscode-docs/issues/3791 for that.
@haniamr, we should try to detect this failure condition and give a better error message.
That does solve the error at least, but I want to use docker-compose
We don't currently have integrated docker-compose debugging, but @haniamr might be able to help you set up an attach configuration that will work.
Most helpful comment
Ok. If you already have a dockerfile can you try doing
Docker: Initialize for debugging, or if notDocker: Add Dockerfiles to workspace? This will add all the necessary launch and tasks. However, debugging will still be blocked due to #2080 which we are working on fixing ASAP.@ucheNkadiCode, we need to update the docs to make it clearer that copying the launch config isn't sufficient. I filed https://github.com/microsoft/vscode-docs/issues/3791 for that.
@haniamr, we should try to detect this failure condition and give a better error message.