Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#451 closed defect (fixed)

Lint report generator fails on postgres, and prevents build upload

Reported by: dfraser Owned by: dfraser
Priority: critical Milestone: 0.6
Component: General Version: dev
Keywords: Cc:
Operating System: Linux

Description

I got the following error on uploading a build:

  File "/usr/lib/python2.5/site-packages/bitten/report/lint.py", line 52, in generate_chart_data
    cursor.execute(query)
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 60, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 60, in execute
    return self.cursor.execute(sql)
ProgrammingError: subquery uses ungrouped column "report.id" from outer query

This then threw another error:

2009-09-16 11:44:42,337 Trac[main] ERROR: Exception caught while post-processing request:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 238, in dispatch
    self._post_process_request(req)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 310, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 202, in post_process_request
    if req.session.get('force_change_passwd', False):
  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 195, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 264, in _get_session
    return Session(self.env, req)
  File "/usr/lib/python2.5/site-packages/trac/web/session.py", line 157, in __init__
    self.get_session(req.authname, authenticated=True)
  File "/usr/lib/python2.5/site-packages/trac/web/session.py", line 173, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "/usr/lib/python2.5/site-packages/trac/web/session.py", line 56, in get_session
    (sid, int(authenticated)))
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
InternalError: current transaction is aborted, commands ignored until end of transaction block

Because of this failure, the server returns a 500 error to the client and the build upload never completes, leaving the build in an In Progress state

Attachments (1)

451_patch.diff (467 bytes) - added by Roland Wilczek <r.wilczek@…> 14 years ago.
patch for unknown column report_category (PostgreSQL 8.3.7)

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 years ago by dfraser

  • Status changed from new to assigned

The SQL query is:

select build.rev,
 (select count(*) from bitten_report_item as item
  where item.report = report.id and item.name='category' and item.value='convention'),
 (select count(*) from bitten_report_item as item
  where item.report = report.id and item.name='category' and item.value='error'),
 (select count(*) from bitten_report_item as item
  where item.report = report.id and item.name='category' and item.value='refactor'),
 (select count(*) from bitten_report_item as item
  where item.report = report.id and item.name='category' and item.value='warning')
from bitten_report as report
 left outer join bitten_build as build ON (report.build=build.id)
where build.config='j5-trunk' and report.category='lint'
group by build.rev_time, build.rev, build.platform
order by build.rev_time;

Adding report.id to the group by clause fixes the query error on PostGreSQL.

comment:2 follow-up: Changed 15 years ago by dfraser

Fixed with r769, but needs backporting to 0.6 branch still

comment:3 in reply to: ↑ 2 ; follow-up: Changed 15 years ago by osimons

Replying to dfraser:

Fixed with r769, but needs backporting to 0.6 branch still

Just for reference as we are now using the new Subversion merge facilities of 1.5/1.6, here is how I backport now:

cd svn-bitten-0.6.x
# show revisions from trunk eligble for merging:
svn mergeinfo --show-revs eligible ^/trunk
# pick one (-c) or more (several -c or -r from:to)
svn merge -c 765 ^/trunk
# test, status, diff and check that things work, and then...
svn ci -m "0.6dev: Merged [765] from trunk."

comment:4 in reply to: ↑ 3 Changed 15 years ago by dfraser

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

Replying to osimons:

Replying to dfraser:

Fixed with r769, but needs backporting to 0.6 branch still

Just for reference as we are now using the new Subversion merge facilities of 1.5/1.6, here is how I backport now:

Bother, only saw this afterwards. In any case, I've now backported it in r771 - the merge tracking may need to be adjusted though.

comment:5 Changed 14 years ago by Roland Wilczek <r.wilczek@…>

  • Resolution fixed deleted
  • Status changed from closed to reopened

lint.py still doesn't work with PostgreSQL 8.3.7 in r805.

Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/site-packages/Bitten-0.7dev_r805-py2.6.egg/bitten/web_ui.py", line 530, in process_request
    step)
  File "/usr/local/lib/python2.6/site-packages/Bitten-0.7dev_r805-py2.6.egg/bitten/web_ui.py", line 672, in _render_reports
    step, report.category)
  File "/usr/local/lib/python2.6/site-packages/Bitten-0.7dev_r805-py2.6.egg/bitten/report/lint.py", line 116, in render_summary
    ORDER BY item_type.value""", (build.id, step.name))
  File "/usr/lib/python2.6/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.6/site-packages/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: ERROR:  Column »report_category« does not exist
LINE 20: WHERE report_category='lint' AND build=882 AND step=E'Coding...
               ^
ProgrammingError: ERROR:  Column »report_category« does not exist
LINE 20: WHERE report_category='lint' AND build=882 AND step=E'Coding...

which is caused by the SQL-statement in report/lint.py ll. 97ff.

Attached is a patch changing the selected column-name.

Changed 14 years ago by Roland Wilczek <r.wilczek@…>

patch for unknown column report_category (PostgreSQL 8.3.7)

comment:6 Changed 14 years ago by hodgestar

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

Fixed in r844 and backported to 0.6.x in r845.

comment:7 Changed 14 years ago by hodgestar

P.S. Roland, thanks for the patch! Sorry this tiny patch took 4 months to land.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain dfraser.
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.