-
Notifications
You must be signed in to change notification settings - Fork 302
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
devcontainer creates files as wrong user (VSC-1495) #1320
Comments
This seems like the sort of thing that would be user error in the configuration steps but I'm at a bit of a loss. I don't see the behavior if I create another project and add another dev container (python3) to it. I do see the behavior if I install the hello_world example project. |
I believe I'm facing similar problem on Linux (mint). I post my question on forum: |
The Dockerfile invokes FROM espressif/idf, which in turn invokes FROM ubuntu:24.04. After some testing it appears that the ownership/permissions issue is inherited from ubuntu:24:04. Stripping down the Dockerfile and invoking FROM ubuntu:24:04 directly, the file owner for files written to host by user 'esp' is still incorrect (it is 'ubuntu'). However, downgrading to ubuntu:22.04 eliminates the issue. The attached Dockerfile is the blink example project Dockerfile with espressif/idf's Dockerfile pasted at the top, but invoking FROM ubuntu:22:04 instead of 24:04. When the hello_world dockerfile is replaced with this one, and entrypoint.sh is downloaded as explained in the Dockerfile comments (edit: and you rebuild the container without cache), the ownership/permissions for the container are correct (workspace files owned |
I believe solution posted by @tobiashagge is working for me... |
The cause of the issue, and potential solutions, are discussed at this link.. As this appears to be an issue in the espressif/idf docker file, not the VS code extension, I have opened an issue in that repository: espressif/esp-idf#14652. |
Discussion at espressif/esp-idf#14652 has convinced me that the fix should be done here. I think that deleting the ubuntu user after the first line in templates/.devcontainer/Dockerfile will fix the issue. I'm happy to test the fix and submit a patch, but due to hardware issues it may take a week or so. |
OS
Windows
Operating System version
Windows 11 (but within the provided docker image for blink)
Visual Studio Code version
1.93.1
ESP-IDF version
1.8.1
Python version
3.12.3
Doctor command output
---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS linux x64 5.15.153.1-microsoft-standard-WSL2
System environment variable IDF_PYTHON_ENV_PATH
/opt/esp/python_env/idf5.4_py3.12_env
System environment variable PATH
/vscode/vscode-server/bin/linux-x64/38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/bin/remote-cli:/opt/esp/idf/components/espcoredump:/opt/esp/idf/components/partition_table:/opt/esp/idf/components/app_update:/opt/esp/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin:/opt/esp/tools/riscv32-esp-elf-gdb/14.2_20240403/riscv32-esp-elf-gdb/bin:/opt/esp/tools/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin:/opt/esp/tools/riscv32-esp-elf/esp-14.2.0_20240906/riscv32-esp-elf/bin:/opt/esp/tools/esp32ulp-elf/2.38_20240113/esp32ulp-elf/bin:/opt/esp/tools/cmake/3.30.2/bin:/opt/esp/tools/openocd-esp32/v0.12.0-esp32-20240821/openocd-esp32/bin:/opt/esp/tools/qemu-xtensa/esp_develop_9.0.0_20240606/qemu/bin:/opt/esp/tools/qemu-riscv32/esp_develop_9.0.0_20240606/qemu/bin:/opt/esp/python_env/idf5.4_py3.12_env/bin:/opt/esp/idf/tools:/opt/qemu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
System environment variable PYTHON
undefined
Visual Studio Code version 1.93.1
Visual Studio Code language en
Visual Studio Code shell /usr/bin/bash
ESP-IDF Extension version 1.8.1
Workspace folder /workspaces/blink
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) /opt/esp/idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
ESP-HomeKit-SDK Path (idf.espHomeKitSdkPath) ${env:HOMEKIT_PATH}
Custom extra paths (idf.customExtraPaths)
Custom extra vars (idf.customExtraVars)
OPENOCD_SCRIPTS: d:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318/openocd-esp32/share/openocd/scripts
IDF_CCACHE_ENABLE: 1
ESP_ROM_ELF_DIR: d:\Espressif\tools\esp-rom-elfs\20240305/
Virtual env Python Path (idf.pythonBinPath) /opt/esp/python_env/idf5.4_py3.12_env/bin/python
Serial port (idf.port) /dev/ttyUSB1
OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,board/esp32-wrover.cfg
ESP-IDF Tools Path (idf.toolsPath) /opt/esp
Git Path (idf.gitPath) /usr/bin/git
Notification Mode (idf.notificationMode) All
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-HomeKit Path (idf.espHomeKitSdkPath) false
Access to ESP-IDF Custom extra paths
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH true
Access to Ninja in environment PATH true
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path false
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-HomeKit-SDK Path (idf.espHomeKitSdkPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.43.0
ESP-IDF version 5.4.0
Python version 3.12.3
Python's pip version 24.2
-------------------------------------------------- Project configuration settings ----------------------------------------------------------
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
annotated-types version: 0.7.0
argcomplete version: 3.5.0
bitarray version: 2.9.2
bitstring version: 4.2.3
certifi version: 2024.8.30
cffi version: 1.17.1
charset-normalizer version: 3.3.2
click version: 8.1.7
colorama version: 0.4.6
construct version: 2.10.70
cryptography version: 43.0.1
ecdsa version: 0.19.0
esp-coredump version: 1.11.0
esp-idf-kconfig version: 2.3.0
esp-idf-monitor version: 1.5.0
esp_idf_nvs_partition_gen version: 0.1.3
esp-idf-panic-decoder version: 1.2.1
esp-idf-size version: 1.6.0
esptool version: 4.8.0
freertos-gdb version: 1.0.3
idf-component-manager version: 2.0.3
idna version: 3.10
intelhex version: 2.3.0
jsonref version: 1.1.0
markdown-it-py version: 3.0.0
mdurl version: 0.1.2
packaging version: 24.1
pip version: 24.2
psutil version: 6.0.0
pyclang version: 0.5.0
pycparser version: 2.22
pydantic version: 2.9.2
pydantic_core version: 2.23.4
pydantic-settings version: 2.5.2
pyelftools version: 0.31
pygdbmi version: 0.11.0.0
Pygments version: 2.18.0
pyparsing version: 3.1.4
pyserial version: 3.5
python-dotenv version: 1.0.1
PyYAML version: 6.0.2
reedsolo version: 1.7.0
requests version: 2.32.3
requests-file version: 2.1.0
requests-toolbelt version: 1.0.0
rich version: 13.8.1
setuptools version: 71.0.0
six version: 1.16.0
tqdm version: 4.66.5
typing_extensions version: 4.12.2
urllib3 version: 2.2.3
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Error
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
"version": "0.2.0",
"configurations": [
{
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter"
},
{
"type": "espidf",
"name": "Launch",
"request": "launch"
}
]
}
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}\tools\xtensa-esp-elf\esp-13.2.0_20240530\xtensa-esp-elf\bin\xtensa-esp32-elf-gcc.exe",
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/",
"${config:idf.espIdfPathWin}/components/",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
----------------------------------------------------------- Latest error -----------------------------------------------------------------
{
"code": 1,
"killed": false,
"signal": null,
"cmd": "/opt/esp/python_env/idf5.4_py3.12_env/bin/python /opt/esp/idf/tools/check_python_dependencies.py -r /.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/esp_debug_adapter/requirements.txt"
}
----------------------------------------------------------- Logfile -----------------------------------------------------------------
{"message":"Open On-Chip Debugger v0.12.0-esp32-20240821 (2024-08-21-14:42)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n","stack":"Error: Open On-Chip Debugger v0.12.0-esp32-20240821 (2024-08-21-14:42)\nLicensed under GNU GPL v2\nFor bug reports, read\n\thttp://openocd.org/doc/doxygen/bugs.html\n\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1424988\n\tat ChildProcess.exithandler (node:child_process:414:7)\n\tat ChildProcess.emit (node:events:519:28)\n\tat maybeClose (node:internal/child_process:1105:16)\n\tat Socket. (node:internal/child_process:457:11)\n\tat Socket.emit (node:events:519:28)\n\tat Pipe. (node:net:338:12)","level":"error","timestamp":"2024-09-28T02:59:17.165Z"}
{"message":"Cannot access filePath: ${env:ADF_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:ADF_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1650824\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T03:16:31.614Z"}
{"message":"Cannot access filePath: ${env:MDF_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:MDF_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651002\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T03:16:31.615Z"}
{"message":"Cannot access filePath: ${env:ESP_MATTER_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:ESP_MATTER_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651094\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T03:16:31.615Z"}
{"message":"Cannot access filePath: ${env:HOMEKIT_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:HOMEKIT_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651190\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T03:16:31.615Z"}
{"message":"Cannot access filePath: ${env:ADF_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:ADF_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1650824\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T04:08:53.914Z"}
{"message":"Cannot access filePath: ${env:MDF_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:MDF_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651002\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T04:08:53.914Z"}
{"message":"Cannot access filePath: ${env:ESP_MATTER_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:ESP_MATTER_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651094\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T04:08:53.915Z"}
{"message":"Cannot access filePath: ${env:HOMEKIT_PATH}","stack":"Error: ENOENT: no such file or directory, access '${env:HOMEKIT_PATH}'\n\tat Object.accessSync (node:fs:244:11)\n\tat Se (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1421806)\n\tat /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651190\n\tat ua (/home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1651892)\n\tat process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n\tat async /home/esp/.vscode-server/extensions/espressif.esp-idf-extension-1.8.1/dist/extension.js:2:1868405","level":"error","timestamp":"2024-09-28T04:08:53.915Z"}
Extension
Lots of messages, but none are obviously (to me) relevant. Example:
{"message":"Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:26)\r\nLicensed under GNU GPL v2\r\nFor bug reports, read\r\n\thttp://openocd.org/doc/doxygen/bugs.html\r\n","stack":"Error: Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:26)\r\nLicensed under GNU GPL v2\r\nFor bug reports, read\r\n\thttp://openocd.org/doc/doxygen/bugs.html\r\n\n\tat c:\Users\Tobe\.vscode\extensions\espressif.esp-idf-extension-1.8.1\dist\extension.js:2:1424988\n\tat ChildProcess.exithandler (node:child_process:415:7)\n\tat ChildProcess.emit (node:events:519:28)\n\tat maybeClose (node:internal/child_process:1105:16)\n\tat ChildProcess._handle.onexit (node:internal/child_process:305:5)","level":"error","timestamp":"2024-09-28T02:59:09.670Z"}
Description
esp@681d5ae3abf2:/workspaces/blink$ whoami
esp
esp@681d5ae3abf2:/workspaces/blink$ ls test
ls: cannot access 'test': No such file or directory
esp@681d5ae3abf2:/workspaces/blink$ touch test
esp@681d5ae3abf2:/workspaces/blink$ ls -l test
-rwxrwxrwx 1 ubuntu ubuntu 0 Sep 28 04:22 test
Any ideas or advice are appreciated.
Debug Message
Other Steps to Reproduce
I have reproduced the error on four different machines, all running Windows 11, two with fresh installs of VS code, VS code C++ tools, WSL, and extensions.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: