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 extension fails to find user settings.json in when opened inside a container #17523

Closed
oscarhermoso opened this issue Sep 25, 2021 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@oscarhermoso
Copy link

Environment data

  • VS Code version:
    Version: 1.60.2
    Commit: 7f6ab5485bbc008386c4386d08766667e155244e
    Date: 2021-09-22T12:01:43.795Z
    Electron: 13.1.8
    Chrome: 91.0.4472.164
    Node.js: 14.16.0
    V8: 9.1.269.39-electron.0
    OS: Linux x64 5.11.0-7620-generic
  • Extension version (available under the Extensions sidebar): v2021.9.1246542782
  • OS and version: OS: Linux x64 5.11.0-7620-generic
  • Python version: Python 3.8.11 64-bit (mcr.microsoft.com/vscode/devcontainers/python:0.201-3.8)
  • Type of virtual environment used: N/A (VS Code Dev container)
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: "Pylance"

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

When running the Python Extension in a dev container on a Linux desktop OS, expect python extension to read global/User settings.json from the user's home directory.

Actual behaviour

Python extension attempts to read from the home directory of the container user - vscode, and fails to find the actual settings file.

image

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. On a Linux computer, checkout this repo: https://github.com/oscarhermoso/vscode-unittest-failure
  2. Build and open in container
  3. Open Output panel, and choose Python from drop down to see stack trace failing to find location

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Python Output

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'pythonDeprecatePythonPath'
User belongs to experiment group 'pythonSortEnvs'
User belongs to experiment group 'pythonRunFailedTestsButtonDisplayedcf'
User belongs to experiment group 'pythonRefreshTestsButtonDisplayed'
User belongs to experiment group 'pythonRememberDebugConfig'
Python interpreter path: /usr/local/bin/python
Error 2021-09-25 05:26:00: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://dev-container+2f686f6d652f6368656573653835322f446f63756d656e74732f4769744875622f707974686f6e2d7673636f64652d756e6974746573742d6661696c7572652f7673636f64652d756e6974746573742d6661696c757265/home/vscode/.config/Code/User/settings.json' (Error: Unable to resolve non-existing file 'vscode-remote://dev-container+2f686f6d652f6368656573653835322f446f63756d656e74732f4769744875622f707974686f6e2d7673636f64652d756e6974746573742d6661696c7572652f7673636f64652d756e6974746573742d6661696c757265/home/vscode/.config/Code/User/settings.json')
	at _handleError (/home/vscode/.vscode-server/bin/7f6ab5485bbc008386c4386d08766667e155244e/out/vs/server/remoteExtensionHostProcess.js:94:160087)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async y.readText (/home/vscode/.vscode-server/extensions/ms-python.python-2021.9.1246542782/out/client/extension.js:9:314351)
	at async p.doesFileNeedToBeFixed (/home/vscode/.vscode-server/extensions/ms-python.python-2021.9.1246542782/out/client/extension.js:59:823969)
	at async /home/vscode/.vscode-server/extensions/ms-python.python-2021.9.1246542782/out/client/extension.js:59:823096
	at async Promise.all (index 0)
	at async p.getFilesToBeFixed (/home/vscode/.vscode-server/extensions/ms-python.python-2021.9.1246542782/out/client/extension.js:59:823042)
	at async p.updateTestSettings (/home/vscode/.vscode-server/extensions/ms-python.python-2021.9.1246542782/out/client/extension.js:59:822669)] {
  code: 'FileNotFound'
}
Starting Pylance language server.
> conda --version

@oscarhermoso oscarhermoso added bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team labels Sep 25, 2021
@oscarhermoso
Copy link
Author

oscarhermoso commented Sep 25, 2021

By the way, logs are similar to this closed issue.

@karthiknadig
Copy link
Member

This is fixed via #17312

@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Sep 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants