This happened to me today when I updated to the latest VS code insiders.
Steps to Reproduce:
Does this issue occur when you try this locally?: I can't test this as I don't have any of the deps installed for this project on my mac, just docker.
Does this issue occur when you try this locally and all extensions are disabled?: N/A
Associated information:
Terminal Output from running task
> Executing task: cd web; ./docker/web/wait-for-postgres.sh dev python ./manage.py runserver_plus 0.0.0.0:8000 <
execvp(3) failed.: No such file or directory
The terminal process terminated with exit code: 1
Press any key to close the terminal.
tasks.json (I use this to start the django services when I don't want debug mode)
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run Server",
"type": "shell",
"command": [
"cd web;",
"./docker/web/wait-for-postgres.sh",
"dev",
"python",
"./manage.py",
"runserver_plus 0.0.0.0:8000"
],
"group": "none",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
}
]
}
I should also note that no matter what the command is it fails with the same error. I tried a python -c "import sys; print(sys.version)"
Here is a very high level overview of the root directory in docker
root@de5e2f5fb2f8:/structureforge# tree --matchdirs web -L 1
web
├── Dockerfile
├── Dockerfile.stage
├── Pipfile
├── Pipfile.lock
├── README.md
├── __pycache__
├── ansible
├── backup_scripts
├── conftest.py
├── core
├── docker
├── docker-compose.yml
├── locale
├── manage.py
├── pytest.ini
├── python_vendor
├── reports
├── restore_db_from_backup.sh
├── stage
├── stations
├── structureforge
├── tasks
└── vendors
And my devcontainer.json
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "Structureforge",
"context": "..",
"service": "forgeweb",
"dockerComposeFile": ["docker-compose.yml"],
"workspaceFolder": "/structureforge",
"extensions": ["ms-python.python"],
"shutdownAction": "stopCompose",
"postCreateCommand": "cd web; pipenv install --dev"
}
I've had to redact parts of the tree because this is a work project, it's also why I can't just direct you at a repository to clone and see if it happens on another machine. :/
@erinxocon Ok, one thing we saw before was that having the wrong shell can cause issues that sound like this. https://github.com/microsoft/vscode-remote-release/issues/220#issuecomment-490374437
One improvement that just landed in insiders is Remote - Containers now pays attention to /etc/passwd so you don't have to set SHELL anymore (#521). I'm wondering if that somehow caused a problem with your container.
Does the shell script have a #!/bin/bash in it? Otherwise it might be using an alternate shell.
//cc: @chrmarti
@Chuxel The script I'm trying to run does indeed have a shebang of /bin/bash
From my global settings in case it matters:
{ ...
"docker.attachShellCommand.linuxContainer": "/bin/bash",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.rightClickBehavior": "copyPaste",
"terminal.external.osxExec": "iTerm2.app",
"terminal.integrated.fontFamily": "'OperatorMonoSSm Nerd Font'",
"terminal.integrated.scrollback": 10000,
"terminal.integrated.fontSize": 15,
...}
I don't have anything overriding it in the remote settings or the workspace settings. I'm also not setting any SHELL command in the docker file I'm using to create the environment.
I should also note that no matter what the command is it fails with the same error. I tried a python -c "import sys; print(sys.version)"
Yeah I missed the above statement in my response as well. What does this give you in the container:
cat /etc/passwd | grep root (changing root for whatever user you are in the container itself)
root@d7227324ec18:/structureforge# cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
I'm on my way home now, but when I get there I am going to try and repro this with a much simpler project and see if it is code or something in my settings somewhere that is changing something. Just so weird, tasks have been working great up until the most recent update!
Sounds good - you can also try to run a super simple task to see if that works. e.g.
{
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
@Chuxel no dice :(
> Executing task: echo Hello <
execvp(3) failed.: No such file or directory
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
Yeah that pretty much means VS Code can't find /bin/bash for some reason -- which is odd if you're able to get into a terminal. What is the base image? python:3?
EDIT: Also, try setting "terminal.integrated.shell.linux": "/bin/bash" in settings.json.
("terminal.integrated.shell.linux" does not change the task's shell.)
Try adding the following to your task:
"options": {
"shell": {
"executable": "/bin/bash"
}
},
(I'm told that "terminal.integrated.shell.linux" should change it too, it just doesn't work for the remote setup currently, we're investigating.)
I can repro with the Ubuntu 18.04 & Git image from Reopen in Container.
@Tyriar getDefaultShellAndArgs is returning powershell.exe on Linux when using containers from Windows. I assume this means on mac it is returning something other than /bin/bash.
Issue is caused by two problems/changes:
getDefaultShellAndArgsFixes coming!
Ya'll are amazing.
Hi, I also encounter this issue. Is there an expected time for the fix to be available in the Insider? Thanks.
We just merged the second part of the fix in. It will be working again in the next insiders build!
Most helpful comment
We just merged the second part of the fix in. It will be working again in the next insiders build!