Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes and tighten down file access for file endpoint. #3128

Closed
dnil opened this issue Feb 2, 2022 · 0 comments · Fixed by #3129
Closed

Fix crashes and tighten down file access for file endpoint. #3128

dnil opened this issue Feb 2, 2022 · 0 comments · Fixed by #3129
Assignees
Labels

Comments

@dnil
Copy link
Collaborator

dnil commented Feb 2, 2022

When container mounts to expected fs go down, this can happen:

2022-02-02 14:42:09,150 - scout.server.app - ERROR: Exception on /remote/static [GET] [in /venv/lib/python3.8/site-packages/flask/app.py:1457]
Traceback (most recent call last):
 File "/venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
   response = self.full_dispatch_request()
 File "/venv/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request
   rv = self.handle_user_exception(e)
 File "/venv/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
   return cors_after_request(app.make_response(f(*args, **kwargs)))
 File "/venv/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
   rv = self.dispatch_request()
 File "/venv/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
   return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
 File "/home/worker/app/scout/server/blueprints/alignviewers/views.py", line 72, in remote_static
   if not range_header and (file_path.endswith(".bam") or file_path.endswith(".cram")):
AttributeError: 'NoneType' object has no attribute 'endswith'

It wouldn't hurt adding some checks for if the user is asking for files belonging to cases they should have access to. It would take quite some guessing of case names etc to access, but it might be possible to combine with some other situation where we feel that info is trivial to show. Also worth glitch checking. 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants