Error uploading movie file
Docassemble produces an InternalServerError when trying to upload movie files ".mov" created in quicktime.
Also I am unable to capture this error using the "error action".
I attach a test.txt (contains the yml code) and a .mov file for reproducing.
Tested in both Chrome and Firefox on Mac Os 10.14.4.
InternalServerError: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Log
Traceback (most recent call last): File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/docassemble/webapp/server.py", line 6957, in index process_file(saved_file, temp_file.name, mimetype, extension) File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/docassemble/webapp/server.py", line 2063, in process_file result = subprocess.run(call_array, timeout=120).returncode File "/usr/lib/python3.6/subprocess.py", line 423, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'avconv': 'avconv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception return handler(e) File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/docassemble/webapp/server.py", line 19412, in server_error return index(action_argument={'action': docassemble.base.functions.this_thread.interview.consolidated_metadata['error action'], 'arguments': dict(error_message=orig_errmess)}, refer=['error']) File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/docassemble/webapp/server.py", line 6957, in index process_file(saved_file, temp_file.name, mimetype, extension) File "/usr/share/docassemble/local3.6/lib/python3.6/site-packages/docassemble/webapp/server.py", line 2063, in process_file result = subprocess.run(call_array, timeout=120).returncode File "/usr/lib/python3.6/subprocess.py", line 423, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'avconv': 'avconv'
https://user-images.githubusercontent.com/13977358/104760796-30ad3000-5762-11eb-83ff-63f71ea4f00b.mov
Oops, sorry about that. Try setting the following in your Configuration:
avconv: ffmpeg
Thanks this works! However, I wonder why the error handling did not catch this. I was expecting to see my custom error page. I have a similar issue when user uploads to large files. This results in the nginx error: 413 Request Entity Too Large. Can this be captured using a custom error message?
Answered my own question. It is already implemented as of version 1.1.109. I was on an older version. A related question is whether this message can be altered to other languages?
Not all errors can be trapped by the custom error page. "Request Entity Too Large" is an error raised by the NGINX web server that steps in to protect the Python application from receiving potentially harmful data.
The error action effectively displays a question, and there are a lot of ways that you can get a question to display in different languages. See https://docassemble.org/docs/language.html. Some error messages are translatable using the "system phrases" translation system. https://docassemble.org/docs/admin.html#translate However many error messages emerge from the depths of the Python code and only intended to be read by developers, so they are not translated.
Closing this issue due to inactivity. Feel free to reopen if there are further issues.