Edgewall Software
Modify

Ticket #5278 (new defect)

Opened 3 years ago

Last modified 2 months ago

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

Reported by: Barry Owned by:
Priority: normal Milestone: not applicable
Component: ticket system Version: 0.10.3
Severity: normal Keywords: bugzilla2trac
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

comment:1 follow-up: ↓ 5 Changed 3 years ago by eblot

  • Description modified (diff)

(reformatting description)

comment:2 Changed 2 years 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.

comment:3 Changed 2 years ago by anonymous

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

comment:4 Changed 2 years ago by The Fixer

There's a relationship to  here

comment:5 in reply to: ↑ 1 Changed 2 years ago by jo@…

Replying to eblot:

(reformatting description)

use the format #,###.00

comment:6 Changed 22 months ago by jruigrok

  • Owner changed from jonas to jruigrok
  • Status changed from new to assigned

comment:7 Changed 16 months 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.

comment:8 Changed 10 months ago by jruigrok

Your idea is sound Remy.

comment:9 Changed 10 months ago by lnemee

My 2 cents : the script add keyword "VERIFIED" on trac where it finds a "VERIFIED" status on bugzilla, so the scipt fails whenever the status "VERIFIED" was added or removed at the same moment as a keyword change. The request : SELECT * FROM bugs_activity AS a INNER JOIN bugs_activity AS b ON a.bug_id=b.bug_id and a.bug_when=b.bug_when and a.fieldid=9 and b.fieldid=11 and (a.added="VERIFIED" OR a.removed="VERIFIED") order by a.bug_id, a.bug_when on the bugzilla database should say on which bug_activity lines you have to change bug_when.

comment:10 Changed 2 months ago by jruigrok

  • Owner jruigrok deleted
  • Status changed from assigned to new

comment:11 Changed 2 months ago by cboos

  • Keywords bugzilla2trac added
  • Milestone changed from 1.0 to not applicable
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from (none). Next status will be 'new'
The owner will be changed from (none) to anonymous. Next status will be 'assigned'
Author


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

 
Note: See TracTickets for help on using tickets.