Bug 691796

Summary: machines without owner cause beakerd heartburn
Product: [Retired] Beaker Reporter: Bill Peck <bpeck>
Component: schedulerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 0.6CC: bpeck, dcallagh, mcsontos, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-29 07:13:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bill Peck 2011-03-29 13:53:33 UTC
Description of problem:

If beakerd is unable to schedule a machine (for example power control fails), and the machine does not have an owner the following traceback will be thrown:

2011-03-29 09:47:46,304 beakerd DEBUG Entering scheduled_recipes routine
2011-03-29 09:47:46,304 beakerd INFO scheduled_recipes: RS:3247
2011-03-29 09:49:36,702 beakerd ERROR Cobbler task failed for recipe 4624: 'Cobbler Task:2011-03-29_094746_power Failed'
2011-03-29 09:49:36,708 beakerd ERROR Failed to commit in scheduled_recipes
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bkr/server/tools/beakerd.py", line 486, in scheduled_recipes
    recipe.system.mark_broken(reason=str(e), recipe=recipe)
  File "/usr/lib/python2.4/site-packages/bkr/server/model.py", line 2377, in mark_broken
    mail.broken_system_notify(self, reason, recipe)
  File "/usr/lib/python2.4/site-packages/bkr/server/mail.py", line 112, in broken_system_notify
    send_mail(sender, system.owner.email_address,
AttributeError: 'NoneType' object has no attribute 'email_address'
2011-03-29 09:49:36,709 beakerd DEBUG Exiting scheduled_recipes routine


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


Steps to Reproduce:
1. set the owner to None and misconfigure power settings for a system
2. schedule against that machine

Actual results:
Job stays in scheduled state and keeps trying to schedule it.

Expected results:
Scheduler should abort job

Comment 1 Dan Callaghan 2011-03-29 23:44:47 UTC
I caused this particular one. I think there are a few places where I have assumed that owner is not NULLable, although clearly it is. I will go back and fix them up.

Comment 4 Dan Callaghan 2011-04-07 00:35:43 UTC
The plan is to make owner_id not NULLable. We will just need to find owners for those ownerless systems in our database currently.