Bug 1386074

Summary: error saving power settings multiple times on system page: "System access policy not specified"
Product: [Retired] Beaker Reporter: matt jia <mjia>
Component: web UIAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: Dan Callaghan <dcallagh>
Severity: low Docs Contact:
Priority: unspecified    
Version: 23CC: dcallagh, mjia, rjoost
Target Milestone: 24.3Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-30 07:08:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description matt jia 2016-10-18 04:33:16 UTC
Description of problem:

Sometimes I hit 'BAD REQUEST: System access policy not specified' when saving the power settings on the system page.

Version-Release number of selected component (if applicable):

23

How reproducible:

Easy

Steps to Reproduce:
1. click 'Add' button to create a new system on the systems page
2. fill in the essentials first
3. fill in the power settings 
4. click on the "Access Policy" Tab
5. click on the "Power Settings" back to the power setting form
6. update the power settings and save the form

Actual results:

Can't save the form with the error "BAD REQUEST: System access policy not specified"

Expected results:

The form should be saved successfully.

Comment 1 Dan Callaghan 2017-04-20 05:01:52 UTC
Okay, got it...

The steps to reproduce are actually shorter:

1. Add a new system, fill out arch and lab controller on Essential tab
2. Go to power settings tab and fill in some settings, click Save Changes
<-- this step works, but the server response has "id": null which now tricks Backbone into thinking the system model isNew()
3. Change the power settings and Save Changes again
<-- this step breaks, because Backbone tries to POST the entire model which does not include some necessary attributes because our JSON model for system is an ugly mess

We are actually returning bogus "id" values even when they are not null -- it is using the id of the power row instead of the system row, although it doesn't affect anything normally since we identify systems by FQDN in the API instead of by id. It's only an issue when the server gives back null as the id.

Comment 2 Dan Callaghan 2017-04-20 05:50:31 UTC
https://gerrit.beaker-project.org/5673

Comment 5 Dan Callaghan 2017-05-30 07:08:05 UTC
Beaker 24.3 has been released.