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

Python docker debug launch - Cannot read property 'python' of undefined #2077

Closed
revmischa opened this issue Jun 18, 2020 · 6 comments · Fixed by #2095
Closed

Python docker debug launch - Cannot read property 'python' of undefined #2077

revmischa opened this issue Jun 18, 2020 · 6 comments · Fixed by #2095
Assignees
Labels

Comments

@revmischa
Copy link

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
@bwateratmsft
Copy link
Contributor

bwateratmsft commented Jun 18, 2020

@ucheNkadiCode is this the debugpy issue you mentioned?
Nope, this is something else.

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Jun 18, 2020

@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 bwateratmsft assigned bwateratmsft and haniamr and unassigned haniamr Jun 18, 2020
@revmischa
Copy link
Author

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Jun 18, 2020

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 microsoft/vscode-docs#3791 for that.

@haniamr, we should try to detect this failure condition and give a better error message.

@revmischa
Copy link
Author

That does solve the error at least, but I want to use docker-compose

@bwateratmsft
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants