Modify

Opened 15 years ago

Closed 14 years ago

#6745 closed defect (fixed)

Error when navigating to CodeReview tab on Trac 0.11 and 0.12

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: ExoWebCodeReviewPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I see the following error when navigating to the CodeReview tab on Trac0.12dev-r9314:

Trac detected an internal error:

OperationalError: unrecognized token: ":"
    *    File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/web/main.py", line 499, in  _dispatch_request
      Code fragment:
      Line	
      494	try:
      495	if not env and env_error:
      496	raise HTTPInternalError(env_error)
      497	try:
      498	dispatcher = RequestDispatcher(env)
      499	dispatcher.dispatch(req)
      500	except RequestDone:
      501	pass
      502	resp = req._response or []
      503	 
      504	except HTTPException, e:
      Local variables:
      Name	Value
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x1e471d0>
      e 	OperationalError('unrecognized token: ":"',)
      env 	<trac.env.Environment object at 0x1c25ad0>
      env_error 	None
      exc_info 	(<class 'sqlite3.OperationalError'>, OperationalError('unrecognized token: ...
      faulty_plugins 	[]
      frames 	[]
      has_admin 	True
      message 	u'OperationalError: unrecognized token: ":"'
      plugins 	[]
      req 	<Request "GET u'/CodeReview'">
      resp 	[]
      th 	'http://trac-hacks.org'
      traceback 	u'Traceback (most recent call last):\n File ...
      tracker 	'http://trac.edgewall.org'
    * File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/web/main.py", line 231, in dispatch
      Code fragment:
      Line	
      226	msg = _('Do you have cookies enabled?')
      227	raise HTTPBadRequest(_('Missing or invalid form token.'
      228	' %(msg)s', msg=msg))
      229	 
      230	# Process the request and render the template
      231	resp = chosen_handler.process_request(req)
      232	if resp:
      233	if len(resp) == 2: # Clearsilver
      234	chrome.populate_hdf(req)
      235	template, content_type = \
      236	self._post_process_request(req, *resp)
      Local variables:
      Name	Value
      chosen_handler 	<codereview.web_ui.CodeReviewMain object at 0x1e4d4d0>
      chrome 	<trac.web.chrome.Chrome object at 0x1e47610>
      err 	(<class 'sqlite3.OperationalError'>, OperationalError('unrecognized token: ...
      handler 	<codereview.web_ui.CodeReviewMain object at 0x1e4d4d0>
      req 	<Request "GET u'/CodeReview'">
      self 	<trac.web.main.RequestDispatcher object at 0x1e471d0>
    * File "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 358, in process_request
      Local variables:
      Name	Value
      req 	<Request "GET u'/CodeReview'">
      self 	<codereview.web_ui.CodeReviewMain object at 0x1e4d4d0>
    * File "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 264, in _display_html
      Local variables:
      Name	Value
      action 	''
      base_href 	'/tracdev'
      crp 	<codereview.model.CodeReviewPool object at 0x204f7d0>
      db 	<trac.db.pool.PooledConnection object at 0x221a4b0>
      is_completed 	''
      keywords 	{}
      not_shown 	{'msg': [], 'prefix': []}
      req 	<Request "GET u'/CodeReview'">
      req_author 	''
      req_date 	None
      self 	<codereview.web_ui.CodeReviewMain object at 0x1e4d4d0>
      start_rev 	0
      undergoing_items 	[]
    * File "build/bdist.linux-x86_64/egg/codereview/model.py", line 104, in get_codereviews_by_key
      Local variables:
      Name	Value
      codereviews_items 	[]
      id_cs 	[1]
      key 	{}
      not_shown 	{'msg': [], 'prefix': []}
      self 	<codereview.model.CodeReviewPool object at 0x204f7d0>
      start_rev 	0
      status 	'Awaiting'
    * File "build/bdist.linux-x86_64/egg/codereview/model.py", line 81, in get_codereviews_by_revisions
      Local variables:
      Name	Value
      key 	{}
      not_shown 	{'msg': [], 'prefix': []}
      revisions 	[1]
      self 	<codereview.model.CodeReviewPool object at 0x204f7d0>
    * File "build/bdist.linux-x86_64/egg/codereview/model.py", line 167, in changeset_info
      Local variables:
      Name	Value
      author 	u'rjollos'
      common_path 	None
      ctime 	1267431625587431L
      message 	u'Adding code review plugin to repos'
      r 	u'0000000001'
      result 	[(u'0000000001', u'rjollos', u'Adding code review plugin to repos', None, ...
      ret 	[]
      revisions 	[1]
      self 	<codereview.model.CodeReviewPool object at 0x204f7d0>
    * File "build/bdist.linux-x86_64/egg/codereview/model.py", line 329, in get_path
      Local variables:
      Name	Value
      rev 	1
      self 	<codereview.model.CommitPath object at 0x2310d90>
    * File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/util.py", line 90, in execute
      Code fragment:
      Line	
      85	return r
      86	except Exception, e:
      87	self.log.debug('execute exception: %r', e)
      88	raise
      89	if args:
      90	return self.cursor.execute(sql_escape_percent(sql), args)
      91	return self.cursor.execute(sql)
      92	 
      93	def executemany(self, sql, args=None):
      94	if self.log:
      95	self.log.debug('SQL: %r', sql)
      Local variables:
      Name	Value
      args 	(1,)
      self 	<trac.db.util.IterableCursor object at 0x23106d0>
      sql 	'SELECT path FROM rev_path WHERE rev=%s::int'
    * File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 77, in execute
      Code fragment:
      Line	
      72	PyFormatCursor.__init__(self, con)
      73	self.rows = []
      74	self.pos = 0
      75	 
      76	def execute(self, *args):
      77	result = PyFormatCursor.execute(self, *args)
      78	self.rows = PyFormatCursor.fetchall(self)
      79	self.pos = 0
      80	return result
      81	 
      82	def fetchone(self):
      Local variables:
      Name	Value
      args 	('SELECT path FROM rev_path WHERE rev=%s::int', (1,))
      self 	<trac.db.sqlite_backend.EagerCursor object at 0x1fc1408>
    * File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 56, in execute
      Code fragment:
      Line	
      51	raise
      52	def execute(self, sql, args=None):
      53	if args:
      54	sql = sql % (('?',) * len(args))
      55	return self._rollback_on_error(sqlite.Cursor.execute, sql,
      56	args or [])
      57	def executemany(self, sql, args=None):
      58	if args:
      59	sql = sql % (('?',) * len(args[0]))
      60	return self._rollback_on_error(sqlite.Cursor.executemany, sql,
      61	args or [])
      Local variables:
      Name	Value
      args 	(1,)
      self 	<trac.db.sqlite_backend.EagerCursor object at 0x1fc1408>
      sql 	'SELECT path FROM rev_path WHERE rev=?::int'
    * File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
      Code fragment:
      Line	
      43	sqlite_version_string = sqlite.sqlite_version
      44	 
      45	class PyFormatCursor(sqlite.Cursor):
      46	def _rollback_on_error(self, function, *args, **kwargs):
      47	try:
      48	return function(self, *args, **kwargs)
      49	except sqlite.DatabaseError:
      50	self.cnx.rollback()
      51	raise
      52	def execute(self, sql, args=None):
      53	if args:
      Local variables:
      Name	Value
      args 	('SELECT path FROM rev_path WHERE rev=?::int', (1,))
      function 	<method 'execute' of 'sqlite3.Cursor' objects>
      kwargs 	{}
      self 	<trac.db.sqlite_backend.EagerCursor object at 0x1fc1408>

File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/web/main.py", line 499, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/web/main.py", line 231, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 358, in process_requestFile "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 264, in _display_htmlFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 104, in get_codereviews_by_keyFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 81, in get_codereviews_by_revisionsFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 167, in changeset_infoFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 329, in get_pathFile "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/util.py", line 90, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 77, in execute
  result = PyFormatCursor.execute(self, *args)
File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 56, in execute
  args or [])
File "/home/rjollos/Workspace/tracdev/trac-trunk/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
  return function(self, *args, **kwargs)

Attachments (1)

CodeReviewError.png (92.3 KB) - added by Ryan J Ollos 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 15 years ago by Ryan J Ollos

Summary: Error when navigating to CodeReview tab on Trac 0.12Error when navigating to CodeReview tab on Trac 0.11 and 0.12

I'm also seeing this error with Trac 0.11.7rc1-r9282.

Changed 15 years ago by Ryan J Ollos

Attachment: CodeReviewError.png added

comment:2 Changed 15 years ago by Ryan J Ollos

comment:3 Changed 15 years ago by Ryan J Ollos

A more succinct view of the traceback:

File "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/web/main.py", line 450, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/web/main.py", line 206, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 358, in process_requestFile "build/bdist.linux-x86_64/egg/codereview/web_ui.py", line 264, in _display_htmlFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 104, in get_codereviews_by_keyFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 81, in get_codereviews_by_revisionsFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 167, in changeset_infoFile "build/bdist.linux-x86_64/egg/codereview/model.py", line 329, in get_pathFile "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/db/util.py", line 64, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/db/sqlite_backend.py", line 80, in execute
  result = PyFormatCursor.execute(self, *args)
File "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/db/sqlite_backend.py", line 59, in execute
  args or [])
File "/home/rjollos/Workspace/trac0117dev/trac-0.11-stable/trac/db/sqlite_backend.py", line 51, in _rollback_on_error
  return function(self, *args, **kwargs)

comment:4 Changed 14 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [8374]) Remove ::int from SQL queries. Fixes #6745.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.