Closed lwiniwar closed 2 years ago
In GitLab by @JannikaSchaefer on Mar 16, 2022, 14:01
POSThttp://129.206.228.83:5001/exportcsv [HTTP/1.0 500 INTERNAL SERVER ERROR 80ms]
In GitLab by @annachiu7 on Mar 16, 2022, 14:02
Do you still have the permalink?
In GitLab by @JannikaSchaefer on Mar 16, 2022, 14:02
In GitLab by @annachiu7 on Mar 16, 2022, 14:07
This works for me. Is there an error in your browser console?
In GitLab by @annachiu7 on Mar 16, 2022, 14:08
Ahh I overlooked your previous post sorry
Server log output:
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/var/www/pytreedb/webserver/main.py", line 86, in exportcsv
mydb.convert_to_csv(outdir, trees)
File "/var/www/pytreedb/pytreedb/db.py", line 422, in convert_to_csv
df_general_all.to_csv(outdir + '/result_general.csv', index=False)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/pandas/core/generic.py", line 3563, in to_csv
return DataFrameRenderer(formatter).to_csv(
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/pandas/io/formats/format.py", line 1180, in to_csv
csv_formatter.save()
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/pandas/io/formats/csvs.py", line 241, in save
with get_handle(
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/pandas/io/common.py", line 697, in get_handle
check_parent_directory(str(handle))
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/pandas/io/common.py", line 571, in check_parent_directory
raise OSError(fr"Cannot save file into a non-existent directory: '{parent}'")
OSError: Cannot save file into a non-existent directory: 'E:\tmp\csv'
maybe use the tempdir
package to find a temporary directory?
This should work now
Still doesn't work for me (accessing it via browser). The status is "internal server error"
Does it still not work after updating the webserver?
Current error (on webserver side):
- - [29/Mar/2022 09:28:47] "POST /exportcsv HTTP/1.1" 500 -
Traceback (most recent call last):
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/miniconda3/envs/pytreedb/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/var/www/pytreedb/webserver/pytreedb_server/__main__.py", line 109, in exportcsv
mydb.convert_to_csv(outdir, trees)
File "/var/www/pytreedb/pytreedb/db.py", line 588, in convert_to_csv
data = self[trees]
File "/var/www/pytreedb/pytreedb/db.py", line 93, in __getitem__
return list(self.db[key] for key in item)
File "/var/www/pytreedb/pytreedb/db.py", line 93, in <genexpr>
return list(self.db[key] for key in item)
TypeError: list indices must be integers or slices, not dict
I adapted the request method to the lastly changed csv-converting method by Hannah.. It really should work now I hope. @lwiniwar could you plz update the webserver again? thx
webserver updated, seems to work.
In GitLab by @JannikaSchaefer on Mar 16, 2022, 13:11
Nothing happens if I click on the button.