docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 117 forks source link

Error when trying to run Mesosphere Universe #733

Closed ghost closed 6 years ago

ghost commented 8 years ago

Expected behavior

Docker start container correctly.

Actual behavior

I build dcos universe under my mac os. I clone the repo from https://github.com/mesosphere/universe and build step by step following the instructions from the doc. When execute sudo make local-universe, I get this error:

Start docker registry.
6c8f1234b906e0452748bf92633e6840c031dffccd621568f6c20ae096aed008
docker: Error response from daemon: Mounts denied: { errno = [EACCES]; call = getattrlist; label = /private/tmp/tmpy3cv_fo8/registry }.
Traceback (most recent call last):
  File "/Users/chrisrc/Dcos/dist/universe/docker/local-universe/../../scripts/local-universe.py", line 314, in <module>
    sys.exit(main())
  File "/Users/chrisrc/Dcos/dist/universe/docker/local-universe/../../scripts/local-universe.py", line 70, in main
    run_docker_registry(dir_path / pathlib.Path("registry")):
  File "/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/Users/chrisrc/Dcos/dist/universe/docker/local-universe/../../scripts/local-universe.py", line 189, in run_docker_registry
    subprocess.check_call(command)
  File "/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '-d', '-p', '5000:5000', '--name', 'registry', '-v', '/tmp/tmpy3cv_fo8/registry:/var/lib/registry', 'registry:2.4.0']' returned non-zero exit status 125
make: *** [local-universe] Error 1

Here is the diagnostic info with ID: AEAB95A6-D4F9-4640-81E8-3901BB0800BE

Docker for Mac: version: 1.12.1-beta26.1 (12c3e63)
OS X: version 10.11.6 (build: 15G1004)
logs: /tmp/AEAB95A6-D4F9-4640-81E8-3901BB0800BE/20161003-164242.tar.gz
[OK]     docker-cli
[OK]     virtualization kern.hv_support
[OK]     menubar
[OK]     moby-syslog
[OK]     dns
[OK]     disk
[OK]     system
[OK]     app
[OK]     osxfs
[OK]     virtualization VT-X
[OK]     db
[OK]     slirp
[OK]     logs
[OK]     env
[OK]     vmnetd
[OK]     moby-console
[OK]     moby
[OK]     driver.amd64-linux
dsheets commented 8 years ago

Thanks for your report! There are a number of issues that you are encountering that should each be addressed:

  1. Docker for Mac does not require sudo and does not create files as root. Mesosphere Universe explicitly checks for root in scripts/local-universe.py and fails if the euid is not 0. This likely needs to be corrected in Universe.
  2. Docker for Mac should detect that the user is running as root and warn that this is not necessary and may cause issues.
  3. Docker for Mac should not produce the low-level getattrlist error under any circumstances.
  4. Docker for Mac cannot currently share paths with non-terminal symlinks (#412).

I've opened issues to track 2 and 3. 4 is already tracked and 1 needs to be reported to Mesosphere Universe.

ebridger commented 8 years ago

Hopefully this is the correct issue. I'm running docker for mac beta version 1.12.2 API 1.24. docker run -t --rm -v /Applications/MAMP/htdocs/:/htdocs alpine sh -c "ls -la /htdocs" Gives the error:

docker: Error response from daemon: Mounts denied: The path /Applications/MAMP/htdocs/ is not shared from OS X and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> File Sharing. See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info. ..

What used to work in version 1.11.1, back in July also gives the same error. docker run -t --rm -v /Mac/Applications/MAMP/htdocs/:/htdocs alpine sh -c "ls -la /htdocs"

Trying to fix via Docker -> Preferences -> File Sharing also gives an error.

Path / is reserved by Docker.

HTH to get this issue resolved. My motive is have the same run commands on OS X and linux.

dsheets commented 8 years ago

@ebridger your issue is different from the one in this ticket. /Mac has been removed and will no longer work. To share /Applications/MAMP/htdocs, I recommend sharing exactly that path from :whale: ➡️ Preferences ➡️ File Sharing. If you still have difficulties with file sharing, please open a new issue.

ebridger commented 8 years ago

@dsheets. Thanks. See #811

xiaods commented 7 years ago
$ minimesos 
docker: Error response from daemon: Mounts denied: 
The path /usr/local/bin/docker
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
..
dsheets commented 7 years ago

Hi @xiaods, your issue is different from the one in this ticket. The docker executable is not at /usr/local/bin/docker (that path does not exist) in the Docker for Mac VM -- it is instead located at /usr/bin/docker. This appears to be an issue with the minimesos tool. Please modify your configuration or report this issue to the minimesos developers. If you still believe this to be an issue with Docker for Mac, please open a new issue with details of what you are running and include your diagnostic ID from :whale: ➡️ Diagnose & Feedback... ➡️ Diagnose & Upload. Thanks!

xiaods commented 7 years ago

@dsheets thanks for your reminder. create it again.

ghost commented 7 years ago

I found another way to use DC/OS universe, and this issue was not import to me. But I modified the universe build script and disable sudo check on Mac. There still have problem:

docker: Error response from daemon: Mounts denied: or-mac/osxfs/#namespaces for more info.
.
l63qb75wt4qhvc0000gn/T/tmpt8se1gcw/registry
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.

The tmp path was changed on every build, so I can not specify it before build. Maybe this is still a problem of Universe, I will commit an issue there.

samoht commented 7 years ago

Closing the issue now as the original issue has been fixed. I am not sure what we can do about randomly generated paths to share, maybe try to share the parent directory?

yallop commented 7 years ago

I'm reopening this, since we believe that the EACCES issue is not yet fixed.

yuchaoran2011 commented 7 years ago

Just encountered the same error on Docker for Mac Version 1.13.1 (15353) when building DC/OS universe. Would appreciate it if someone working on this ticket can share some update.

dsheets commented 7 years ago

@yuchaoran2011 most of the major issues are fixed on the Docker side. There may still be issues with Universe assuming sudo is required and with unhelpful permissions error messages from Docker for Mac. Could you be more specific about exactly what you are executing and what error you get? It would also be helpful to provide the permissions of the directories you are trying to share and the list of exported directories from :whale: ➡️ Preferences... ➡️ File Sharing. Thanks!

yuchaoran2011 commented 7 years ago

Thanks @dsheets for the quick reply!

I executed the following command: sudo make local-universe under universe/docker/local-universe.

The error message was:

sudo make local-universe rm -rf certs && \ rm -f local-universe.tar.gz || 0 python3 /Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py \ --repository /Users/cyu/OSS/universe/docker/local-universe/../../repo/packages/ \ --include="marathon-lb,zeppelin" && \ docker save -o local-universe.tar mesosphere/universe:latest && \ gzip local-universe.tar Start docker registry. 436f6f9a5c5fcb49e300c7aa40b493019d7e0cc916b7ba4bad2fbc5bc166e020 docker: Error response from daemon: Mounts denied: { errno = [EACCES]; call = getattrlist; label = /private/tmp/tmpo7euiq7l/registry }. Traceback (most recent call last): File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 347, in sys.exit(main()) File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 68, in main run_docker_registry(dir_path / pathlib.Path("registry")): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 82, in enter return next(self.gen) File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 204, in run_docker_registry subprocess.check_call(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['docker', 'run', '-d', '-p', '5000:5000', '--name', 'registry', '-v', '/tmp/tmpo7euiq7l/registry:/var/lib/registry', 'registry:2.4.1']' returned non-zero exit status 125. make: *** [local-universe] Error 1

My list of exported directories in Docker "File Sharing" tab are: /Users, /Volumes, /tmp, /private. The directory I want to share is under /Users.

dsheets commented 7 years ago

Hi @yuchaoran2011, you are running into (1) from https://github.com/docker/for-mac/issues/733#issuecomment-252889214:

Docker for Mac does not require sudo and does not create files as root. Mesosphere Universe explicitly checks for root in scripts/local-universe.py and fails if the euid is not 0. This likely needs to be corrected in Universe.

Could you please try disabling the scripts/local-universe.py check and running make local-universe without sudo?

yuchaoran2011 commented 7 years ago

That's not working for me unfortunately. I disabled the root check and ran command without sudo. Then I got the following error message:

$ make local-universe rm -rf certs && \ rm -f local-universe.tar.gz || 0 python3 /Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py \ --repository /Users/cyu/OSS/universe/docker/local-universe/../../repo/packages/ \ --include="marathon-lb,zeppelin" && \ docker save -o local-universe.tar mesosphere/universe:latest && \ gzip local-universe.tar Start docker registry. 0d8be149c8928725b7809ec3e40d5a23a1f3fb7263ec7119dc994fe83e2a6e3b docker: Error response from daemon: Mounts denied: or-mac/osxfs/#namespaces for more info. . s8pnp350h1ndtw0000gn/T/tmpx13yftd7/registry is not shared from OS X and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> File Sharing. See https://docs.docker.com/docker-f. Traceback (most recent call last): File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 347, in sys.exit(main()) File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 68, in main run_docker_registry(dir_path / pathlib.Path("registry")): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 82, in enter return next(self.gen) File "/Users/cyu/OSS/universe/docker/local-universe/../../scripts/local-universe.py", line 204, in run_docker_registry subprocess.check_call(command) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['docker', 'run', '-d', '-p', '5000:5000', '--name', 'registry', '-v', '/var/folders/7k/mv0jws6j7ws8pnp350h1ndtw0000gn/T/tmpx13yftd7/registry:/var/lib/registry', 'registry:2.4.1']' returned non-zero exit status 125. make: *** [local-universe] Error 1

This does seem a Mac-specific bug, because I was able to build on Ubuntu without problems.

dsheets commented 7 years ago

@yuchaoran2011 I believe you need to export /var/folders from :whale: ➡️ Preferences... ➡️ File Sharing.

friism commented 7 years ago

@yuchaoran2011 did you have a chance to try @dsheets' suggestion?

bneil commented 7 years ago

I actually had the same issue, I went ahead and disabled sudo as per the above suggestions. My Preferences -> File Sharing already had /private set - so /private/var/folders would have been redundant.

My current File Sharing setup:

/Users
/Volumes
/tmp
/private

Last error:

Bens-MacBook-Pro:local-universe bneil$ make local-universe
rm -rf certs &&                                                 \
        rm -f local-universe.tar.gz || 0
python3 /Users/bneil/src/mesos/universe/docker/local-universe/../../scripts/local-universe.py                   \
                --repository /Users/bneil/src/mesos/universe/docker/local-universe/../../repo/packages/ \
                --include="kafka,confluent-kafka,jenkins,elasticsearch" &&                                                      \
        docker save -o local-universe.tar mesosphere/universe:latest &&         \
        gzip local-universe.tar
Start docker registry.
665b10373261ce0ddebbb5de7a23d402b21983f771d25f49e4e1069af7a44528
docker: Error response from daemon: Mounts denied: or-mac/osxfs/#namespaces for more info.
.
q25l17ytv6g8n00000gn/T/tmp2zxkqvbf/registry
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-f.
Traceback (most recent call last):
  File "/Users/bneil/src/mesos/universe/docker/local-universe/../../scripts/local-universe.py", line 385, in <module>
    sys.exit(main())
  File "/Users/bneil/src/mesos/universe/docker/local-universe/../../scripts/local-universe.py", line 83, in main
    run_docker_registry(dir_path / pathlib.Path("registry")):
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 82, in __enter__
    return next(self.gen)
  File "/Users/bneil/src/mesos/universe/docker/local-universe/../../scripts/local-universe.py", line 234, in run_docker_registry
    subprocess.check_call(command)
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '-d', '-p', '5000:5000', '--name', 'registry', '-v', '/var/folders/hh/0qm8r5h97kq25l17ytv6g8n00000gn/T/tmp2zxkqvbf/registry:/var/lib/registry', 'registry:2.4.1']' returned non-zero exit status 125.
make: *** [local-universe] Error 1

I'll keep messing with the local-universe install script and see what I can do in the interim

dsheets commented 7 years ago

Hi @bneil, as described above, I think you'll need to export /var/folders from File Sharing as well. Unfortunately, the UI for this is not at all obvious as the Finder directory picker insists on resolving symlinks so the only way to do it is to select the line in the GUI list after the last entry and then click on it again to manually edit it and type in /var/folders. I've added a note to our internal issue regarding the usability of this feature.

docker-robott commented 6 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott commented 3 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked