Open Yumin-Sun-00 opened 2 weeks ago
After adding these runArgs
--memory=8g --memory-swap=2g
in devcontainer.json the error messages changes to
[2626 ms] Error: Command failed: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/home/myuser/LFS148-code,target=/workspaces/LFS148-code --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/home/myuser/LFS148-code -l devcontainer.config_file=/home/myuser/LFS148-code/.devcontainer/devcontainer.json -e SHELL=/bin/bash -e EXERCISES=/workspaces/LFS148-code/exercises --privileged --memory=8g --memory-swap=2g --entrypoint /bin/sh -l devcontainer.metadata=[{"customizations":{"vscode":{"settings":{"files.autoSave":"afterDelay","[python]":{"editor.formatOnSave":true},"[dockercompose][yaml]":{"editor.defaultFormatter":"redhat.vscode-yaml","editor.formatOnPaste":true,"editor.formatOnSave":true,"editor.insertSpaces":true,"editor.tabSize":2},"[adoc][markdown]":{"editor.defaultFormatter":"vscode.markdown-language-features","editor.formatOnPaste":true,"editor.formatOnSave":true,"editor.insertSpaces":true,"editor.tabSize":2},"[dockerfile]":{"editor.quickSuggestions":{"strings":true},"editor.defaultFormatter":"ms-azuretools.vscode-docker"},"python.analysis.typeCheckingMode":"strict","python.analysis.autoImportCompletions":true},"extensions":["vscjava.vscode-java-pack","vscjava.vscode-java-dependency","ms-python.vscode-pylance","charliermarsh.ruff","ms-python.isort","ms-python.python","njpwerner.autodocstring","KevinRose.vsc-python-indent","ms-python.black-formatter","usernamehw.errorlens","redhat.vscode-yaml","ms-azuretools.vscode-docker"]}},"containerEnv":{"SHELL":"/bin/bash","EXERCISES":"/workspaces/LFS148-code/exercises"},"overrideCommand":false,"portsAttributes":{"5000":{"label":"Python Flask app"},"5001":{"label":"Python Flask app"},"5432":{"label":"Postgres DB"},"8080":{"label":"Spring Boot Backend app"},"8090":{"label":"Spring Boot Thymeleaf app"},"9090":{"label":"Prometheus UI"},"16686":{"label":"Jaeger UI"}},"forwardPorts":[5000,5001,5432,8080,8090,9090,16686]}] ghcr.io/lftraining/lfs148-code-application:latest -c echo Container started
Hi @Yumin-Sun-00 could you maybe try running Ctrl + Shift + P or Command + Shift + P on MacOS and type Dev Containers: Rebuild and Reopen in Container
?
Hi @JenSeReal
I provision a EC2 instance with Instance type m4.2xlarge
, which means
And I remove my changes and have tried:
Dev Containers: Rebuild and Reopen in Container Dev Containers: Rebuild Without Cache and Reopen in Container
Both returns with exit code 137
.
Hi @JenSeReal
I provision a EC2 instance with Instance type
m4.2xlarge
, which meansAnd I remove my changes and have tried:
Dev Containers: Rebuild and Reopen in Container Dev Containers: Rebuild Without Cache and Reopen in Container
Both returns with
exit code 137
.
Maybe more system informarion of my EC2 instance might helpful?
# cat /proc/meminfo
MemTotal: 32639544 kB
MemFree: 26015840 kB
MemAvailable: 31394256 kB
Buffers: 3924 kB
Cached: 5590628 kB
SwapCached: 0 kB
Active: 1111928 kB
Inactive: 4852000 kB
Active(anon): 2084 kB
Inactive(anon): 393912 kB
Active(file): 1109844 kB
Inactive(file): 4458088 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Hi, I am not sure, if the problem originates from the memory config of your VM instance.
Can you give some more details about your setup. I understood RHEL8. Which version of Docker do you use? Which version of VSCode?
If you use the way Jens has described before, there also is an option "Dev Containers: Show container log" Can you please provide that? This would probably give us more background. Or was the log snippet above the entire log?
If the rebuild step from above did not work, you may want to try to delete the stopped container instance and image directly via docker commands and completely start from scratch.
In general I am not sure if it makes a lot of sense to deploy a VM instance only for this purpose. An complete alternative approach would be to use GitHub Codespaces for doing the lab. Here is a link how to set one up: https://github.com/codespaces/new?skip_quickstart=true&machine=basicLinux32gb&repo=751957128&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json
Here is some general codespace documentation, if this is new for you: https://docs.github.com/en/codespaces
Hi, I am not sure, if the problem originates from the memory config of your VM instance.
Can you give some more details about your setup. I understood RHEL8. Which version of Docker do you use? Which version of VSCode?
If you use the way Jens has described before, there also is an option "Dev Containers: Show container log" Can you please provide that? This would probably give us more background. Or was the log snippet above the entire log?
If the rebuild step from above did not work, you may want to try to delete the stopped container instance and image directly via docker commands and completely start from scratch.
In general I am not sure if it makes a lot of sense to deploy a VM instance only for this purpose. An complete alternative approach would be to use GitHub Codespaces for doing the lab. Here is a link how to set one up: https://github.com/codespaces/new?skip_quickstart=true&machine=basicLinux32gb&repo=751957128&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json
Here is some general codespace documentation, if this is new for you: https://docs.github.com/en/codespaces
Hi @maeddes ,
# docker --version
Docker version 27.3.1, build ce12230
VS Code version: 1.95.2 (user setup)
Dev Containers version: v0.388.0
Delete images and containers I have to keep everything clean before rebuild:
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d2c94e258dcb 18 months ago 13.3kB
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b639d9e02e9c hello-world "/hello" About an hour ago Exited (0) About an hour ago amazing_torvalds
Now: In VS Code, reopen in containers --> exit code 137. Here is the logs:
[1180 ms] Dev Containers 0.388.0 ov.txt
Thanks for providing alternative. I will have a look now.
Hi, I am not sure, if the problem originates from the memory config of your VM instance. Can you give some more details about your setup. I understood RHEL8. Which version of Docker do you use? Which version of VSCode? If you use the way Jens has described before, there also is an option "Dev Containers: Show container log" Can you please provide that? This would probably give us more background. Or was the log snippet above the entire log? If the rebuild step from above did not work, you may want to try to delete the stopped container instance and image directly via docker commands and completely start from scratch. In general I am not sure if it makes a lot of sense to deploy a VM instance only for this purpose. An complete alternative approach would be to use GitHub Codespaces for doing the lab. Here is a link how to set one up: https://github.com/codespaces/new?skip_quickstart=true&machine=basicLinux32gb&repo=751957128&ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json Here is some general codespace documentation, if this is new for you: https://docs.github.com/en/codespaces
Hi @maeddes ,
# docker --version Docker version 27.3.1, build ce12230
VS Code version: 1.95.2 (user setup)
Dev Containers version: v0.388.0
Delete images and containers I have to keep everything clean before rebuild:
# docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest d2c94e258dcb 18 months ago 13.3kB # docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b639d9e02e9c hello-world "/hello" About an hour ago Exited (0) About an hour ago amazing_torvalds
Now: In VS Code, reopen in containers --> exit code 137. Here is the logs:
[1180 ms] Dev Containers 0.388.0 ov.txt
Thanks for providing alternative. I will have a look now.
I found in the logs there is another exit code 128 before exit code 137:
fatal: detected dubious ownership in repository at '/workspaces/LFS148-code' To add an exception for this directory, call:
git config --global --add safe.directory /workspaces/LFS148-code
Do you think this could be the cause?
I think it could be, but I can't verify (yet). We've never seen this issue and we can't reproduce it
You could try to set the save directory in a startup command like this postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}
in devcontainer.json
.
Hi @JenSeReal ,
I have tried different versions of such commands
"initializeCommand": "sudo git config --system --add safe.directory '*'",
"postStartCommand": "sudo git config --system --add safe.directory '*'",
"initializeCommand": "git config --global --add safe.directory /workspaces",
"postStartCommand": "git config --global --add safe.directory /workspaces",
"initializeCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
None of them worked. I currently give up on this, and will try the codespaces as maeddes recommended.
Thanks for your support, I am appreciated on that.
Hi @Yumin-Sun-00
thanks for the updates here. We were still unable to reproduce this behaviour on our end.
If we get the chance, can you let us some details, about the VM and in particular the OS and settings. I would really like to figure this out before more people step into these problems.
many thanks for patience here!
Hi @maeddes
I was also thinking about it is because of VM workstation, therefore at the beginning I provision a ec2 instance to try again.
I think this is more related to Git new security features, that the owner of files must match to the user who perform git operations. I found in github there were/are issues/discussions about this new features, some solutions are proposed. But it seems like there are still people suffering from this.
It sounds like it is about when .gitconfig will be copy pasted from host into the container.
From this perspective, I think it is less relevant to VMs, though at the beginning I indeed had such idea, therefore you see I provisioned a new ec2 instance.
I see 2 options to fix this, however I am not familiar with docker container.
I just roughly say out my opinions, but I do not know whether this is promising.
BTW the codes pace things also not work by me, not sure whether it is because I am using my company laptop....
Have a good day!
π»
You could also maybe try to download the repo as a zip file or to just delete the .git/
folder
You could also maybe try to download the repo as a zip file or to just delete the
.git/
folder
Hey, that is a good idea! I get rid of the exit code 128 now πΆπ€©π₯³
However, it still not work π₯²ππππππππ Here is the log...I am done with this, I have to move on. It is a nice tutorial though that I wish to have a look very long time.
first of all thanks for providing all the feedback here. If we can resolve it we will reach out to you. Sorry we couldn't make it work yet
I can not reopen folder to develop in a container.
Error message: An error occurred setting up the container.
My VM Workstation (Linux client): Memory: 8GB OS: RHEL8