question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker mount problem on MAC

See original GitHub issue

Output from a step is saved to a folder which by default is not allowed to be mounted by Docker. The folder is /var/folders. Default configuration includes: /Users, /Volumes, /private, /tmp. If add it manually in Docker preferences all works fine.

To run the test: cwl-runner --debug workflow.cwl job.yml Link to testing example: https://github.com/michael-kotliar/cwl_sandbox/tree/master/mac_docker_fail

Part from the log:

[job copy_2] /var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpuEpjSV$ docker \
    run \
    -i \
    --volume=/var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmptNfjZl/./empty_copy.txt:/private/var/lib/cwl/stgcce3847f-a49b-4279-b1b1-0d5366ac8b4e/empty_copy.txt:ro \
    --volume=/private/var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpuEpjSV:/private/var/spool/cwl:rw \
    --volume=/private/var/folders/sd/41rg42_16q72_2yzl_vvgsbw0000gn/T/tmpxbsJsT:/tmp:rw \
    --workdir=/private/var/spool/cwl \
    --read-only=true \
    --user=501 \
    --rm \
    --env=TMPDIR=/tmp \
    --env=HOME=/private/var/spool/cwl \
    ubuntu \
    cp \
    /private/var/lib/cwl/stgcce3847f-a49b-4279-b1b1-0d5366ac8b4e/empty_copy.txt \
    empty_copy_copy.txt
docker: Error response from daemon: Mounts denied: cker-for-mac/osxfs/#namespaces for more info.
.
l_vvgsbw0000gn/T/tmptNfjZl/./empty_copy.txt
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/do.
ERRO[0000] error getting events from daemon: net/http: request canceled 

Docker version:

Client:
 Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   60ccb22
 Built:        Thu Feb 23 10:40:59 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 07:52:04 2017
 OS/Arch:      linux/amd64
 Experimental: true

cwl-runner version: 1.0.20170224141733

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
denis-yuencommented, Mar 9, 2017

This sounds similar to something we encountered. There’s a possible workaround at the bottom of https://dockstore.org/docs/faq

Docker behaves a bit differently on a mac than on a typical ubuntu machine. By default the only shared > volumes are /Users, /Volumes, /tmp, and /private. Note that /var is not a shared directory (and can’t be > set as one). CWLtool uses your TMPDIR (the env variable) to setup volumes with docker, which on a Mac can default to a subdirectory of /var. In order to get CWLtool working on your mac, you need to set your TMPDIR to be under one of the shared volumes in Docker for Mac. You can do this by doing something similar to the following:

export TMPDIR=/tmp/docker_tmp
0reactions
wltrimblcommented, Aug 24, 2018

I’m getting this error for certain data sources on OSX.

Expected Behavior

Toy workflow to download a file using http and display it using a docker image.

Actual Behavior

Fails with osx-specific error, related to Issue #328 and #812;

The path /var/folders/2g/k5ylcjt57_d4bqw352_flw740000gn/T/tmpaeCr3G is not shared from OS X and is not known to Docker.

input file is downloaded and staged in

/var/folders/2g/k5ylcjt57_d4bqw352_flw740000gn/T/tmpaeCr3G

but docker needs this to be prepended with /private on some OSX systems.

The remedy in Issue #328

export TMPDIR="/private${TMPDIR}" 

makes the workflow complete, and it works on ubuntu.

Workflow Code

cat > cat.cwl <<"EOF"
#!/usr/bin/env cwl-runner --debug
cwlVersion: cwl:v1.0
class: CommandLineTool
baseCommand: cat
hints:
  - class: DockerRequirement
    dockerPull: ubuntu:16.04
inputs:
  - id: input_file
    type: File
    inputBinding:
      position: 1
      valueFrom: $(inputs.input_file)
outputs: []
EOF

cat > cat-job.yml <<"EOF"
cwlVersion: cwl:v1.0
input_file:
  class: File
  location: "https://raw.githubusercontent.com/common-workflow-language/cwltool/master/README.rst"
  basename: README.Rst
EOF

Output

cwl-runner cat.cwl cat-job.yml

/Users/username/anaconda3/envs/python2/bin/cwl-runner 1.0.20180822145714
Resolved 'cat.cwl' to 'file:///Users/username/ks/cat.cwl'
[job cat.cwl] /private/tmp/docker_tmpZhORn3$ docker \
    run \
    -i \
    --volume=/private/tmp/docker_tmpZhORn3:/var/spool/cwl:rw \
    --volume=/private/var/folders/2g/k5ylcjt57_d4bqw352_flw740000gn/T/tmp2wE_eI:/tmp:rw \
    --volume=/var/folders/2g/k5ylcjt57_d4bqw352_flw740000gn/T/tmpaeCr3G:/var/lib/cwl/stg5c087dc6-b021-4e62-8adb-9198787d0626/README.Rst:ro \
    --workdir=/var/spool/cwl \
    --read-only=true \
    --user=501:20 \
    --rm \
    --env=TMPDIR=/tmp \
    --env=HOME=/var/spool/cwl \
    ubuntu:16.04 \
    cat
docker: Error response from daemon: Mounts denied: 
The path /var/folders/2g/k5ylcjt57_d4bqw352_flw740000gn/T/tmpaeCr3G
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.
.
time="2018-08-24T09:38:20-05:00" level=error msg="error waiting for container: context canceled"
[job cat.cwl] completed permanentFail
Final process status is permanentFail
```

## Your Environment
* cwltool version: 
cwltool 1.0.20180822145714
OSX 10.13.6
Read more comments on GitHub >

github_iconTop Results From Across the Web

mac docker volume mount using osxfs not working
One way of troubleshoot this kind of issues is to volume mount the root of the linux VM used by Docker for mac...
Read more >
host_mnt volume mount problem on Mac in the latest version ...
I have tried with the latest version of Docker Desktop; I have tried disabling enabled experimental features; I have uploaded Diagnostics ...
Read more >
Not able to mount /usr/local/var from host using Docker ...
I have a folder at /usr/local/var/postgresql@13 . This is the derfault path for the datafile when installing Postgres using homebrew.
Read more >
Fixing Mount Denied Error Docker for Mac V2 for /var/folders
Fixing the 'Mounts denied' error in Docker for Mac v2.2.3 ... I recently had a problem with my former MacBook and so I...
Read more >
Performance tuning for volume mounts (shared filesystems)
With Docker distributions now available for an increasing number of platforms, including macOS and Windows, generalizing mount semantics during container ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found