Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/bin/bash: line 1: /docker/mount.sh: Permission denied on container startup #21

Closed
hughk opened this issue Sep 2, 2022 · 10 comments
Closed
Labels
bug Something isn't working

Comments

@hughk
Copy link

hughk commented Sep 2, 2022

Building the container works. Starting the container fails with the following message:

stable-diffusion-webui-docker-model-1 | + /docker/mount.sh
stable-diffusion-webui-docker-model-1 | /bin/bash: line 1: /docker/mount.sh: Permission denied

Steps to Reproduce

  1. docker compose build
  2. docker compose up --build
  3. [error...]

Hardware / Software:

  • OS: Windows 11/WSL2
  • Docker version
  • GPU: [Nvidia 3090]
  • Docker version: v20.10.17

Additional context
Attempted to add a chmod +x /docker/mount.sh before the command is run in dockerfile, the command does execute but does not improve things. Docker seems to work otherwise.

@hughk hughk added the bug Something isn't working label Sep 2, 2022
@El-Fitz
Copy link

El-Fitz commented Sep 2, 2022

I'm facing the same issue on an AWS EC2 Linux instance. Fixed after running chmod +x ./build/mount.sh from outside the docker container.

@AbdBarho
Copy link
Owner

AbdBarho commented Sep 2, 2022

I have directly updated the executable status in the git index.

@hughk Can you try again from latest master?

Working on a windows machine makes detecting these problems almost impossible.

@AbdBarho AbdBarho added the awaiting-response Waiting for the issuer to respond label Sep 3, 2022
@MiccoHadje
Copy link

I've forked to modify the Shell command in the build to use "//bin/bash" instead of "/bin/bash", which has resolved a similar error for me. On WSL the precedent "/" before the filepath indicates a *nix filepath. After that modification the build was successful for me.

@AbdBarho
Copy link
Owner

AbdBarho commented Sep 3, 2022

what sort of black magic is this?

@MiccoHadje why is this necessary? could you please guide me to some sort of documentation that explains this behaviour?

The bash command is executed within the miniconda container, I would assume that the rules of WSL don't apply / matter anymore?

@MiccoHadje
Copy link

MiccoHadje commented Sep 3, 2022

what sort of black magic is this?

Universal Naming Convention (UNC) is what I believe drives this 'trick'. Here's the Microsoft Docs page that talks about it. While UNC are used to connect to shares typically, it must map out https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats

As to why it was necessary...not real sure. I'm very new to WSL and Docker, so it is most likely user error. Regardless, it works for me :) It was something I saw as a solve for my particular issue on StackOverflow. Here's the link to the comment: https://stackoverflow.com/a/61737743

It appears that my system does not see bash at /bin/bash and kept throwing a 'command not found' error at the Shell call.

@AbdBarho
Copy link
Owner

AbdBarho commented Sep 3, 2022

@MiccoHadje thanks! I will look deeper into it.

One question, did you install docker on windows or inside wsl? and did you run docker on powershell or inside wsl?

It appears that my system does not see bash at /bin/bash and kept throwing a 'command not found' error at the Shell call.

So the error was thrown at this line when building the container?

@hughk
Copy link
Author

hughk commented Sep 3, 2022

have directly updated the executable status in the git index.

@hughk Can you try again from latest master?

I have checked and it seems to have moved past this point. Will close when I have confirmed.

@hughk
Copy link
Author

hughk commented Sep 3, 2022

Thanks, Have confirmed that it is now working as supposed to on Ubuntu 22.04.01/WSL2

@hughk hughk closed this as completed Sep 3, 2022
@MiccoHadje
Copy link

@MiccoHadje thanks! I will look deeper into it.

One question, did you install docker on windows or inside wsl? and did you run docker on powershell or inside wsl?

It appears that my system does not see bash at /bin/bash and kept throwing a 'command not found' error at the Shell call.

So the error was thrown at this line when building the container?

Yes, that is the line the error was thrown on. I installed Docker on Windows, and run Docker from Powershell.

@AbdBarho
Copy link
Owner

AbdBarho commented Sep 3, 2022

@MiccoHadje Ok, I will update the FAQ, its weird that I can't reproduce this problem...

@hughk glad its working!

@AbdBarho AbdBarho removed the awaiting-response Waiting for the issuer to respond label Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants