dockerized-pytest-course icon indicating copy to clipboard operation
dockerized-pytest-course copied to clipboard

Problem configuring docker during "docker-compose run test sh" command

Open ReddyKilowatt opened this issue 5 years ago • 5 comments

I've been following the LinkedIN video course: "Python Unit Testing with Pytest" and ran into a problem configuring the docker container while running "docker-compose run test sh" which is at the 5:14 mark in the Docker and VS Code (PC) video.

ERROR: Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled","StackTrace":" at Docker.ApiServices.Mounting.FileSharing.<DoShareAsync>d__6.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\Mounting\FileSharing.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Docker.ApiServices.Mounting.FileSharing.<ShareAsync>d__4.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\Mounting\FileSharing.cs:line 47\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Docker.HttpApi.Controllers.FilesharingController.<ShareDirectory>d__2.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.HttpApi\Controllers\FilesharingController.cs:line 21\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"}

ReddyKilowatt avatar May 21 '20 07:05 ReddyKilowatt

Hi @ReddyKilowatt ,

Do you have administrative access of the computer you are using? If so, try running the same command prefixed by sudo:

sudo docker-compose run test sh

coding-geographies avatar May 29 '20 01:05 coding-geographies

Hi,

That’s for Linux.

On Thu, May 28, 2020 at 6:21 PM coding-geographies [email protected] wrote:

Hi @ReddyKilowatt https://github.com/ReddyKilowatt ,

Do you have administrative access of the computer you are using? If so, try running the same command prefixed by sudo:

sudo docker-compose run test sh

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/coding-geographies/dockerized-pytest-course/issues/7#issuecomment-635702329, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACE23D2QMJV63BIKZ6SI7ADRT4EY3ANCNFSM4NGUDAFQ .

ReddyKilowatt avatar May 29 '20 01:05 ReddyKilowatt

It seems you may have an alternate problem.

Try sharing the C: drive in Docker. You may also try restarting docker.

This thread has more information about this: https://stackoverflow.com/a/60814428

coding-geographies avatar May 29 '20 02:05 coding-geographies

Hi @coding-geographies I was following the same course on LinkedIn, I can run docker-compose run test sh but after I opened the container and run pytest I got permission error like below

PermissionError: [Errno 1] Operation not permitted: '/pytest_project/pytest.ini'

yli110-stat697 avatar Jul 05 '22 19:07 yli110-stat697

Oh wow I figured the reason. Check the Stackoverflow post, it was a MacOS Catalina update. Now problem solved. Thank you!

yli110-stat697 avatar Jul 05 '22 19:07 yli110-stat697