Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

import API not working as expected #17225

Closed
3 tasks done
LeiZhangImo opened this issue Oct 25, 2021 · 1 comment
Closed
3 tasks done

import API not working as expected #17225

LeiZhangImo opened this issue Oct 25, 2021 · 1 comment
Labels
question & help wanted Use Github discussions instead

Comments

@LeiZhangImo
Copy link

/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!

  • I have checked the superset logs for python stacktraces and included it here as text if there are 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.

Additional context

I'm using the Admin user, even after this error occurred the GET /dataset API still working.

@LeiZhangImo
Copy link
Author

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

@geido geido added dataset:import question & help wanted Use Github discussions instead and removed #bug Bug report labels Jan 26, 2022
@apache apache locked and limited conversation to collaborators Feb 2, 2022
@geido geido converted this issue into discussion #18337 Feb 2, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question & help wanted Use Github discussions instead
Projects
None yet
Development

No branches or pull requests

2 participants