Modify

Opened 5 years ago

Closed 5 years ago

#4083 closed defect (fixed)

oops when saving Legacy Notification

Reported by: slestak Owned by: slestak
Priority: normal Component: AnnouncerPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

Using rhel 5.2, apache, mod_python, python 2.4, trac 11.1.

Oops…
Trac detected an internal error:

ProgrammingError: column "value" is of type text but expression is of type boolean
HINT: You will need to rewrite or cast the expression.

System Information:
Trac: 0.11.1
Python: 2.4.3 (#1, Jan 14 2008, 18:32:40) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)]
setuptools: 0.6c9
psycopg2: 2.0.7 (dec dt ext pq3)
Genshi: 0.5.1
mod_python: 3.2.8

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by slestak

Python Traceback
Most recent call last:

    * File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
      Code fragment:
       418. try:
       419. if not env and env_error:
       420. raise HTTPInternalError(env_error)
       421. try:
       422. dispatcher = RequestDispatcher(env)
       423. dispatcher.dispatch(req)
       424. except RequestDone:
       425. pass
       426. resp = req._response or []
       427.  
       428. except HTTPException, e:
      Local variables:
      Name	Value
      after 	[u' except RequestDone:', u' pass', u' resp = ...
      before 	[u' try:', u' if not env and env_error:', u' raise ...
      dispatcher 	<trac.web.main.RequestDispatcher object at 0xb78f2c2c>
      e 	<psycopg2.ProgrammingError instance at 0xb78b5c2c>
      env 	<trac.env.Environment object at 0xb7c84d0c>
      env_error 	None
      exc_info 	(<class psycopg2.ProgrammingError at 0xb78ef14c>, ...
      filename 	'/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py'
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	422
      message 	u'ProgrammingError: column "value" is of type text but expression is of ...
      req 	<Request "POST u'/prefs/announcer'">
      resp 	[]
      tb 	<traceback object at 0xb765b52c>
      tb_hide 	None
      traceback 	'Traceback (most recent call last):\n File ...
    * File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 222, in dispatch
      Code fragment:
       217. else:
       218. output = chrome.render_template(req, template,
       219. data, content_type)
       220. # Give the session a chance to persist changes
       221. if req.session:
       222. req.session.save()
       223.  
       224. req.send(output, content_type or 'text/html')
       225. else:
       226. self._post_process_request(req)
       227. except RequestDone:
      Local variables:
      Name	Value
      chosen_handler 	<trac.prefs.web_ui.PreferencesModule object at 0xb78f2e2c>
      chrome 	<trac.web.chrome.Chrome object at 0xb78d8a2c>
      content_type 	None
      ctype 	'application/x-www-form-urlencoded'
      data 	{'dateinfo': <function dateinfo at 0xb77eef0c>, 'active_panel': ...
      err 	(<class psycopg2.ProgrammingError at 0xb78ef14c>, ...
      handler 	<trac.prefs.web_ui.PreferencesModule object at 0xb78f2e2c>
      options 	{}
      output 	'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ...
      req 	<Request "POST u'/prefs/announcer'">
      resp 	('prefs_announcer.html', {'dateinfo': <function dateinfo at 0xb77eef0c>, ...
      self 	<trac.web.main.RequestDispatcher object at 0xb78f2c2c>
      template 	'prefs_announcer.html'
    * File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/session.py", line 102, in save
      Code fragment:
        97. (self.sid,))
        98. self._old = dict(self.items())
        99. if attrs:
       100. cursor.executemany("INSERT INTO session_attribute "
       101. "(sid,authenticated,name,value) "
       102. "VALUES(%s,%s,%s,%s)", attrs)
       103. elif not authenticated:
       104. # No need to keep around empty unauthenticated sessions
       105. cursor.execute("DELETE FROM session "
       106. "WHERE sid=%s AND authenticated=0", (self.sid,))
       107. db.commit()
      Local variables:
      Name	Value
      attrs 	[('sromanow', 1, u'query_time', u'1226524251'), ('sromanow', 1, u'name', ...
      authenticated 	1
      cursor 	<trac.db.util.IterableCursor object at 0xb766c3bc>
      db 	<trac.db.pool.PooledConnection object at 0xb784b20c>
      k 	u'announcer_specified_email'
      now 	1226527316
      self 	{u'query_time': u'1226524251', u'name': u'Steve Romanow', ...
      v 	u''
    * File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/util.py", line 57, in executemany
      Code fragment:
        52.  
        53. def executemany(self, sql, args=None):
        54. # print 'executemany', repr(sql)
        55. if args:
        56. # print repr(args)
        57. return self.cursor.executemany(sql_escape_percent(sql), args)
        58. return self.cursor.executemany(sql)
        59.  
        60.  
        61. class ConnectionWrapper(object):
        62. """Generic wrapper around connection objects.
      Local variables:
      Name	Value
      args 	[('sromanow', 1, u'query_time', u'1226524251'), ('sromanow', 1, u'name', ...
      self 	<trac.db.util.IterableCursor object at 0xb766c3bc>
      sql 	'INSERT INTO session_attribute (sid,authenticated,name,value) ...
    * File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/util.py", line 57, in executemany
      Code fragment:
        52.  
        53. def executemany(self, sql, args=None):
        54. # print 'executemany', repr(sql)
        55. if args:
        56. # print repr(args)
        57. return self.cursor.executemany(sql_escape_percent(sql), args)
        58. return self.cursor.executemany(sql)
        59.  
        60.  
        61. class ConnectionWrapper(object):
        62. """Generic wrapper around connection objects.
      Local variables:
      Name	Value
      args 	[('sromanow', 1, u'query_time', u'1226524251'), ('sromanow', 1, u'name', ...
      self 	<trac.db.util.IterableCursor object at 0xb76fda94>
      sql 	'INSERT INTO session_attribute (sid,authenticated,name,value) ...

File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 423, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/main.py", line 222, in dispatch
  req.session.save()
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/web/session.py", line 102, in save
  "VALUES(%s,%s,%s,%s)", attrs)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/util.py", line 57, in executemany
  return self.cursor.executemany(sql_escape_percent(sql), args)
File "/usr/lib/python2.4/site-packages/Trac-0.11.1-py2.4.egg/trac/db/util.py", line 57, in executemany
  return self.cursor.executemany(sql_escape_percent(sql), args)

comment:2 Changed 5 years ago by slestak

  • Owner changed from doki_pen to slestak

comment:3 Changed 5 years ago by slestak

  • Status changed from new to assigned

comment:4 Changed 5 years ago by slestak

hint from doki_pen:

take a look at line 76 of the subscribers/ticket_compat.py file
those should all be casted to strings

comment:5 Changed 5 years ago by anonymous

  • Resolution set to fixed
  • Status changed from assigned to closed

cast to unicode instead. Fixed in r4899

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from slestak. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.