Modify

Opened 21 months ago

Last modified 12 months ago

#10716 assigned defect

Internal Error when submitting a review

Reported by: andy.barreras@… Owned by: robguttman
Priority: normal Component: CodeReviewerPlugin
Severity: critical Keywords:
Cc: Trac Release: 1.0

Description (last modified by rjollos)

Using Trac 1.0 via Apache (SSL) and PostgreSQL back-end, Python 2.7. Compiled source to python egg and installed as usual. Install seems to go well. However, when I try submit a peer review to an existing change set, I get a Trac error:

DataError: integer out of range

Here's the Trac log file output:

2012-12-18 16:13:43,621 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 234, in dispatch
    req.send(output, content_type or 'text/html')
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\api.py", line 486, in send
    self.write(content)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\api.py", line 608, in write
    self._write(data)
IOError: failed to write data
2012-12-18 16:13:43,621 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 234, in dispatch
    req.send(output, content_type or 'text/html')
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\api.py", line 486, in send
    self.write(content)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\api.py", line 608, in write
    self._write(data)
IOError: failed to write data

Attachments (0)

Change History (5)

comment:1 Changed 21 months ago by andy.barreras@…

More info. A closer look at the Trac log file indicates it may be an issue to the SQL backend in terms of unsupported escape characters:

2012-12-18 16:13:41,528 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 224, in dispatch
    self._post_process_request(req, *resp)
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\web\main.py", line 338, in _post_process_request
    resp = f.post_process_request(req, *resp)
  File "build\bdist.win32\egg\coderev\web_ui.py", line 58, in post_process_request
    if review.save(reviewer=req.authname, **req.args):
  File "build\bdist.win32\egg\coderev\model.py", line 93, in save
    """, (self.repo,self.changeset,status,reviewer,summary,when))
  File "c:\docume~1\svchou~1\locals~1\temp\easy_install-tyu9e_\Trac-1.0-py2.7-win32.egg.tmp\trac\db\util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
DataError: integer out of range
DataError: integer out of range

comment:2 Changed 21 months ago by rjollos

  • Description modified (diff)

comment:3 Changed 21 months ago by robguttman

  • Status changed from new to assigned

Andy, so you know I have not yet tested this on Trac 1.0 nor Postgres nor python 2.7. Not that it shouldn't work - just never tested.

What version control system are you using? Also, are you using named repos in Trac (e..g, if you have multiple repos)?

comment:4 Changed 21 months ago by anonymous

We are using SVN (multiple named repos). I'm not a Python expert by any means but I've looked at your source code and I believe the issue may be on or about line 93 in model.py where you are doing a db insert:

        cursor.execute("""
            INSERT INTO codereviewer
                   (repo,changeset,status,reviewer,summary,time)
            VALUES (%s, %s, %s, %s, %s, %s);
            """, (self.repo,self.changeset,status,reviewer,summary,when))

Based on the "index out of range" error I'm getting, the only piece of data in that SQL statement that is an integer type is the 'time' variable who's value is passed by 'when' . A few lines up you do this:

when = int(time.time() * self.EPOCH_MULTIPLIER)


Not sure if this is the issue or not but that's what I'm looking at right now.

comment:5 Changed 12 months ago by jesusrafael@…

This is due postgresql table schema problems, the codereview table is using a small integer data type... you can fix it with this:

alter table codereviewer alter COLUMN "time" type bigint;

Add Comment

Modify Ticket

Action
as assigned .
Author


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

 
Note: See TracTickets for help on using tickets.