DigitalSlideArchive / digital_slide_archive

The official deployment of the Digital Slide Archive and HistomicsTK.
https://digitalslidearchive.github.io
Apache License 2.0
108 stars 49 forks source link

Permissions error when using docker-compose on macos #216

Open pearcetm opened 2 years ago

pearcetm commented 2 years ago

Hi, I recently updated my DSA installation to the current version and am trying to use docker-compose to start an instance. I keep getting the following error:

...
Loaded tile source bioformats

Loaded tile source nd2

Loaded plugin "large_image"

Loaded plugin "large_image_annotation"

Loaded plugin "histomicsui"

    self._send_request(method, url, body, headers, encode_chunked)

  File "/.pyenv/versions/3.9.12/lib/python3.9/http/client.py", line 1331, in _send_request

    self.endheaders(body, encode_chunked=encode_chunked)

  File "/.pyenv/versions/3.9.12/lib/python3.9/http/client.py", line 1280, in endheaders

    self._send_output(message_body, encode_chunked=encode_chunked)

  File "/.pyenv/versions/3.9.12/lib/python3.9/http/client.py", line 1040, in _send_output

    self.send(msg)

  File "/.pyenv/versions/3.9.12/lib/python3.9/http/client.py", line 980, in send

    self.connect()

  File "/opt/venv/lib/python3.9/site-packages/docker/transport/unixconn.py", line 30, in connect

    sock.connect(self.unix_socket)

urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

This is similar to a previously closed issue (https://github.com/DigitalSlideArchive/digital_slide_archive/issues/142). Running DSA_USER=$(id -u):$(id -g) docker-compose up as suggested in that thread, but it does not fix the issue.

I am on MacOS Monterey (12.0.1 ) and docker versions are Engine: 20.10.11 Compose: 1.29.2

Any pointers in getting this working again would be appreciated!

pearcetm commented 2 years ago

I discovered that the reason I didn't have this problem previously is that the older version of provision.py I was using did not attempt to create a docker container running HistomicsTK by default. Disabling this behavior in the new version allows the remaining parts of the application to launch successfully.

This does not help solve the problem of how to set user permissions appropriately on MacOS, but it does solve my immediate issue (since I wasn't using that functionality anyway)

andreped commented 1 year ago

@pearcetm Did you manage to get further?

I was trying to connect some WSIs I have locally with DSA, such that I was able to traverse through the images without copying them directly, and visualize them and what not. However, on macOS it seems like I'm only able to add stuff within the docker image, rather than from the local drive. Likely a permission issue requiring some docker group or similar. Not sure.

From the image below, it seems like I am unable to set the Import path to the local data on my macOS user. Perhaps you got further? Uploading images completely from local works fine, only importing through syncing with a drive that fails. Any ideas?

Screenshot 2023-02-16 at 22 07 12
andreped commented 1 year ago

Managed to get it working by making the local path available in the config (see here).

For instance add: - /Users/UserName/Downloads/Images:/opt/Images and then set /opt/Images to the "Import path".