Bug 1324305

Summary: rendering job JSON: AttributeError: 'NoneType' object has no attribute 'microseconds'
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: web UIAssignee: matt jia <mjia>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: dcallagh, dowang, mjia, pbunyan, rjoost
Target Milestone: 23.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-07 23:09:41 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:

Description Dan Callaghan 2016-04-06 05:28:36 UTC
(only unreleased develop) When opening the job page for an in-progress job from workflow-selftest.

Traceback:
...
  File "build/lib/bkr/server/templates/job.py", line 63, in _pull
  File "/usr/lib/python2.6/site-packages/bkr/server/stdvars.py", line 13, in jsonify_for_html
    json = jsonify.encode(obj)
  File "/usr/lib/python2.6/site-packages/TurboJson-1.3.2-py2.6.egg/turbojson/jsonify.py", line 210, in encode
    return _instance.encode(obj)
  File "/usr/lib64/python2.6/site-packages/simplejson/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib64/python2.6/site-packages/simplejson/encoder.py", line 260, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.6/site-packages/TurboJson-1.3.2-py2.6.egg/turbojson/jsonify.py", line 201, in default
    return jsonify(obj)
  File "<generated code>", line 0, in jsonify
  File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__
    return self.body(*args, **kw)
  File "/usr/lib/python2.6/site-packages/TurboJson-1.3.2-py2.6.egg/turbojson/jsonify.py", line 46, in jsonify_explicit
    return obj.__json__()
  File "/usr/lib/python2.6/site-packages/bkr/server/model/scheduler.py", line 2935, in __json__
    data = super(MachineRecipe, self).__json__()
  File "/usr/lib/python2.6/site-packages/bkr/server/model/scheduler.py", line 2822, in __json__
    data['time_remaining_seconds'] = int(total_seconds(self.time_remaining))
  File "/usr/lib/python2.6/site-packages/bkr/common/helpers.py", line 260, in total_seconds
    return (float(td.microseconds) + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
AttributeError: 'NoneType' object has no attribute 'microseconds'

Comment 1 matt jia 2016-04-07 01:10:34 UTC
That's because we didnot count for a situation that a recipe sitting in Scheduled can have a watchdog with no kill time.

On Gerrit:

   http://gerrit.beaker-project.org/#/c/4782/

Comment 2 matt jia 2016-04-08 00:04:33 UTC
(In reply to matt jia from comment #1)
> That's because we didnot count for a situation that a recipe sitting in
> Scheduled can have a watchdog with no kill time.
> 
> On Gerrit:
> 
>    http://gerrit.beaker-project.org/#/c/4782/

Reposted with correct branch

   http://gerrit.beaker-project.org/#/c/4787/

Comment 4 PaulB 2016-04-08 19:53:17 UTC
All,
I cloned my job and tested link when job was in running state - issue is resolved:
 Beaker 23.0.git.148.a48f135 
 https://beaker-devel.app.eng.bos.redhat.com/jobs/9421

Best,
-pbunyan

Comment 6 Dan Callaghan 2016-07-07 23:09:41 UTC
Beaker 23.0 has been released.