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

CLI not working inside Private folders #119

Closed juliejsanchez closed 3 years ago

juliejsanchez commented 4 years ago

I want to ask if CLI analysis modules are by designed not to work when running on images under Private folders/collections or is there a setting we can alter for the CLI to work?

I am using the master branch and then started the docker images using devops/deploy.sh start command.

I use admin user and uploaded some image under the admin's Private folder. I wanted to try the analysis modules. But I get this error:

HttpError: HTTP error 401: get http://girder:8080/api/v1/file/5f156a99c7158d7e36922e0d/download
Response text: {"message": "Read access denied for folder 5f156965d21ae4067c015628 (user None).", "type": "access"}
  File "/home/ubuntu/.local/lib/python3.6/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/slicer_cli_web/slicer_cli_web/girder_worker_plugin/direct_docker_run.py", line 73, in __call__
    super(DirectDockerTask, self).__call__(*args, **kwargs)
  File "/opt/girder_worker/girder_worker/docker/tasks/__init__.py", line 273, in __call__
    super(DockerTask, self).__call__(*args, **kwargs)
  File "/opt/girder_worker/girder_worker/task.py", line 151, in __call__
    _t_kwargs = _walk_obj(kwargs, self._maybe_transform_argument)
  File "/opt/girder_worker_utils/girder_worker_utils/__init__.py", line 33, in _walk_obj
    for k, v in six.viewitems(obj)}
  File "/opt/girder_worker_utils/girder_worker_utils/__init__.py", line 33, in <dictcomp>
    for k, v in six.viewitems(obj)}
  File "/opt/girder_worker_utils/girder_worker_utils/__init__.py", line 36, in _walk_obj
    return [_walk_obj(v, func, leaf_condition=leaf_condition) for v in obj]
  File "/opt/girder_worker_utils/girder_worker_utils/__init__.py", line 36, in <listcomp>
    return [_walk_obj(v, func, leaf_condition=leaf_condition) for v in obj]
  File "/opt/girder_worker_utils/girder_worker_utils/__init__.py", line 41, in _walk_obj
    return func(obj)
  File "/opt/girder_worker/girder_worker/docker/tasks/__init__.py", line 236, in _maybe_transform_argument
    arg, task=self, _default_temp_volume=self.request._default_temp_volume)
  File "/opt/girder_worker/girder_worker/task.py", line 141, in _maybe_transform_argument
    return arg.transform(**kwargs)
  File "/opt/girder_worker/girder_worker/docker/transforms/girder.py", line 100, in transform
    self.gc.downloadFile(self._file_id, self._file_path)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/girder_client/__init__.py", line 1203, in downloadFile
    req = self._streamingFileDownload(fileId)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/girder_client/__init__.py", line 1177, in _streamingFileDownload
    return self.sendRestRequest('get', path, stream=True, jsonResp=False)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/girder_client/__init__.py", line 481, in sendRestRequest
    response=result)

This also happens on Private collections.

When running CLI on images under the Public folder, it's ok.

I also tried the non dockerized version, installed the plugins manually and did girder serve. CLI works in all folders/collections regardless of access control settings.

manthey commented 3 years ago

This was fixed in https://github.com/DigitalSlideArchive/HistomicsUI/pull/98