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

Docker launch config not running after last update #173319

Closed
michuhu opened this issue Feb 3, 2023 · 5 comments
Closed

Docker launch config not running after last update #173319

michuhu opened this issue Feb 3, 2023 · 5 comments
Assignees

Comments

@michuhu
Copy link

michuhu commented Feb 3, 2023

Does this issue occur when all extensions are disabled?: Yes/No - NOT VALID - issue needs extensions

  • VS Code Version: Version: 1.75.0
  • OS Version: Mac OS Ventura 13.1 (22C65)

After Update of Python extension to v2023.2.0, when using configuration defined in launch.json with Docker - e.g. "name": "Docker: Python gunicorn", I get an popup error

Invalid message: "pythonPath" is not valid if "python" is specified

I cannot locate this error in any OUTPUT window.

I'm pretty sure, that everything worked before the update, because I committed those files to git yesterday. When this stopped working I checked them out to see if maybe I made a mistake somewhere, but no.

This doesn't happen when I run the .py file locally, nor when I build and run container manually.

I've downgraded to 1.74.3 and it's all fine.

Reinstallation of vscode and deleting .vscode folder doesn't help either.

launch.json

{
    "version": "2.0.0",
    "configurations": [
        {
            "name": "Local Python: flask",
            "type": "python",
            "request": "launch",
            "module": "flask", 
            "env": {
                "FLASK_RUN_PORT": "8082"
            },
            "args": [
                "--app",
                "app:server",
                "--debug",
                "run"
            ],
            "justMyCode": true
        },
        {
            "name": "Docker: Python flask",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug flask",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "/app"
                    }
                ],
                "projectType": "flask"
            }
        },
        {
            "name": "Docker: Python gunicorn",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug gunicorn",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "/app"
                    }
                ],
                "projectType": "general"
            }
        }
    ]
}

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "docker-build",
			"label": "docker-build",
			"platform": "python",
			"dockerBuild": {
				"tag": "tuzdashapp:latest",
				"dockerfile": "${workspaceFolder}/Dockerfile",
				"context": "${workspaceFolder}",
				"pull": true
			}
		},
		{
			"type": "docker-run",
			"label": "docker-run: debug flask",
			"dependsOn": [
				"docker-build"
			],
			"dockerRun": {
				"env": {
					"FLASK_APP": "app.py",
					"FLASK_DEBUG": "1"
				},
				"volumes": [
					{
					  "containerPath": "/app", "localPath": "${workspaceFolder}"
					}
				  ],
				"ports": [
					{ "hostPort": 8082, "containerPort": 8082 }
				  ]
			},
			"python": {
				"args": [
					"run",
					"--no-debugger",
					// "--no-reload",
					"--host", "0.0.0.0",
					"--port", "8082"
				],
				"module": "flask"
			}
		},
		{
			"type": "docker-run",
			"label": "docker-run: debug gunicorn",
			"dependsOn": [
				"docker-build"
			],
			"dockerRun": {
				"volumes": [
					{
					  "containerPath": "/app", "localPath": "${workspaceFolder}"
					}
				  ],
				  "ports": [
					{ "hostPort": 8082, "containerPort": 8082 }
				  ]
			},
			"python": {
				"args": [
					"--timeout", "240",
					"--reload",
					"--bind", "0.0.0.0:8082",
					"app:server"
				],
				"module": "gunicorn"
			}
		}
	]
}
@michuhu michuhu changed the title Docker with debug not running after last update Docker launch config not running after last update Feb 3, 2023
@michuhu michuhu closed this as completed Feb 3, 2023
@michuhu michuhu reopened this Feb 3, 2023
@michuhu
Copy link
Author

michuhu commented Feb 3, 2023

closed by mistake ... missclicked :)

@cdena
Copy link

cdena commented Feb 4, 2023

I have this exact same issue and it has broken the ability for me to debug any python projects with docker. I can confirm that when I did a portable install of an older version (v1.65.2) that the debugging functionality worked again. When I change nothing and open the same project in 1.75.0 I receive the same message as stated in the issue above and there is no indication of what the root cause is ... or at least it is not apparent to me.

@ivs-cetmix
Copy link

I can confirm this bug
macOS 13.2 (22D49)

=== VSCode ====
Version: 1.75.0
Commit: e2816fe
Date: 2023-02-01T15:26:31.005Z (3 days ago)
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin arm64 22.3.0
Sandboxed: No

Our team encountered same bug on Windows and Ubuntu recently.

@KhASQ
Copy link

KhASQ commented Feb 6, 2023

Same issue here
vscode 1.75
Windows 10

It works after downgrading vscode to 1.74 and reinstalling python extension

@roblourens
Copy link
Member

Please file this on the Python extension repo, thanks

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

No branches or pull requests

6 participants