Skip to content

Debugpy permission denied to conda env even after chmod 777 #1932

@kielpins-nearmap

Description

@kielpins-nearmap

Running VSCode debugpy for pytest remotely on an AWS Sagemaker instance. launch.json times out owing to Permission denied error on $CONDA_PREFIX directory. I have manually set chmod -R 777 $CONDA_PREFIX but still get Permission denied.

Note that this has never been a problem before with my setup, it just started today.

Environment data

  • debugpy version: 1.8.15
  • OS and version: Ubuntu 22.04
  • Python version (& distribution if applicable, e.g. Anaconda): conda-forge 3.12.11
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Upon attempting to launch test debugging from the Testing pane:

cd /home/sagemaker-user/user-default-efs/$CODE_DIR ; /usr/bin/env $CONDA_PREFIX /home/sagemaker-user/.vscode-server/extensions/ms-python.debugpy-2025.10.0/bundled/libs/debugpy/adapter/../../debugpy/launcher 57595 -- /home/sagemaker-user/.vscode-server/extensions/ms-python.python-2025.10.1/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/sagemaker-user/user-default-efs/$CODE_DIR --capture=no 
/usr/bin/env: '$CONDA_PREFIX': Permission denied

and a popup with Timed out waiting for launcher to connect which is presumably the consequence of the above error.

Expected behavior

Launch debugpy.

Steps to reproduce:

  1. launch.json:
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug Tests",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "purpose": ["debug-test"],
            "console": "externalTerminal",
            "justMyCode": false,
            "args": [
                "--cache-clear"
            ],
            }
        }
    ]
}
2. `chmod +R 777 $CONDA_PREFIX`
3. launch any test from `Debug test` icon in `Testing` pane

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions