Bug #17597

Saving an empty dashboard resulting in ISE

Added by Tomer Brisker 10 months ago. Updated 9 months ago.

Status:Closed
Priority:Normal
Assigned To:Tomer Brisker
Category:Dashboard
Target version:Team Daniel - iteration 6
Difficulty: Bugzilla link:1334710
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4090
Story points-
Velocity based estimate-
Release1.14.1Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1334710

Description of problem:
after closing all widgets and trying to save the dashboard, user receives a notification saying:

"Failed to save widget positions."
(the console displays err 500)

Version-Release number of selected component (if applicable):
6.2.0 Beta (GA10.1)

How reproducible:
always

Steps to Reproduce:
1. navigate to Dashboard
2. close all widgets
3. try Manage -> Save dashboard

Actual results:
ISE

Expected results:
Dashboard is saved

Additional info:

Associated revisions

Revision c6a25c1c
Added by Tomer Brisker 10 months ago

Fixes #17597 - Prevent error on saving empty dashboard

History

#1 Updated by Dominic Cleal 10 months ago

ISE

On develop this appears to be:

2016-12-07T13:50:33 eadd4670 [app] [I] Started POST "/widgets/save_positions" for 127.0.0.1 at 2016-12-07 13:50:33 +0000
2016-12-07T13:50:33 eadd4670 [app] [I] Processing by DashboardController#save_positions as JSON
2016-12-07T13:50:33 eadd4670 [sql] [D]   ActiveRecord::SessionStore::Session Load (0.1ms)  SELECT  "sessions".* FROM "sessions" WHERE "sessions"."session_id" = ?  ORDER BY "sessions"."id" ASC LIMIT 1  [["session_id", "eadd4670b8f568ef179fbddd98dfe410"]]
2016-12-07T13:50:33 eadd4670 [sql] [D]   User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1  [["id", 24]]
2016-12-07T13:50:33 eadd4670 [app] [D] Setting current user thread-local variable to admin
2016-12-07T13:50:33 eadd4670 [sql] [D]   Setting Load (0.1ms)  SELECT  "settings".* FROM "settings" WHERE "settings"."name" = ?  ORDER BY "settings"."name" ASC LIMIT 1  [["name", "authorize_login_delegation_api"]]
2016-12-07T13:50:33 eadd4670 [sql] [D] String does not start with the prefix 'encrypted-', so Setting::Auth authorize_login_delegation_api was not decrypted
2016-12-07T13:50:33 eadd4670 [sql] [D]   AuthSource Load (0.1ms)  SELECT  "auth_sources".* FROM "auth_sources" WHERE "auth_sources"."id" = ? LIMIT 1  [["id", 1]]
2016-12-07T13:50:33 eadd4670 [app] [W] Failed to save positions
 | NoMethodError: undefined method `each' for nil:NilClass
 | /home/dcleal/code/foreman/foreman/app/controllers/dashboard_controller.rb:58:in `save_positions'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:198:in `process_action'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in `call'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in `call'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /home/dcleal/.rvm/gems/ruby-2.3.0@foreman/gems/rails-observers-0.1.2/lib/rails/observers/action_controller/caching/sweeping.rb:73:in `around'

#2 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/4090 added

#3 Updated by Anonymous 10 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal 10 months ago

  • Release set to 1.14.1

#5 Updated by Daniel Lobato Garcia 9 months ago

  • Target version set to Team Daniel - iteration 6

Also available in: Atom PDF