Edgewall Software

Ticket #5278 (assigned defect)

Opened 19 months ago

Last modified 4 weeks ago

ValueError: empty string for float() after migrating tickets from Bugzilla To Trac

Reported by: Barry Owned by: jruigrok
Priority: normal Milestone: 1.0
Component: ticket system Version: 0.10.3
Severity: normal Keywords:
Cc:

Description (last modified by eblot) (diff)

I have run Bugzilla2Trac and after an issue eventually got the Bugzilla tickets migrated. The first issue was

Traceback (most recent call last):
  File "C:\Python24\Scripts\bugzilla2trac.py", line 887, in ?
    main()
  File "C:\Python24\Scripts\bugzilla2trac.py", line 884, in main
    convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
  File "C:\Python24\Scripts\bugzilla2trac.py", line 780, in convert
    trac.addTicketChange (**ticketChange)
  File "C:\Python24\Scripts\bugzilla2trac.py", line 394, in addTicketChange
    (ticket, time.strftime('%s'), author, field,
  File "C:\Python24\Lib\site-packages\trac\db\util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "C:\Python24\Lib\site-packages\trac\db\sqlite_backend.py", line 56, in ex
ecute
    args or [])
  File "C:\Python24\Lib\site-packages\trac\db\sqlite_backend.py", line 48, in n_error
    return function(self, *args, **kwargs)
pysqlite2.dbapi2.IntegrityError: columns ticket, time, field are not unique

I got around this by introducing OR IGNORE in the INSERT INTO ticket & INSERT INTO ticket_changes clause. This migrated the changes

However when I go to Trac and click on "View Tickets" and select "All Tickets By Milestone (Including closed)" I get the following error

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Python24\Lib\site-packages\trac\ticket\report.py", line 88, in process_request
    resp = self._render_view(req, db, id)
  File "C:\Python24\Lib\site-packages\trac\ticket\report.py", line 346, in _render_view
    value['date'] = format_date(cell)
  File "C:\Python24\lib\site-packages\trac\util\datefmt.py", line 68, in format_date
    return format_datetime(t, format, gmt)
  File "C:\Python24\lib\site-packages\trac\util\datefmt.py", line 58, in format_datetime
    t = time.localtime(float(t))
ValueError: empty string for float()

Attachments

Change History

follow-up: ↓ 5   Changed 16 months ago by eblot

  • description modified (diff)

(reformatting description)

  Changed 14 months ago by anonymous

This may or may not help, but I was able to get around this bug by altering the time in the bugs_when column in the bugs_activity table so that the times were unique. It took about 5 min, but after that it imported with no problems.

  Changed 14 months ago by anonymous

Sorry, I should be more specific. This is regarding the "pysqlite2.dbapi2.IntegrityError?: columns ticket, time, field are not unique" error.

  Changed 12 months ago by The Fixer

There's a relationship to here

in reply to: ↑ 1   Changed 12 months ago by jo@…

Replying to eblot:

(reformatting description)

use the format #,###.00

  Changed 7 months ago by jruigrok

  • owner changed from jonas to jruigrok
  • status changed from new to assigned

  Changed 4 weeks ago by rblank

  • milestone set to 1.0

As I understand, Trac doesn't allow more than one ticket change per second, as (id, time) is used as a key to a set of changes, and time is stored as seconds since the epoch.

Maybe Bugzilla2Trac could be adapted to delay multiple changes in the same second to subsequent seconds?

About the other error, it looks as if the report you are trying to view returns an empty string for a column that is supposed to be formatted as a date.

Add/Change #5278 (ValueError: empty string for float() after migrating tickets from Bugzilla To Trac)

Author



Change Properties
<Author field>
Action
as assigned
as The resolution will be set. Next status will be 'closed'
to The owner will change from jruigrok. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.