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

create dataset api always get 'The CSRF token is missing' error #17206

Closed
3 tasks done
LeiZhangImo opened this issue Oct 23, 2021 · 5 comments
Closed
3 tasks done

create dataset api always get 'The CSRF token is missing' error #17206

LeiZhangImo opened this issue Oct 23, 2021 · 5 comments
Labels
#bug Bug report

Comments

@LeiZhangImo
Copy link

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to swagger/v1 scroll down to post dataset

  2. Click on 'Try it out'

  3. Input following:
    { "database": 1, "owners": [ 1 ], "schema": "testschema", "table_name": "tenant002" }

  4. See an error in the error log
    { "errors": [ { "message": "400 Bad Request: The CSRF token is missing.", "error_type": "GENERIC_BACKEND_ERROR", "level": "error", "extra": { "issue_codes": [ { "code": 1011, "message": "Issue 1011 - Superset encountered an unexpected error." } ] } } ] }

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.

@jayakrishnankk
Copy link
Contributor

Here is a suggested solution. #10354 (comment)

@LeiZhangImo
Copy link
Author

Here is a suggested solution. #10354 (comment)

Thanks, WTF_CSRF_ENABLED = False works

@LeiZhangImo
Copy link
Author

After I fixed this, I'm running into this error:
#17225
looks like it was trying to parse some files by JSON parser however all the files are in YAML format

@villebro
Copy link
Member

Closing as the original issue is resolved.

@yogeshvjadhav
Copy link

Here is a suggested solution. #10354 (comment)

I did same thing but didn't worked WTF_CSRF_ENABLED = False and restart server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants