Edgewall Software
Modify

Ticket #8379 (closed defect: duplicate)

Opened 3 years ago

Last modified 2 years ago

Error while dumping an error w/ postgresql backend

Reported by: eblot Owned by:
Priority: normal Milestone:
Component: database backend Version: 0.12dev
Severity: normal Keywords: postgresql
Cc: felix.schwarz@…
Release Notes:
API Changes:

Description

It seems that Trac confuses PostgreSQL backend when an error in PostgreSQL occurs.

From the log file, an error has been triggered from a plugin (Bitten):

Traceback (most recent call last):
  File "/local/engine/trac/trac/web/main.py", line 464, in _dispatch_request
    dispatcher.dispatch(req)
  File "/local/engine/trac/trac/web/main.py", line 212, in dispatch
    resp = chosen_handler.process_request(req)
  File "/local/engine/bitten/bitten/master.py", line 85, in process_request
    return self._process_build_creation(req)
  File "/local/engine/bitten/bitten/master.py", line 110, in _process_build_creation
    queue.populate()
  File "/local/engine/bitten/bitten/queue.py", line 222, in populate
    for platform, rev, build in collect_changes(repos, config, db):
  File "/local/engine/bitten/bitten/queue.py", line 82, in collect_changes
    for platform in TargetPlatform.select(env, config.name, db=db):
  File "/local/engine/bitten/bitten/model.py", line 323, in select
    yield TargetPlatform.fetch(env, id)
  File "/local/engine/bitten/bitten/model.py", line 297, in fetch
    "WHERE id=%s ORDER BY orderno", (id,))
  File "/local/engine/trac/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/local/engine/trac/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: operator does not exist: text = integer

However, the error reported to the web browser looks like the following

Traceback (most recent call last):
  File "/local/engine/trac/trac/web/api.py", line 382, in send_error
    'text/html')
  File "/local/engine/trac/trac/web/chrome.py", line 761, in render_template
    req.chrome[type_].append(
  File "/local/engine/trac/trac/web/api.py", line 199, in __getattr__
    value = self.callbacks[name](self)
  File "/local/engine/trac/trac/web/chrome.py", line 516, in prepare_request
    for category, name, text in contributor.get_navigation_items(req):
  File "/local/engine/bitten/bitten/web_ui.py", line 94, in get_navigation_items
    repos.sync()
  File "/local/engine/trac/trac/versioncontrol/cache.py", line 90, in sync
    ','.join(["'%s'" % key for key in CACHE_METADATA_KEYS]))
  File "/local/engine/trac/trac/db/util.py", line 60, in execute
    return self.cursor.execute(sql)
  File "/local/engine/trac/trac/db/util.py", line 60, in execute
    return self.cursor.execute(sql)
InternalError: current transaction is aborted, commands ignored until end of transaction block

Attachments

Change History

comment:1 Changed 3 years ago by eblot

See ticket:404 for the root cause

comment:2 Changed 3 years ago by cboos

  • Component changed from general to database backend
  • Milestone set to 0.11.6

I think this is due to the lack of rollback after errors.

We should consider doing in the IterableCursor when implementing #6348, being careful to not interfere with the garbage collection of PooledConnection (i.e. probably have a weak ref in the cursor to its connection).

comment:3 Changed 3 years ago by cboos

  • Milestone changed from 0.11.6 to 0.12
  • Severity changed from minor to normal

comment:4 Changed 3 years ago by Felix Schwarz <felix.schwarz@…>

  • Cc felix.schwarz@… added

comment:5 Changed 2 years ago by cboos

  • Milestone 0.12 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6348.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from (none). Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.