This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
import API not working as expected #17225
Labels
question & help wanted
Use Github discussions instead
/api/v1/dataset/import
run into error:
Error: INTERNAL SERVER ERROR
How to reproduce the bug
Go to swagger/v1 scroll down to post dataset/import
Click on 'Try it out'
Input a zip file that I have created the zip file by this:
https://stackoverflow.com/questions/66015739/use-apache-superset-api-to-feed-a-dataset
the original zip was exported from the UI, and I just removed the
database
folderI have changed this: VERSIONED_EXPORT": True in the config.py
See an error in the error log
Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 67, in wraps return f(self, *args, **kwargs) File "/app/superset/views/base_api.py", line 85, in wraps raise ex File "/app/superset/views/base_api.py", line 82, in wraps duration, response = time_function(f, self, *args, **kwargs) File "/app/superset/utils/core.py", line 1464, in time_function response = func(*args, **kwargs) File "/app/superset/utils/log.py", line 242, in wrapper value = f(*args, **kwargs) File "/app/superset/datasets/api.py", line 737, in import_ json.loads(request.form["passwords"]) File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 2021-10-25 23:26:51,045:ERROR:superset.views.base:Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 67, in wraps return f(self, *args, **kwargs) File "/app/superset/views/base_api.py", line 85, in wraps raise ex File "/app/superset/views/base_api.py", line 82, in wraps duration, response = time_function(f, self, *args, **kwargs) File "/app/superset/utils/core.py", line 1464, in time_function response = func(*args, **kwargs) File "/app/superset/utils/log.py", line 242, in wrapper value = f(*args, **kwargs) File "/app/superset/datasets/api.py", line 737, in import_ json.loads(request.form["passwords"]) File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 111.18.130.1 - - [25/Oct/2021:23:26:51 +0000] "POST /api/v1/dataset/import/ HTTP/1.1" 500 240 "http://3.0.35.75:8080/swagger/v1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36"
Expected results
get 200 without error
Environment
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
I'm using the Admin user, even after this error occurred the GET /dataset API still working.
The text was updated successfully, but these errors were encountered: