Bug 759269

Summary: Empty MOTD causes tracebacks in server-errors.log
Product: [Retired] Beaker Reporter: Derrich Hafemann <dhafeman>
Component: web UIAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 0.8CC: bpeck, dcallagh, llim, mcsontos, mschick, rmancy, stl, xjia
Target Milestone: 0.14.2Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ImplementationQuality
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-07 01:47:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Derrich Hafemann 2011-12-01 20:15:22 UTC
Description of problem:

When there's no MOTD that needs to be displayed, the contents of /etc/beaker/motd.xml are set to :

<!-- span>Uncomment and add the MOTD here</span -->

This produces tracebacks in server-errors.log:

2011-11-15 20:43:35,404 bkr.server.motd ERROR Unable to read motd
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bkr/server/motd.py", line 17, in <module>
    the_motd = etree.tostring(tree.getroot())
  File "lxml.etree.pyx", line 2632, in lxml.etree.tostring (src/lxml/lxml.etree.c:49164)
TypeError: Type 'NoneType' cannot be serialized.


Version-Release number of selected component (if applicable): beaker-0.8.0-17.el6eso


How reproducible: 100%


Steps to Reproduce:
1. Set MOTD as described earlier
2. Bounce httpd & beakerd
3. Note traceback in log
  
Actual results:

Traceback is thrown when an MOTD without a message to display is used

Expected results:

No MOTD displayed on the Web UI, and no traceback in the logs.

Additional info:

If there's something else we should be putting in the file, we're open to suggestions.

Comment 3 Dan Callaghan 2013-07-29 01:53:40 UTC
On Gerrit: http://gerrit.beaker-project.org/2126

Comment 5 xjia 2013-08-06 06:11:21 UTC
Verify:

[root@beaker beaker]# cat /etc/beaker/motd.xml
<!-- span>The QE environment says hello</span-->
[root@beaker beaker]# service beakerd restart
Stopping beakerd:                                          [  OK  ]
Starting beakerd:                                          [  OK  ]
[root@beaker beaker]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

there's no error in the log, and doesn't show the message on the Web.

[root@beaker beaker]# cat /etc/beaker/motd.xml
<span>The QE environment says hello</span>
[root@beaker beaker]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@beaker beaker]# service beakerd restart
Stopping beakerd:                                          [  OK  ]
Starting beakerd:                                          [  OK  ]

There's no error in the log, and show the message on the Web:
Message of the day The QE environment says hello

Comment 6 Nick Coghlan 2013-10-03 02:29:16 UTC
Beaker 0.15 has been released.

Comment 7 Raymond Mancy 2013-10-23 01:56:54 UTC
This change has been nominated to be back ported to the 0.14 branch, to be released as part of the next maintenance release 0.14.2.

Comment 8 Nick Coghlan 2013-10-25 06:36:22 UTC
Adjusting target milestone to make the changes backported to 0.14.2 easier to identify. 0.15.0 has enough significant regressions that it shouldn't be used, so the change means that 0.15.1 can be effectively reidentified as the union of that tag and the 0.14.2 target milestone.

Comment 10 xjia 2013-10-29 04:54:50 UTC
Verify:

[root@beaker beaker]# cat /etc/beaker/motd.xml
<!-- span>Uncomment and add the MOTD here</span-->
[root@beaker beaker]# service beakerd restart
Stopping beakerd:                                          [  OK  ]
Starting beakerd:                                          [  OK  ]
[root@beaker beaker]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

there's no error in the log, and doesn't show the message on the Web.

[root@beaker beaker]# cat /etc/beaker/motd.xml
<span>Uncomment and add the MOTD here</span>
[root@beaker beaker]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@beaker beaker]# service beakerd restart
Stopping beakerd:                                          [  OK  ]
Starting beakerd:                                          [  OK  ]

There's no error in the log, and show the message on the Web:
Message of the day Uncomment and add the MOTD here

Comment 11 Nick Coghlan 2013-11-07 01:47:20 UTC
Closing as addressed in Beaker 0.14.2.