Edgewall Software

Opened 17 years ago

Last modified 17 years ago

#6032 closed defect

Database Fried — at Version 6

Reported by: anonymous Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.10.4
Severity: normal Keywords:
Cc: brett@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Hi there I need help! our trac database is broken. I tried a restore and no go which is odd.. what can i do?

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 127, in process_request
    self._do_create(req, db)
  File "/usr/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 190, in _do_create
    ticket.insert(db=db)
  File "/usr/lib/python2.3/site-packages/trac/ticket/model.py", line 170, in insert
    "VALUES (%s,%s,%s)", [(tkt_id, name, self[name])
  File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 57, in executemany
    return self.cursor.executemany(sql_escape_percent(sql), args)
  File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 276, in executemany
    self.execute(query, _i)
  File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 255, in execute
    self.rs = self.con.db.execute(SQL % parms)
IntegrityError: columns ticket, name are not unique

Change History (6)

comment:1 by anonymous, 17 years ago

oh this is when I try to create a new ticket!

comment:2 by ThurnerRupert, 17 years ago

Resolution: worksforme
Status: newclosed

pls check out http://trac.edgewall.org/wiki/PySqlite#Checkifdatabaseisok, could be here in ticket/model.py and sqlite_backend.py:

 tkt_id = db.get_last_id(cursor, 'ticket')

and

    if have_pysqlite == 2:
        def get_last_id(self, cursor, table, column='id'):
            return cursor.lastrowid
    else:
        def get_last_id(self, cursor, table, column='id'):
            return self.cnx.db.sqlite_last_insert_rowid()

comment:3 by anonymous, 17 years ago

Resolution: worksforme
Status: closedreopened

none of these worked! any other ideas?

in reply to:  3 comment:4 by Emmanuel Blot, 17 years ago

Replying to anonymous:

none of these worked! any other ideas?

Which version of Trac are you using? If you're using a 0.10.x release, please be sure you're running the latest one (0.10.4)

comment:5 by anonymous, 17 years ago

I upgraded to 10.4 from 10.3 last night, same issue.

It looks like there is a duplicate entry in the database for some reason. is there a way to increment it by one so it starts with the next ticket number?

comment:6 by Christian Boos, 17 years ago

Description: modified (diff)

Duplicate custom field?

Note: See TracTickets for help on using tickets.