Modify

Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#10716 closed defect (fixed)

Internal Error when submitting a review

Reported by: andy.barreras@… Owned by: Ryan J Ollos
Priority: highest Component: CodeReviewerPlugin
Severity: critical Keywords:
Cc: Trac Release: 1.0

Description (last modified by Ryan J Ollos)

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 (10)

comment:1 Changed 11 years 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 11 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 11 years ago by Rob Guttman

Status: newassigned

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 11 years 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 10 years 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;

comment:6 Changed 9 years ago by Ryan J Ollos

#10806 closed as a duplicate.

comment:7 Changed 9 years ago by Ryan J Ollos

Priority: normalhighest

#11664 closed as a duplicate.

comment:8 Changed 9 years ago by Ryan J Ollos

In 14610:

1.0.0dev: Use Trac datefmt utilities to generate timestamps. Refs #10716.

comment:9 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

In 14611:

1.0.0dev: Postgres and MySQL compatibility. Fixes #10716.

  • Database upgrade step converts time storage columns to large int.
  • Proper use is made of the Trac database API and SQL interpolation is avoided.
  • Trac 1.0 database API methods are utilized.

comment:10 Changed 9 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos

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.