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

Internal server when creating Excel file from dataset with a field containing array #2051

Closed
thijsc opened this issue Oct 24, 2017 · 1 comment

Comments

@thijsc
Copy link

thijsc commented Oct 24, 2017

Issue Summary

Internal server when downloading a dataset that contains a field containing an array in Excel format. In our case this field was created using an aggregation query on MongoDB.

Steps to Reproduce

  1. Create a query with a field that contains an array.
  2. Click "Download dataset > Download as Excel file"
  3. The Excel file contains the text {"message": "Internal Server Error"}% and the log on the server tracks this error:
[2017-10-24 14:25:44,407][PID:1468][ERROR][redash] Exception on /api/queries/6/results/128.xlsx [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 477, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/redash/redash.2.0.1.b3080/redash/handlers/base.py", line 27, in dispatch_request
    return super(BaseResource, self).dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 587, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/redash/redash.2.0.1.b3080/redash/permissions.py", line 47, in decorated
    return fn(*args, **kwargs)
  File "/opt/redash/redash.2.0.1.b3080/redash/handlers/query_results.py", line 224, in get
    response = self.make_excel_response(query_result)
  File "/opt/redash/redash.2.0.1.b3080/redash/handlers/query_results.py", line 252, in make_excel_response
    return make_response(query_result.make_excel_content(), 200, headers)
  File "/opt/redash/redash.2.0.1.b3080/redash/models.py", line 720, in make_excel_content
    sheet.write(r + 1, c, row.get(name))
  File "/usr/local/lib/python2.7/dist-packages/xlsxwriter/worksheet.py", line 64, in cell_wrapper
    return method(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/xlsxwriter/worksheet.py", line 431, in write
    raise TypeError("Unsupported type %s in write()" % type(token))

Technical details:

  • Redash Version: 2.0.1+b3080
  • Browser/OS: Safari
  • How did you install Redash: Manually
@arikfr
Copy link
Member

arikfr commented Oct 29, 2017

Fixed in #2060.

@arikfr arikfr closed this as completed Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants