Roundup Tracker - Issues

Issue 2550818

classification
Templating Error: 'topic'
Type: crash Severity: critical
Components: Database Versions: 1.4
process
Status: closed rejected
:
: : ber, rouilj, schlatterbeck, stuart
Priority: :

Created on 2013-08-23 01:04 by stuart, last changed 2013-08-23 09:10 by schlatterbeck.

Files
File name Uploaded Description Edit Remove
schema.py stuart, 2013-08-23 02:07 schema
Messages
msg4917 Author: [hidden] (stuart) Date: 2013-08-23 01:04
Version 1.4.20, running for over a year using sqlite database.  (2 or 3
users)  No errors logged in roundup.log or /var/log/messages. "sqlite3
db pragma integrity_check" finds no errors. The email to the admin says:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/roundup/cgi/client.py", line
1059, in renderContext
    result = pt.render(self, None, None, **args)
  File "/usr/lib/python2.6/site-packages/roundup/cgi/engine_zopetal.py",
line 108, in render
    getEngine().getContext(c), output, tal=1, strictinsert=0)()
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 192, in __call__
    self.interpret(self.program)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 666, in do_useMacro
    self.interpret(macro)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 411, in do_optTag_tal
    self.do_optTag(stuff)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 396, in do_optTag
    return self.no_tag(start, program)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 391, in no_tag
    self.interpret(program)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 689, in do_defineSlot
    self.interpret(slot)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/TAL/TALInterpreter.py",
line 462, in do_setLocal_tal
    self.engine.setLocal(name, self.engine.evaluateValue(expr))
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/PageTemplates/TALES.py",
line 225, in evaluate
    return expression(self)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/PageTemplates/Expressions.py",
line 193, in __call__
    return self._eval(econtext)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/PageTemplates/Expressions.py",
line 188, in _eval
    return render(ob, econtext.vars)
  File
"/usr/lib/python2.6/site-packages/roundup/cgi/PageTemplates/Expressions.py",
line 94, in render
    ob = ob()
  File "/usr/lib/python2.6/site-packages/roundup/cgi/templating.py",
line 2657, in batch
    if check(permission, userid, self.classname, itemid=id)]
  File "/usr/lib/python2.6/site-packages/roundup/security.py", line 196,
in hasPermission
    userid, itemid):
  File "/usr/lib/python2.6/site-packages/roundup/security.py", line 51,
in test
    if not self.check(db, userid, itemid):
  File "/var/lib/roundup/schema.py", line 103, in customer_issue
    issue_topics = db.issue.get(itemid, 'topic')
  File
"/usr/lib/python2.6/site-packages/roundup/backends/rdbms_common.py",
line 1672, in get
    prop = self.properties[propname]
KeyError: 'topic'
msg4918 Author: [hidden] (rouilj) Date: 2013-08-23 01:31
In message <1377219882.0.0.610236726331.issue2550818@psf.upfronthosting.co.za> 
<1377219882.0.0.610236726331.issue2550818@psf.upfronthosting.co.za>,
Stuart Gathman writes:
>Version 1.4.20, running for over a year using sqlite database.  (2 or 3
>users)  No errors logged in roundup.log or /var/log/messages. "sqlite3
>db pragma integrity_check" finds no errors. The email to the admin says:
>    if not self.check(db, userid, itemid):
>  File "/var/lib/roundup/schema.py", line 103, in customer_issue
>    issue_topics = db.issue.get(itemid, 'topic')
>  File
>"/usr/lib/python2.6/site-packages/roundup/backends/rdbms_common.py",
>line 1672, in get
>    prop = self.properties[propname]
>KeyError: 'topic'

What does the schema.py in the tracker home directory look like?
Does the issue actually have a topic field?

There should be a line like:

                      topic=Multilink("topic"),

in the definition of the 'issue' issue class.
msg4919 Author: [hidden] (stuart) Date: 2013-08-23 02:07
Here is the schema, and a diff of me trying to fix the problem (now gets
KeyError: 'keyword').  The schema was ported from 0.8 (I added a topic
list to user record, and users can only see their own topics unless list
is empty), so I probably broke it.  But how was it working all this
time?  I have to catch a train in the morning, so I won't be able to
check in again until tomorrow (via mobile hotspot on the train!).

diff -u -r1.1 schema.py
--- schema.py	2013/08/23 01:55:09	1.1
+++ schema.py	2013/08/23 01:58:44
@@ -98,9 +98,9 @@
 	return False
     if db.issue.get(itemid, 'creator') == userid:
 	return True
-    user_topics = db.user.get(userid, 'topic')
+    user_topics = db.user.get(userid, 'keyword')
     if not user_topics: return True
-    issue_topics = db.issue.get(itemid, 'topic')
+    issue_topics = db.issue.get(itemid, 'keyword')
     # When any are defined, at least one user topic must be in issue topics
     for t in user_topics:
       if t in issue_topics: return True
msg4920 Author: [hidden] (ber) Date: 2013-08-23 07:24
This does not seem to be a general software problem,
but we can still track it here I think.

Stuart,
when did you last restart your installation?
Maybe something was not activated because of an old process still
running?
Could there be any new items or entries that trigger the problem?
msg4921 Author: [hidden] (schlatterbeck) Date: 2013-08-23 09:10
On Fri, Aug 23, 2013 at 01:04:42AM +0000, Stuart Gathman wrote:
> 
> Version 1.4.20, running for over a year using sqlite database.  (2 or 3
> users)  No errors logged in roundup.log or /var/log/messages. "sqlite3
> db pragma integrity_check" finds no errors. The email to the admin says:
> 
> Traceback (most recent call last):
...
>   File "/var/lib/roundup/schema.py", line 103, in customer_issue
>     issue_topics = db.issue.get(itemid, 'topic')
>   File
> "/usr/lib/python2.6/site-packages/roundup/backends/rdbms_common.py",
> line 1672, in get
>     prop = self.properties[propname]
> KeyError: 'topic'

This looks like you have a custom 'customer_issue' method (that is not
part of the roundup distribution) which tries to access a non-existing
property 'topic' of 'issue'.

Please contact the mailinglist with questions on customizing roundup
https://lists.sourceforge.net/lists/listinfo/roundup-users
and include the code where you see this problem.

I'm closing this issue as it can't be reproduced with the roundup core
distribution.
History
Date User Action Args
2013-08-23 09:10:24schlatterbecksetstatus: new -> closed
resolution: rejected
messages: + msg4921
nosy: + schlatterbeck
title: Templating Error: 'topic' after long good usage, sqlite -> Templating Error: 'topic'
2013-08-23 07:24:52bersetnosy: + ber
messages: + msg4920
title: Templating Error: 'topic' -> Templating Error: 'topic' after long good usage, sqlite
2013-08-23 02:07:49stuartsetfiles: + schema.py
messages: + msg4919
2013-08-23 01:31:33rouiljsetnosy: + rouilj
messages: + msg4918
2013-08-23 01:04:41stuartcreate