Description of problem: When a spacewalk client is reporting the result of a scheduled diff back to the spacewalk server, the 'row' variable (presumably derived from what the client reports but possibly from the server's data) may not always have the 'modified' key set; this would cause an error every time the client tries to rhn_check (which would subsequently fail and keep retrying until the task is unscheduled, causing lots of messages). Version-Release number of selected component (if applicable): 1.3 How reproducible: Always that I saw. Steps to Reproduce: 1. Schedule a diff between a machine's config file and the config file on a configuration channel managed by the spacewalk server. 2. Wait for the diff to be executed (or run rhn_check on the spacewalk client) 3. Receive messages about a KeyError exception being raised. Actual results: The diff is reported properly to the server without issue. Expected results: The server doesn't accept the report but leaves the task scheduled. Additional info: Exception Handler Information Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/spacewalk/server/apacheRequest.py", line 118, in call_function response = apply(func, params) File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 326, in get ret = self.__getV2(action) File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 84, in __getV2 result = method(self.server_id, action['id'], dry_run) File "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line 111, in diff return _get_files(server_id, action_id) File "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line 168, in _get_files files.append(format_file_results(row, server=server)) File "/usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py", line 535, in format_file_results if row.has_key('modified'): KeyError: 'modified' row = <type 'dict'> {'config_channel': 'deniro-base', 'username': 'root', 'checksum': '1d12c5ff935de2ce12031e4a67bd3552', 'delim_start': '{|', 'delim_end': '|}', 'symlink': None, 'label': 'file', 'groupname': 'root', 'file_contents': <cx_Oracle.LOB object at 0x2b87d54e2bd0>, 'filemode': 644, 'checksum_type': 'md5', 'path': '/etc/rsyslog.conf', 'selinux_ctx': None, 'is_binary': 'N', 'revision': 2} I was able to fix it by modifying the file /usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py at line 535, just as indicated in the traceback, to read as follows: if row.has_key('modified'): if row['modified']: m_date = xmlrpclib.DateTime(str(row['modified'])) else: m_date = '' else: m_date = '' (previously it read: if row['modified']: m_date = xmlrpclib.DateTime(str(row['modified'])) else: m_date = '' ) Sorry I didn't get an actual diff. Please let me know if you require any further information.
(In reply to comment #0) > Description of problem: > > When a spacewalk client is reporting the result of a scheduled diff back to the > spacewalk server, the 'row' variable (presumably derived from what the client > reports but possibly from the server's data) may not always have the 'modified' > key set; this would cause an error every time the client tries to rhn_check > (which would subsequently fail and keep retrying until the task is unscheduled, > causing lots of messages). > > Version-Release number of selected component (if applicable): > > 1.3 > > How reproducible: > > Always that I saw. > > Steps to Reproduce: > 1. Schedule a diff between a machine's config file and the config file on a > configuration channel managed by the spacewalk server. > 2. Wait for the diff to be executed (or run rhn_check on the spacewalk client) > 3. Receive messages about a KeyError exception being raised. > > Actual results: > The diff is reported properly to the server without issue. > > Expected results: > The server doesn't accept the report but leaves the task scheduled. > > Additional info: > > Exception Handler Information > Traceback (most recent call last): > File "/usr/lib/python2.4/site-packages/spacewalk/server/apacheRequest.py", > line 118, in call_function > response = apply(func, params) > File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 326, in get > ret = self.__getV2(action) > File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 84, in __getV2 > result = method(self.server_id, action['id'], dry_run) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line > 111, in diff > return _get_files(server_id, action_id) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line > 168, in _get_files > files.append(format_file_results(row, server=server)) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py", line > 535, in format_file_results > if row.has_key('modified'): > KeyError: 'modified' > > row = <type 'dict'> {'config_channel': 'deniro-base', 'username': 'root', > 'checksum': '1d12c5ff935de2ce12031e4a67bd3552', 'delim_start': '{|', > 'delim_end': '|}', 'symlink': None, 'label': 'file', 'groupname': 'root', > 'file_contents': <cx_Oracle.LOB object at 0x2b87d54e2bd0>, 'filemode': 644, > 'checksum_type': 'md5', 'path': '/etc/rsyslog.conf', 'selinux_ctx': None, > 'is_binary': 'N', 'revision': 2} > > I was able to fix it by modifying the file > /usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py at line > 535, just as indicated in the traceback, to read as follows: > > if row.has_key('modified'): > if row['modified']: > m_date = xmlrpclib.DateTime(str(row['modified'])) > else: > m_date = '' > else: > m_date = '' > > (previously it read: > > if row['modified']: > m_date = xmlrpclib.DateTime(str(row['modified'])) > else: > m_date = '' > > ) > > Sorry I didn't get an actual diff. > > Please let me know if you require any further information. (oh, I also had to restart spacewalk after I made that change, in case it wasn't clear)
Fixed by commit 71504cda14cd9d6c9f81434dbed7871d3842dad2 675359 - modified attribute is not always present
Fixed package spacewalk-backend-1.4.4-1
Mass moving to ON_QA before release of Spacewalk 1.4
Spacewalk 1.4 has been released