superset icon indicating copy to clipboard operation
superset copied to clipboard

upload csv error

Open jiangnight opened this issue 8 years ago • 7 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [*] I have checked the superset logs for python stacktraces and included it here as text if any
  • [*] I have reproduced the issue with at least the latest released version of superset
  • [*] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.27.0

Actual results

when i use upload csv button upload csv some error happen

Sorry, something went wrong
500 - Internal Server Error
Stacktrace
         Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1615, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1632, in finalize_request
    response = self.process_response(response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1858, in process_response
    self.save_session(ctx.session, response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 924, in save_session
    return self.session_interface.save_session(self, session, response)
  File "/usr/local/lib/python3.6/site-packages/flask/sessions.py", line 363, in save_session
    val = self.get_signing_serializer(app).dumps(dict(session))
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 565, in dumps
    payload = want_bytes(self.dump_payload(obj))
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 847, in dump_payload
    json = super(URLSafeSerializerMixin, self).dump_payload(obj)
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 550, in dump_payload
    return want_bytes(self.serializer.dumps(obj))
  File "/usr/local/lib/python3.6/site-packages/flask/sessions.py", line 85, in dumps
    return json.dumps(_tag(value), separators=(',', ':'))
  File "/usr/local/lib/python3.6/site-packages/flask/json.py", line 123, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 399, in dumps
    **kw).encode(obj)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 296, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 378, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.6/site-packages/flask/json.py", line 80, in default
    return _json.JSONEncoder.default(self, o)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 273, in default
    o.__class__.__name__)
TypeError: Object of type PermissionError is not JSON serializable

jiangnight avatar Oct 20 '18 08:10 jiangnight

Same issue. Same Error. Fresh install of the Docker container.

Sorry, something went wrong
500 - Internal Server Error
Stacktrace
         Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1615, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1632, in finalize_request
    response = self.process_response(response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1858, in process_response
    self.save_session(ctx.session, response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 924, in save_session
    return self.session_interface.save_session(self, session, response)
  File "/usr/local/lib/python3.6/site-packages/flask/sessions.py", line 363, in save_session
    val = self.get_signing_serializer(app).dumps(dict(session))
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 565, in dumps
    payload = want_bytes(self.dump_payload(obj))
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 847, in dump_payload
    json = super(URLSafeSerializerMixin, self).dump_payload(obj)
  File "/usr/local/lib/python3.6/site-packages/itsdangerous.py", line 550, in dump_payload
    return want_bytes(self.serializer.dumps(obj))
  File "/usr/local/lib/python3.6/site-packages/flask/sessions.py", line 85, in dumps
    return json.dumps(_tag(value), separators=(',', ':'))
  File "/usr/local/lib/python3.6/site-packages/flask/json.py", line 123, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 399, in dumps
    **kw).encode(obj)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 296, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 378, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.6/site-packages/flask/json.py", line 80, in default
    return _json.JSONEncoder.default(self, o)
  File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 273, in default
    o.__class__.__name__)
TypeError: Object of type PermissionError is not JSON serializable


jamiebono avatar Oct 24 '18 17:10 jamiebono

same here

cnstlungu avatar Oct 25 '18 06:10 cnstlungu

@cnstlungu @jamiebono i also use docker to deploy superset, and i find the User be set as superset in Dockerfile, so it lead to some dir permission denied. so first way you can solve it by

docker exec -ti mysuperset /bin/bash
and
Chmod  777 /usr/local/lib/python3.5/dist-packages/superset

and i find sometimes there will happen other errors because of permission,so i change Dockerfile to let User be root

##dockerfile
USER root

jiangnight avatar Oct 25 '18 06:10 jiangnight

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '19 12:04 stale[bot]

I have the same problem.

superset --version Flask 0.12.4 Python 3.6.8 (default, Apr 25 2019, 21:02:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

TypeError: Object of type PermissionError is not JSON serializable ^C[2019-06-22 22:08:08 -0700] [107316] [INFO] Handling signal: int

devcode2 avatar Jun 23 '19 05:06 devcode2

I have the same Problem Flask 0.12.4 Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] TypeError: Object of type ValueError is not JSON serializable

sandy-ha avatar Aug 02 '19 06:08 sandy-ha

I had same error "TypeError: Object of type PermissionError is not JSON serializable", when I try to upload a csv file. The error is gone after I have started by superset service as root user.

ramarov avatar Aug 03 '19 06:08 ramarov