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

Error when saving a dashboard after editing #24525

Closed
3 tasks done
ya-msh opened this issue Jun 27, 2023 · 9 comments
Closed
3 tasks done

Error when saving a dashboard after editing #24525

ya-msh opened this issue Jun 27, 2023 · 9 comments

Comments

@ya-msh
Copy link

ya-msh commented Jun 27, 2023

When I open a dashboard in "EDIT" mode and make a change, "SAVE" function doesn't work.

How to reproduce the bug

  1. From Home, create a new dashboard
  2. At this time "SAVE" button is unavailable (-> grey)
  3. Do any change (rename title, add a chart or layout element)
  4. "SAVE" button becomes available (-> blue)
  5. Clic on "SAVE" button

Expected results

The modified dashboard is saved and a success message is displayed.

Actual results

Dashboard is not saved and an error message is displayed :
"Sorry, there was an error saving this dashboard: [object Object]"

In Flask logs:

--Logs after "SAVE" in "EDIT DASHBOARD" mode => warning + response code 400
2023-06-26 15:35:26,358:DEBUG:superset.stats_logger:[36m[stats_logger] (incr) DashboardRestApi.put.warning[0m
2023-06-26 15:35:26,358:DEBUG:superset.stats_logger:[36m[stats_logger] (timing) DashboardRestApi.put.time | 6.051858072169125 [0m
2023-06-26 15:35:26,358:INFO:werkzeug:127.0.0.1 - - [26/Jun/2023 15:35:26] "[31m[1mPUT /api/v1/dashboard/1 HTTP/1.1[0m" 400 -

--Logs after renaming title" from "Dashboard properties" panel => success + response code 200
2023-06-26 15:48:22,248:DEBUG:superset.stats_logger:[36m[stats_logger] (incr) DashboardRestApi.put.success[0m
2023-06-26 15:48:22,248:DEBUG:superset.stats_logger:[36m[stats_logger] (timing) DashboardRestApi.put.time | 16.117947991006076 [0m
2023-06-26 15:48:22,249:INFO:werkzeug:127.0.0.1 - - [26/Jun/2023 15:48:22] "PUT /api/v1/dashboard/1 HTTP/1.1" 200 -

Screenshots

Superset_save_dashboard_error

Environment

  • browser type and version: Firefox 102.12.0esr or Edge 114.0.1823.58
  • superset version: Superset 2.1.0
  • python version: Python 3.10.6
  • node.js version: v12.22.9
  • any feature flags active: none

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

Issue occurs only with "EDIT DASHBOARD" mode, after opening an existing dashboard or directly next creation of new dashboard from home.
Some other actions on dashboards work fine:

  • Rename dashboard in "Dashboard properties" panel from home or dashboard list (without "EDIT DASHBOARD" mode)
  • Add a chart to a dashboard (existing or new) in "Save chart" panel
@sfirke
Copy link
Member

sfirke commented Jun 30, 2023

Could be related to #22106 (unsolved)

@roks531
Copy link

roks531 commented Jul 6, 2023

Exactly the same problem. I have it just for one dashboard as I noticed, some of the others I tested work normally.

@roks531
Copy link

roks531 commented Jul 6, 2023

as for me i recreated the dashboard with same charts, same filters, css and deleted the old one, which couldnt be updated in any way (filter updates or edit dashboard name, owner, nothing worked). Visually, functionally the dashboard now works the same as before...I dont know what the root cause of this is, but it happened on an update of apache superset to 2.1.0-dev.

I also looked at the browser console and as it seems there was a PUT problem, but i didnt bother investigating further, as it was faster to recreate the dashboard for me.

Chrome browser logs:

index.js:65 PUT http://domain.com:8088/api/v1/dashboard/12 400 (BAD REQUEST) n @ index.js:65 (anonymous) @ index.js:125 (anonymous) @ index.js:63 (anonymous) @ callApi.ts:180 u @ callApiAndParseWithTimeout.ts:32 request @ SupersetClientClass.ts:202 await in request (async) put @ SupersetClientClass.ts:180 put @ SupersetClient.ts:50 s @ dashboardState.js:399 Promise.then (async) (anonymous) @ dashboardState.js:440 (anonymous) @ index.js:8 (anonymous) @ redux.js:477 overwriteDashboard @ index.jsx:418 X @ button.js:200 l @ react-dom.production.min.js:14 p @ react-dom.production.min.js:14 (anonymous) @ react-dom.production.min.js:14 b @ react-dom.production.min.js:15 ot @ react-dom.production.min.js:52 rt @ react-dom.production.min.js:51 it @ react-dom.production.min.js:52 ft @ react-dom.production.min.js:56 R @ react-dom.production.min.js:287 F @ react-dom.production.min.js:19 Jt @ react-dom.production.min.js:70 Gt @ react-dom.production.min.js:69 t.unstable_runWithPriority @ scheduler.production.min.js:19 Za @ react-dom.production.min.js:122 z @ react-dom.production.min.js:287 $t @ react-dom.production.min.js:68

@ya-msh
Copy link
Author

ya-msh commented Jul 7, 2023

Thanks for your sharing!
Situation is unfortunately worst for me: I have a fresh install of Superset in 2.1.0 and no dashboard can be saved from "EDIT DASHBOARD" mode, even an empty dashboard without charts.
I removed and recreated the metadata database without examples, no change.

Good idea to look at browser log.
I have some warnings like:
Warning: Expected onClicklistener to be a function, instead got a value ofnumber type.

And for the PUT request
Request:
{"certified_by":"","certification_details":"","css":"","dashboard_title":"test","slug":null,"owners":[1],"json_metadata":"{\"color_scheme\":\"\",\"positions\":{\"DASHBOARD_VERSION_KEY\":\"v2\",\"ROOT_ID\":{\"type\":\"ROOT\",\"id\":\"ROOT_ID\",\"children\":[\"GRID_ID\"]},\"GRID_ID\":{\"type\":\"GRID\",\"id\":\"GRID_ID\",\"children\":[],\"parents\":[\"ROOT_ID\"]},\"HEADER_ID\":{\"id\":\"HEADER_ID\",\"type\":\"HEADER\",\"meta\":{\"text\":\"test\"}}},\"refresh_frequency\":0,\"shared_label_colors\":{},\"color_scheme_domain\":[],\"expanded_slices\":{},\"label_colors\":{},\"timed_refresh_immune_slices\":[],\"cross_filters_enabled\":false,\"default_filters\":\"{}\",\"filter_scopes\":{},\"chart_configuration\":{},\"global_chart_configuration\":{}}"}

State: 400 BAD REQUEST
Response:
{"message":{"json_metadata":[{"global_chart_configuration":["Unknown field."]}]}}

@ya-msh
Copy link
Author

ya-msh commented Jul 11, 2023

Encouraging news on this issue!
I investigated on this parameter "global_chart_configuration" in the code, and found it 11 times.
I tested by commenting some lines in following files:

  • No. 105 and No. 106 in superset-frontend/src/dashboard/actions/dashboardInfo.ts
  • No. 399 in superset-frontend/src/dashboard/actions/dashboardState.js
    Changes were immediately compiled by running webpack server.
    Next, dashboard saving in "EDIT DASHBOARD" works fine!

I know it isn't a lasting change because I have no idea of potential side effects… but it is a good workaround for testing purpose (ability to save dashboard is a pretty useful feature :)).
I simply noticed that "Save as" on dashboards doesn't work (with 404 error), however it isn't a critical feature in my case.

Hope it will help to understand and solve root cause…

@timon-sue
Copy link

Any further updates on this? I'm also affected by this bug.

@doctorseus
Copy link

doctorseus commented Aug 16, 2023

Same issue. I believe this is broken on at least 2.1.x releases. It does work on master branch, because it looks like the functionality originally removed (I guess around this activity removing global filters #23216) was put back in and merged with pull #24020.

But I am not sure what the basis of these new 2.1.x releases is, but this stuff missing is certainly affecting these latest "stable" releases.

@ya-msh
Copy link
Author

ya-msh commented Sep 29, 2023

For my part I didn't do anything else since my last message.
The workaround I applied still works fine and I didn't notice any side effects.
Next step is to upgrade to 3.0.0 release.

@rusackas
Copy link
Member

I closed the linked issue (with a lot less conversation than this one) since it's 2.0 specific. Since we no longer support Superset 2.x, I'm tempted to close this one too, but the context here is reasonably recent. Is anyone experiencing this issue in Superset 3.x? Or is anyone willing to open a PR that fixes this for 2.x in case there's some random chance for an opportunistic 2.1.x release (though unlikely)?

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

No branches or pull requests

6 participants