Failed to start Local Fabric - docker

VSCode Extension IBM Blockchain platfrom , While running the fabric getting this error in Windows:
Error: No such container:
fabricvscodelocalfabric_peer0.org1.example.com [10/23/2019 3:37:43 PM]
[INFO] Error: No such container:
fabricvscodelocalfabric_peer0.org1.example.com [10/23/2019 3:37:43 PM]
[INFO] Error: No such container:
fabricvscodelocalfabric_peer0.org1.example.com [10/23/2019 3:37:44 PM]
[ERROR] Failed to start Local Fabric: Error: Failed to execute command
"cmd" with arguments "/c, start.cmd" return code 1

prerequisites
ensure you have all the correct versions of required software mentioned in the plugin
I had this same problem on Windows 10. Here is how I solved it.
Setup docker and make sure you can run the hello world program
Setup the shared drive with a user with admin authority (I named it
DockerHost) in the Docker Desktop. I could not use my id I log in
with it is Azure and uses a pin or fingerprint.
Ensure the shared drive for docker is accessible to admins or uses who will run docker
Modify the permissions to the folder and all sub directories on C:\Program Files\Docker . I added the user DockerHost and ensured it had all privileges
Uninstall the extension in VSCode
Remove all blockchain extensions under the folder ~/.vscode/extenstions
e.g. ibmblockchain.ibm-blockchain-platform*
remove the folder ~/.fabric-vscode reinstall the extension in VSCode
Run it to test (worked for me)
While trying to figure this out I did a few steps
1). try to run the start.cmd directly from a command prompt saw error
2). try to run the start.cmd from a powershell with admin privileges, saw it worked
3). Beat my head a bit
In my case the problem, could have been solved most likely by just adding and giving all privileges to the user DockerHost and Administrators group to the folder C:\Program Files\Docker and it's sub directories

I ran across same issues on Windows 10, VS Code with IBM Blockchain platform extension. I am new to blockchain and I was following the documentation.
This is how I resolved it:
Error: [INFO] Error: No such container: fabricvscodelocalfabric_peer0.org1.example.com
Under Docker settings I shared my C drive and give Administrator password.
Started Docker as a regular windows user. I got below error:
Error: [INFO] Error response from daemon: Container 0d60c15fb27a2722742402df2b4c40e88a4506ec7e2b37d917da13e10cc09822 is not running
This time restarted windows, and started Docker as an Administrator. I was able to finally start my local fabric successfully:
[SUCCESS] Connected to Local Fabric
Hope this helps someone.

Go to C:\Program Files\Docker, right-click the docker folder, go to permissions, security, Change permissions to full control and click okay and apply. This will allow the fabric environment to run in visual studio code

Related

Failed to launch debug adapter 'coreclr'

I'm trying to attach a remote docker container from Visual Studio 2022, and I'm getting this error. The error says it is permission related but I can run that command via the terminal.
I guess Visual Studio tries to run that command with a different user.
Visual Studio runs on Windows 10
Docker container runs on Ubuntu (Azure VM)
I can be able to see running images on Linux from Visual Studio which means that I correctly set the configuration.
The error is;
Failed to launch debug adapter 'coreclr'.
Unable to find debugger script at '/home/devadmin/.vs-debugger'.
Initialization log:
Determining user folder on remote system...
Checking for existing installation of debugging tools...
Downloading debugger launcher...
Creating debugger installation folder: /home/devadmin/.vs-debugger
Failed: "Command 'mkdir -p '/home/devadmin/.vs-debugger'' failed with code '1'. "
Unable to find debugger script at '/home/devadmin/.vs-debugger'.
Failed: Unable to find debugger script at '/home/devadmin/.vs-debugger'.
The program '[1] CoreServer' has exited with code 4294967295 (0xffffffff).
I tried to attach remote Docker (Linux) process from Windows machine, and I got an error.

Remote-Containers Extension of VS Code not able to execute docker commands

Setup:
Ubuntu 20.04 distro running inside WSL2 (5.4.72-microsoft-standard-WSL2)
VS Code version 1.55.2 installed in Windows
Docker version 19.03.8, build afacb8b7f0 installed in WSL2
docker-compose version 1.29.0, build 07737305 installed in WSL2
Remote-Containers Extension for VS Code v0.166.1 installed locally (I could not find an option to explicitly install this inside WSL2, but I am not sure if this even matters, see below)
Original error:
When I open the command palette and enter Remote-Containers: Rebuild and Reopen in Container, I get the error `The 'docker' command was not found. Make sure Docker is installed' in a pop up window.
What I tried:
Attempt 1
First, I thought that the Remote-Containers extension wants to execute the docker commands inside windows and not WSL2. Since I don't have Docker Desktop installed on Windows, it is impossible to execute docker commands in Windows. So I tried downloading a specific version of the the Remote-Containers extension file from the marketplace v0.165.0 I believe, copying it into the VS extension folder inside WSL2 /home/kevinsuedmersen/.vscode-server/extensions and installing it manually from the VS Code Extension panel. However, this also installed the Remote-Containers extension locally, so probably on Windows. I am not sure if locally means that this extension is available globally, but nevertheless, I am still getting the error that the docker command is not found as explained above.
Attempt 2
I notice that when I open a PowerShell on Windows, I can use the docker daemon inside WSL2 by prepending wsl to all docker commands, e.g. wsl docker run hello-world. So, I went to the VS Code and in settings (Settings > Remote > Containers > Docker Path), I changed the docker path from docker to wsl docker, but then, I got this error Docker Desktop WSL 2 backend required. This is even the case on another laptop, where I actually have Docker Desktop installed and the WSL2 backend enabled.
Attempt 3
I tried changing the docker path in VS code to the full path of the docker socket in WSL2 /var/run/docker.sock, but then I got the error Current user does not have permission to run 'docker'. Try adding the user to the 'docker' group. My current user kevinsuedmersen is already member of the docker group.
Any advice or directions are greatly appreciated.
Answer was given on the GitHub Repo of the VS-Remote-Container Extension here: https://github.com/microsoft/vscode-remote-release/issues/4914

Docker proxy settings in docker toolbox

We are using Windows OS 7 to develop an application using tech stack viz. docker, spring, java8, gradle etc. We have installed the docker toolbox on our machine.
Now the base image is located in our docker repository of our organization. But the docker is not able to identify the host.
We are able to connect to our repository from docker installed on a linux machine. In that case we have made changes in these 2 files viz.
1.
/etc/systemd/system/docker.service.d/daemon.conf
here we have added http_proxy and https_proxy.
2.
/etc/docker/daemon.json
here we have mentioned the host name as
{"insecure-registries":["<host-name>"]}
But we are not able to find these files in docker tool-box in windows 7.
Please let us know how to resolve this issue.
We are getting the following error in dockerBuildImage gradle task currently wherein it is not able to download the base image.
:dockerBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dockerBuildImage'.
> Could not build image: Get https:<host-name>/v2/: x509: certificate signed by unknown authority
Please advise.
The following worked for me in docker toolbox
change the file /var/lib/boot2docker/profile to include following text:
--insecure-registry=<host1-name>
export "NO_PROXY=<host-name>"
export HTTP_PROXY=<value>
export HTTPS_PROXY=<value>
Then restart the docker-machine to make these changes visible.

IBM cloud : Cannot build app

I am working on a windows 10 home so I have a docker toolbox and am using an IBM cloud app service : python-django app. I followed all the instructions given here:
https://console.bluemix.net/docs/apps/tutorials/tutorial_web.html#before-you-begin
I then open it in Pycharm (community edn) and try to build it locally by doing the following :
1)Import the settings.jar file (Given in the developer tools)
2)Tools > IBM Cloud Developer Tools > Build app in release mode
But I get the following error :
Creating image latestpy-django-tools based on Dockerfile-tools...
Building...
OK
Creating a container named 'latestpy-django-tools' from that image...
FAILED
An error Error response from daemon: invalid mode: /app was encountered while creating Docker container 'latestpy-django-tools'.
Please help!!
Kiera.k, on your Win10 system do you have Docker Toolbox or Docker for Windows? IBM Cloud Developer Tools requires Docker for Windows and will not work with Docker Toolbox.
Also, running build with the additional --trace parameter might provide some more details, if you have not already been using that. If you are using Docker for Windows, seeing all the output you get with --trace would be great.

docker VS 2017 - Not able to start container

I am new to docker. I have VS 2017 community edition installed on my machine.
I have installed
Docker for windows
Docker tools for windows.
I created a new ASP Dot net core 2.0 Web API project with 'Enable Docker Support' option enabled.
I was able to build default project but when I start debugging it gave me below error. I can see new image is created using 'docker image list -a' command but VS is unable to start container.
Severity Code Description Project File Line Suppression State
Error Building webapplication9
Creating dockercompose4820272847090409016_webapplication9_1 ...
[1A[2K
Creating dockercompose4820272847090409016_webapplication9_1 ... [31merror[0m
[1B
ERROR: for dockercompose4820272847090409016_webapplication9_1 Cannot start service webapplication9: container be38d8f606526b8957cbce69c30a9cc329ee79e53f6b216e66d0cdc5895f4a14 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell -Command [System.Threading.Thread]::Sleep([System.Threading.Timeout]::Infinite)","User":"ContainerUser","WorkingDirectory":"C:\\app","Environment":{"ASPNETCORE_ENVIRONMENT":"Development","ASPNETCORE_PKG_VERSION":"2.0.3","ASPNETCORE_URLS":"http://+:80","DOTNET_USE_POLLING_FILE_WATCHER":"1","NUGET_FALLBACK_PACKAGES":"c:\\.nuget\\fallbackpackages","NUGET_PACKAGES":"C:\\.nuget\\packages"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
ERROR: for webapplication9 Cannot start service webapplication9: container be38d8f606526b8957cbce69c30a9cc329ee79e53f6b216e66d0cdc5895f4a14 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"CommandLine":"powershell -Command [System.Threading.Thread]::Sleep([System.Threading.Timeout]::Infinite)","User":"ContainerUser","WorkingDirectory":"C:\\app","Environment":{"ASPNETCORE_ENVIRONMENT":"Development","ASPNETCORE_PKG_VERSION":"2.0.3","ASPNETCORE_URLS":"http://+:80","DOTNET_USE_POLLING_FILE_WATCHER":"1","NUGET_FALLBACK_PACKAGES":"c:\\.nuget\\fallbackpackages","NUGET_PACKAGES":"C:\\.nuget\\packages"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}
Encountered errors while bringing up the project..
For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 346
Am I missing any pre-requisite ?

Resources