usap-dc-dev / usap-dc-website

repository for usap-dc website. Includes javascript client side app and python/flask server side.
2 stars 0 forks source link

Python Error on GZIP Upload #31

Closed astrong-ldeo closed 7 months ago

astrong-ldeo commented 11 months ago

When trying to create SQL and Readme for submission 601711, get this error message:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request rv = self.dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/web/usap-dc/htdocs/usap.py", line 3062, in curator sql, readme_file = json2sql.json2sql(json_data, uid, curator_id)
File "/web/usap-dc/htdocs/lib/json2sql.py", line 853, in json2sql sql = make_sql(data, id, curator)
File "/web/usap-dc/htdocs/lib/json2sql.py", line 388, in make_sql sql_file_info = get_file_info(id, url, data['upload_directory'], False)
File "/web/usap-dc/htdocs/lib/curatorFunctions.py", line 2784, in get_file_info u_file_size = get_uncompressed_size(path_name)
File "/web/usap-dc/htdocs/lib/curatorFunctions.py", line 2655, in get_uncompressed_size fileobj.seek(-8, 2) io.UnsupportedOperation: can't do nonzero end-relative seeks
astrong-ldeo commented 11 months ago

May just have to read the file as a binary file instead of regular text file. Will look into other solutions.

sicordero commented 10 months ago

New dataset submission (601718) with this issue - is there currently a workaround?

image

astrong-ldeo commented 10 months ago

Yes, extract the files and upload them in another format. Regular ZIP works fine.

astrong-ldeo commented 8 months ago

Testing fix in dev. PR #39

astrong-ldeo commented 8 months ago

Merged, so I'll close after some confirmation from others that it's working with real prod data sets.