Edgewall Software
Modify

Opened 18 years ago

Closed 5 years ago

#5278 closed defect (wontfix)

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

Reported by: Barry Owned by:
Priority: normal Milestone:
Component: contrib Version: 0.10.3
Severity: normal Keywords: bugzilla2trac
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Emmanuel Blot)

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

Change History (14)

comment:1 by Emmanuel Blot, 17 years ago

Description: modified (diff)

(reformatting description)

comment:2 by anonymous, 17 years ago

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 by anonymous, 17 years ago

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

comment:4 by The Fixer, 17 years ago

There's a relationship to here

in reply to:  1 comment:5 by jo@…, 17 years ago

Replying to eblot:

(reformatting description)

use the format #,###.00

comment:6 by Jeroen Ruigrok van der Werven, 17 years ago

Owner: changed from Jonas Borgström to Jeroen Ruigrok van der Werven
Status: newassigned

comment:7 by Remy Blank, 16 years ago

Milestone: 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 by Jeroen Ruigrok van der Werven, 16 years ago

Your idea is sound Remy.

comment:9 by lnemee, 16 years ago

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 by Jeroen Ruigrok van der Werven, 15 years ago

Owner: Jeroen Ruigrok van der Werven removed
Status: assignednew

comment:11 by Christian Boos, 15 years ago

Keywords: bugzilla2trac added
Milestone: 1.0not applicable

in reply to:  7 comment:12 by Christian Boos, 15 years ago

Replying to rblank:

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?

And the script is probably broken now on trunk after [9210].

comment:13 by Christian Boos, 15 years ago

Component: ticket systemcontrib

comment:14 by Ryan J Ollos, 5 years ago

Milestone: not applicable
Resolution: wontfix
Status: newclosed

bugzilla2trac.py is no longer maintainer by Trac developers and is being deleted from the trunk. If you need the plugin, please consider copying it from 1.4-stable and creating a plugin on trac-hacks.org.

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.