Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8719 closed defect (worksforme)

Unable to create new tickets with postgresql

Reported by: grutz@… Owned by:
Priority: normal Milestone:
Component: ticket system Version: 0.11.5
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When creating a new ticket using postgresql the following errors occur:

2009-10-04 07:35:45,435 Trac[main] ERROR: Exception caught while post-processing request: 
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 238, in dispatch
    self._post_process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/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 206, in post_process_request
    if req.session.get('force_change_passwd', False):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/api.py", line 195, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 264, in _get_session
    return Session(self.env, req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/session.py", line 157, in __init__
    self.get_session(req.authname, authenticated=True)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/session.py", line 173, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/session.py", line 56, in get_session
    (sid, int(authenticated)))
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/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
InternalError: current transaction is aborted, commands ignored until end of transaction block

2009-10-04 07:35:45,435 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 444, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/web/main.py", line 205, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/ticket/web_ui.py", line 183, in process_request
    return self._process_newticket_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/ticket/web_ui.py", line 394, in _process_newticket_request
    self._do_create(req, ticket) # (redirected if successful)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/ticket/web_ui.py", line 981, in _do_create
    ticket.insert()
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/ticket/model.py", line 195, in insert
    [self[name] for name in std_fields] + [created, changed])
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.11.5-py2.6.egg/trac/db/util.py", line 59, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
IntegrityError: null value in column "id" violates not-null constraint
IntegrityError: null value in column "id" violates not-null constraint

Attachments (0)

Change History (5)

comment:1 by Remy Blank, 15 years ago

Looks like a PluginIssue (AccountManagerPlugin), but not really, as it's in the session management code. No idea what's happening.

comment:2 by Felix Schwarz <felix.schwarz@…>, 15 years ago

I suspect that the DB schema is wrong (id sequence missing). Did you convert the environment from sqlite → postgres? Please list the tables/sequences in your psql db ('\d').

The AccountManager stuff is expected if a broken transaction goes into the pool (e.g. after a previous IntegrityError).

comment:3 by grutz@…, 15 years ago

Resolution: fixed
Status: newclosed

Yeah, it was something weird with the DB schema. I recreated the DB from trac-admin and the ticket table schema changed.

Before:

trac_bkup=# \d
 public | attachment        | table | tracuser
 public | auth_cookie       | table | tracuser
 public | component         | table | tracuser
 public | enum              | table | tracuser
 public | milestone         | table | tracuser
 public | node_change       | table | tracuser
 public | permission        | table | tracuser
 public | report            | table | tracuser
 public | revision          | table | tracuser
 public | session           | table | tracuser
 public | session_attribute | table | tracuser
 public | system            | table | tracuser
 public | ticket            | table | tracuser
 public | ticket_change     | table | tracuser
 public | ticket_custom     | table | tracuser
 public | version           | table | tracuser
 public | wiki              | table | tracuser

trac_bkup=# \d ticket
       Table "public.ticket"
   Column    |  Type   | Modifiers 
-------------+---------+-----------
 id          | integer | not null
 type        | text    | 
 time        | integer | 
 changetime  | integer | 
 component   | text    | 
 severity    | text    | 
 priority    | text    | 
 owner       | text    | 
 reporter    | text    | 
 cc          | text    | 
 version     | text    | 
 milestone   | text    | 
 status      | text    | 
 resolution  | text    | 
 summary     | text    | 
 description | text    | 
 keywords    | text    | 

This was an upgrade from another Trac 0.11 installation with postgres that was moved from another server. I performed a pg_dump of the database and "psql db < db.sql" to import the data then ran "trac-admin trac update" to pull my old data over. Looks like the schema wasn't completely updated.

comment:4 by Remy Blank, 15 years ago

Resolution: fixed
Status: closedreopened

The "fixed" resolution is for tickets where something was actually done in the code. This is rather a "worksforme". But thanks for the feedback.

comment:5 by Remy Blank, 15 years ago

Resolution: worksforme
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.