-
Notifications
You must be signed in to change notification settings - Fork 515
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
Cannot read property 'python' of undefined #2085
Comments
Same issue here. I'm trying within a workspace, all tasks are present and have been created by running Does this occur consistently? Yes Action: docker-launch Version: 1.3.1 Call Stack
|
@azagarelz can you share your tasks and launch configs? |
launch.json
tasks.json
|
@jrhubott You're using the {
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build"
],
"python": {
"module": "autoremovetorrents.main",
"args": ["--conf", "/config/config.yml", "--view"]
}
} |
I'm having the same issue since VS Code upgraded docker extension to 1.3.1 launch.json
tasks.json
Also, I cannot install another version of docker extension, every time I try it fails with "Server returned 404" |
I'm still not able to reproduce even with the exact same configuration that @adealdag shared. @adealdag, what OS and Python version are you using? Also, what version of the Python extension? I'm on Windows, Python 3.8.2, Python extension 2020.6.90262. Regarding the failure to install other versions, that looks like this bug: microsoft/vscode#99699 |
I'm running VS Code in Mac Os Catalina, Python 3.7.3, Python extension v2020.6.90262 |
@adealdag Do you have anything in settings.json for the Python or Docker extensions? |
Nothing fancy:
BTW, I have manually installed docker 1.2.1 from VSIX file, and everything started working again. Nothing else changed, just the version of the extension. |
@adealdag I'm stumped. I just can't figure it out. Would you be willing to try with an alpha build? The only possible explanations I can come up with are:
|
Sure! As long as I can roll back to the working version after the test, it's peerfectly OK for me. I'm kind of busy these days, but let me know how I can help on this and I'll try to do that as soon as I can. |
Downgrading the extension also fixed things for me. I have never done this before so it was hard to figure out what I was doing wrong, the main issue I had was it just hung there doing nothing. I tried everything, at some point my config threw the This is probably an Issue for the extension but something I noticed is 1.3.1 wasn't using any of my args. In 1.2.1 it ran this (good):
In 1.3.1 though it looks like this (bad):
Notice the new version didn't include my |
@pgross41 Are you on Insiders? There was a bug in VSCode Insiders (now fixed and released) that caused our tasks to hang forever; this affected all versions of the Docker extension. |
@adealdag @pgross41 I have prepared a build based on this branch, which adds a bunch of info to the Output tab for the Docker extension. This should help us get a better idea what is going on. Here's the build: https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=22277&view=results You can install that VSIX by running the command "Extensions: Install from VSIX..." When you run a Python debug operation it will spit out a lot of extra logs in the Output tab for Docker, can you paste that output, along with the tasks.json and launch.json you have? |
@bwateratmsft I'm not an Insiders I suspect the hanging is because the container is using tasks.json{
"version": "2.0.0",
"tasks": [
{
"type": "docker-build",
"label": "docker-build",
"platform": "python",
"dockerBuild": {
"tag": "dvr163hass:latest",
"dockerfile": "${workspaceFolder}/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
}
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dependsOn": [
"docker-build"
],
"python": {
"args": ["--key", "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "--log_level", "10", "/dev/dvr163-email.txt"],
"file": "/app/email2dropbox.py"
}
}
]
}
launch.json{
"configurations": [
{
"name": "Docker: Python - email2dropbox",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"python": {
"pathMappings": [
{
"localRoot": "${workspaceFolder}/root/app",
"remoteRoot": "/app"
}
],
"projectType": "general"
}
}
]
} I just did it with 1.2.1 and it worked as expected. Upgraded to 1.3.1 and the issue recreated. More info: 1.3.1Here is the run command it's using from Windows (I was using WSL for 1.3.1 last night but it's basically the same string).
I also get this error (Windows only... does not happen in WSL) 1.3.2-alphaWith this output:
|
Awesome, this is really helpful. Thanks @pgross41! The "'debugLauncherPath' must be str" error: Double check you have the latest version of the Python extension. Also, did you do anything to disable the new debugpy debugger experiment? Their as-released code still will not return anything when we query the debugger path if the debugpy experiment is disabled. RE the tasks--In your pasted |
@pgross41 @adealdag I talked to @alexr00, she suggested trying VSCode Insiders (make sure to get it up-to-date as there were some other issues with Insiders builds from earlier this month). She said there were some old task issues that have been fixed in Insiders that might be the root causes of what you're seeing. If time permits, can you try out Insiders with the 1.3.2-alpha from earlier, 1.3.1, and 1.2.1? If you only have time for one then try 1.3.2-alpha. 😄 Thanks for bearing with us and for all your help! |
@bwateratmsft sorry for changing the task name on you. Yes that was me, I was trying to see if the space in the label was causing it to break. Okay it's been a slow day at work today 😁 I upgraded to Insiders and tested all the Docker extensions: 1.2.1 - Works just like it has been 1.3.1 - It works and the terminal is doing something new. It builds in
but wait there's more, that terminal just sits there like always (seems to be hanging like before) but then a new
1.3.2-alpha This is throwing the same "Could not find task" error as above. Something worth noting is I have I will likely continue to develop with 1.2.1 for now but I'm happy to continue helping troubleshoot. Seems like 1.3.1 is stable on Insiders but 1.3.2-alpha is not stable anywhere. |
I remember now why the discrepancy between exists between what is shown in the terminal (not having the args) vs. what is run in that "Python Debug Console". When doing debugging, we do a The Python debug configuration, however, resolves and includes the args from the @alexr00 It sounds like the Insiders build did fix at least one of the causes of this issue (1.3.1 failed in public build but succeeded in Insiders build). However, there was no change in the task logic between 1.3.1 and 1.3.2-alpha, so something else must still be going on... |
@pgross41 I had an idea of what could have gone wrong (basically, any failure during extension activation would result in the task handler not being registered; there are changes in 1.3.2 related to that). I made a new build of that 1.3.2-alpha, in theory it should behave like 1.3.1 and therefore work in Insiders. The build: https://dev.azure.com/ms-azuretools/AzCode/_build/results?buildId=22392&view=results |
No further changes to be made in 1.4.0; hopefully this issue goes away between the fixes already in VSCode 1.47 and in Docker extension 1.4.0. |
I've actually been using Insiders with 1.3.1 with no issues |
That's good to hear. Hopefully Alex's fixes took care of most of the issues! |
It's hard to tell but it appears from telemetry that the rate of this issue is declining. Part of the difficulty is that the error is exactly the same in this case and also the user-error case where they did not add the tasks. For now I'll close this issue as fixed, but please let us know if anyone sees this problem return! |
We have released Docker 1.4.0. We're pretty sure this issue is fixed in that build, let us know if you see otherwise! |
Does this occur consistently? Yes
Repro steps:
Action: docker-launch
Error type: TypeError
Error Message: Cannot read property 'python' of undefined
Version: 1.3.1
OS: darwin
OS Release: 19.5.0
Product: Visual Studio Code
Product Version: 1.46.15
Language: en
Call Stack
The text was updated successfully, but these errors were encountered: