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

JSON.stringify is not safe for circular objects #6761

Closed
3 tasks done
mrmcduff opened this issue Jan 25, 2019 · 0 comments
Closed
3 tasks done

JSON.stringify is not safe for circular objects #6761

mrmcduff opened this issue Jan 25, 2019 · 0 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@mrmcduff
Copy link
Contributor

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 there are any. (N/A)
  • 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.

Using the latest Master and the provided sample data, I was getting a repeated crash at https://github.com/apache/incubator-superset/blob/master/superset/assets/src/explore/exploreUtils.js#L74
when creating a Time-series table immediately upon clicking "run query".

The crash in question is a circular-JSON error for JSON.stringify. Drilling down into the JSON in question, it absolutely is circular. Besides fixing this particular data that is being input, we should not use JSON.stringify on anything we aren't 100% sure of the shape of, since this error is relatively easy to create.

Superset version

Master

Expected results

Display Time Series

Actual results

Crash

Steps to reproduce

  1. Deploy with Sample data.
  2. Create new chart (suggested: use Birth Names)
  3. For the time-series column options, choose "Spark Line"

screen shot 2019-01-25 at 3 50 16 pm

  1. Run query. (Click button in top left)
  2. Crash.

screen shot 2019-01-25 at 3 51 01 pm

Stacktrace

Uncaught TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at getExploreLongUrl (exploreUtils.js?2c11:74)
    at ProxyComponent.addHistory (ExploreViewContainer.jsx?2c1c:237)
    at ProxyComponent.addHistory (react-hot-loader.development.js?c2cb:693)
    at ProxyComponent.onQuery (ExploreViewContainer.jsx?2c1c:162)
    at ProxyComponent.onQuery (react-hot-loader.development.js?c2cb:693)
    at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:199)
    at invokeGuardedCallback (react-dom.development.js?61bb:256)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js?61bb:270)

Upon digging in / debugging, the formData element being parsed at that line is absolutely a circular JSON argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

No branches or pull requests

2 participants