aspnetrun / run-aspnetcore-microservices

Microservices on .Net platforms which used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entity Framework Core, CQRS, MediatR, DDD, Vertical and Clean Architecture implementation with using latest features of .NET 8 and C# 12
https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet/?couponCode=JULY24
MIT License
2.55k stars 1.38k forks source link

Error on running docker exec -it catalog-mongo /bin/bash #9

Closed jainashish1711 closed 3 years ago

jainashish1711 commented 3 years ago

@mehmetozkaya I am able to successfully install container for mongo DB and but executing command for mongo DB throws below error.

C:\Users\ashishjain4>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 039ab1536008 mongo "mongod --bind_ip_all" 39 seconds ago Up 36 seconds 0.0.0.0:27017->27017/tcp catalog-mongo

C:\Users\ashishjain4>docker exec -it catalog-mongo /bin/bash

container bce995a3638f836b3ddf864e0bf002c658f5c3901264a444f8b89b0fd6e80f16 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF6F18F9D2B: (caller: 00007FF6F18AE13A) Exception(9) tid(3f4) 80070002 The system cannot find the file specified. CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"/bin/bash","WorkingDirectory":"/","Environment":{"MONGO_DOWNLOAD_SHA256":"d811282527bbdc3266244209ad0971c0d375dbb209bb8eb4ae66ba576b19e9f6","MONGO_DOWNLOAD_URL":"https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-4.4.3-signed.msi","MONGO_VERSION":"4.4.3"},"EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[0,0]}

image

mehmetozkaya commented 3 years ago

Actually it was worked for me but not sure that why its happened. When I checked the official image; https://hub.docker.com/_/mongo

I saw that below part, so could you try with only bash instead of bin/bash

Container shell access and viewing MongoDB logs The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your mongo container:

$ docker exec -it some-mongo bash

jainashish1711 commented 3 years ago

Still having same issue. Please find screenshot below. I am stuck here now.

image @mehmetozkaya

mehmetozkaya commented 3 years ago

I also don't know why it is giving this error but if you can try with fresh test with delete and re-create mongo image and try. If nothing change then it could be network problem that you can't insert your docker image from your computer.

jainashish1711 commented 3 years ago

Thanks for the response. I tried all . may be its with mongo DB something . I will try this out with Sql instead of mongo and creating Catalog DB over there. Although when i replace exec with run i get some different. if you make out of it something. or is it might be due to bin path is not located image

thanks for your support @mehmetozkaya

madhu23rima commented 1 year ago

I ran into the same issue. We need to use mongosh instead of mongo

Found solution here https://stackoverflow.com/questions/73582703/mongo-command-not-found-on-mongodb-6-0-docker-container