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

500 Internal Server Error when uploading after the auto-stop timer has expired #1254

Open
whew opened this issue Dec 18, 2020 · 2 comments · May be fixed by #1356
Open

500 Internal Server Error when uploading after the auto-stop timer has expired #1254

whew opened this issue Dec 18, 2020 · 2 comments · May be fixed by #1356
Labels

Comments

@whew
Copy link
Contributor

whew commented Dec 18, 2020

  1. Create a receive-mode Onionshare instance with an auto-stop timer
  2. Start uploading a large file
  3. Wait until the auto-stop timer expires (and the large file is still uploading)
  4. Disable JavaScript and upload any file
  5. 500 Internal Server Error
$ /Volumes/OnionShare/OnionShare.app/Contents/MacOS/OnionShare 
OnionShare 2.3.dev2 | https://onionshare.org/
 * Running on http://127.0.0.1:17604/ (Press CTRL+C to quit)
Dec 18, 01:50am: Upload of total size 1.5 GiB is starting
=> 28.0 MiB big.iso          [2020-12-18 01:53:10,123] ERROR in app: Exception on /upload [POST]
Traceback (most recent call last):
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/onionshare_cli/web/receive_mode.py", line 77, in upload
    files = request.files.getlist("file[]")
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/local.py", line 347, in __getattr__
    return getattr(self._get_current_object(), name)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/utils.py", line 90, in __get__
    value = self.func(obj)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/wrappers/base_request.py", line 514, in files
    self._load_form_data()
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/flask/wrappers.py", line 88, in _load_form_data
    RequestBase._load_form_data(self)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/wrappers/base_request.py", line 318, in _load_form_data
    data = parser.parse(
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 232, in parse
    return parse_func(self, stream, mimetype, content_length, options)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 131, in wrapper
    return f(self, stream, *args, **kwargs)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 253, in _parse_multipart
    form, files = parser.parse(stream, boundary, content_length)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 584, in parse
    return self.cls(form), self.cls(files)
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/datastructures.py", line 419, in __init__
    for key, value in mapping or ():
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 582, in <genexpr>
    form = (p[1] for p in formstream if p[0] == "form")
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 542, in parse_parts
    filename, container = self.start_file_streaming(
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/werkzeug/formparser.py", line 404, in start_file_streaming
    container = self.stream_factory(
  File "/Volumes/OnionShare/OnionShare.app/Contents/Resources/app_packages/onionshare_cli/web/receive_mode.py", line 394, in _get_file_stream
    if not self.told_gui_about_request:
AttributeError: 'ReceiveModeRequest' object has no attribute 'told_gui_about_request'
127.0.0.1 - - [18/Dec/2020 01:53:10] "POST /upload HTTP/1.1" 500 -

Also occurs on Linux.

@mig5 mig5 added the bug label Dec 18, 2020
@mig5
Copy link
Collaborator

mig5 commented May 3, 2021

Relates to #936 and #1340

@mig5
Copy link
Collaborator

mig5 commented May 11, 2021

We also now have the same for text message uploads and when javascript is disabled.

=> 10.9 MiB large.file          [2021-05-11 15:15:03,224] ERROR in app: Exception on /upload [POST]
Traceback (most recent call last):
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/onionshare_cli/web/receive_mode.py", line 102, in upload
    message_received = request.includes_message
  File "/home/user/git/onionshare/desktop/venv/lib/python3.7/site-packages/werkzeug/local.py", line 347, in __getattr__
    return getattr(self._get_current_object(), name)
AttributeError: 'ReceiveModeRequest' object has no attribute 'includes_message'

I can't find the magic to intercept the Request middleware when the autostop timer has run out. One for someone smarter

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