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

Uncaught error when loading an invalid datastack file #1668

Open
dcdenu4 opened this issue Oct 28, 2024 · 1 comment
Open

Uncaught error when loading an invalid datastack file #1668

dcdenu4 opened this issue Oct 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dcdenu4
Copy link
Member

dcdenu4 commented Oct 28, 2024

I accidentally dragged and dropped into an InVEST model form instead of input field. The Workbench froze for a bit but recovered. The error I see is:

[1] [14:50:59.609] [undefined] 10/28/2024 14:50:59  werkzeug           INFO     127.0.0.1 - - [28/Oct/2024 14:50:59] "OPTIONS /api/post_datastack_file HTTP/1.1" 200 -
[1]
[1] [14:51:07.198] [undefined] 10/28/2024 14:51:07  natcap.invest.ui_server ERROR    Exception on /api/post_datastack_file [POST]
[1] Traceback (most recent call last):
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
[1]     response = self.full_dispatch_request()
[1]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
[1]     rv = self.handle_user_exception(e)
[1]          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
[1]     return cors_after_request(app.make_response(f(*args, **kwargs)))
[1]                                                 ^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
[1]     rv = self.dispatch_request()
[1]          ^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\flask\app.py", line 865, in dispatch_request
[1]     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
[1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\natcap\invest\ui_server.py", line 166, in post_datastack_file
[1]     stack_type, stack_info = datastack.get_datastack_info(
[1]                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\natcap\invest\datastack.py", line 214, in get_datastack_info
[1]     return 'logfile', extract_parameters_from_logfile(filepath)
[1]                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[1]   File "C:\Users\ddenu\Workspace\Repositories\venvs\schisto\Lib\site-packages\natcap\invest\datastack.py", line 673, in extract_parameters_from_logfile
[1]     for line in logfile:
[1]   File "<frozen codecs>", line 720, in __next__
[1]   File "<frozen codecs>", line 648, in __next__
[1]   File "<frozen codecs>", line 561, in readline
[1]   File "<frozen codecs>", line 507, in read
[1] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 36: invalid start byte
[1]
[1] [14:51:07.203] [undefined] Error: Unexpected token '<', "<!doctype "... is not valid JSON
@dcdenu4 dcdenu4 added the bug Something isn't working label Oct 28, 2024
@davemfish
Copy link
Contributor

@dcdenu4 what would you say is the bug here? The way the Workbench reacted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants