WebxCT / WebCT

Interactive Web UI for X-ray CT with Real-time Results
https://webct.io
8 stars 0 forks source link

Linux host PermissionError when downloading files #63

Closed WYVERN2742 closed 5 months ago

WYVERN2742 commented 7 months ago

On a Linux server, downloading projections or reconstructions result in a 500 internal server error due to the server not having permission to read the locally created file.

Folder:

wyvern@ARCHFAE ~/P/R/X/w/o/20240425170134.783732 (master)> ls -la
total 488372
drwxr-xr-x 1 wyvern users        38 Apr 25 18:01 .
drwxr-xr-x 1 wyvern users       294 Apr 25 18:01 ..
-------rwx 1 wyvern users 500089190 Apr 25 18:01 reconstruction.tiff

Log:

[DMAN] - Packaging
output/20240425170134.783732/reconstruction.tiff
[DPREP] - Packaging
Using cached reconstruction
[DMAN] - Done!
127.0.0.1 - - [25/Apr/2024 18:01:44] "PUT /sim/download/prep HTTP/1.1" 200 -
{'resource': 'RECON', 'format': 'TIFF_STACK'}
[2024-04-25 18:01:44,196] ERROR in app: Exception on /sim/download/ [GET]
Traceback (most recent call last):
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/home/wyvern/Projects/Research/XCT/webct/webct/blueprints/preview/routes.py", line 106, in getDownload
    return send_file(sim.download.location(resource).absolute(), as_attachment=True,mimetype="data")
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/flask/helpers.py", line 499, in send_file
    return werkzeug.utils.send_file(  # type: ignore[return-value]
  File "/home/wyvern/Projects/Research/XCT/webct/.mamba/envs/webct/lib/python3.10/site-packages/werkzeug/utils.py", line 479, in send_file
    file = open(path, "rb")  # type: ignore