You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/25 23:35:24 UTC
[GitHub] [superset] LeiZhangImo opened a new issue #17225: import API not working as expected
LeiZhangImo opened a new issue #17225:
URL: https://github.com/apache/superset/issues/17225
/api/v1/dataset/import
run into error:
Error: INTERNAL SERVER ERROR
#### How to reproduce the bug
1. Go to swagger/v1 scroll down to post dataset/import
2. Click on 'Try it out'
3. 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` folder
I have changed this: VERSIONED_EXPORT": True in the config.py
4. 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
- browser type and version: Chrome/94.0.4606.61
- superset version: superset docker: apache/superset:1.3.2
- python version: Python 3.8.12
- node.js version: not know
- any feature flags active: connected to aws Anthena
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
### Additional context
I'm using the Admin user, even after this error occurred the GET /dataset API still working.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] LeiZhangImo commented on issue #17225: import API not working as expected
Posted by GitBox <gi...@apache.org>.
LeiZhangImo commented on issue #17225:
URL: https://github.com/apache/superset/issues/17225#issuecomment-952857476
this error is caused by empty 'passwords', after I put some string in the 'passwords' field this bug will be avoided. However, after this, there will be another ERROR:
`
Could not find a valid command to import file
2021-10-27 12:02:45,062:WARNING:superset.views.base:Could not find a valid command to import file
111.18.130.1 - - [27/Oct/2021:12:02:45 +0000] "POST /api/v1/dataset/import/ HTTP/1.0" 422 259 `
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org