Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#6794 closed defect (fixed)

bugzilla2trac.py: "Incorrect integer value" during bug import

Reported by: andreas.balogh@… Owned by: Jonas Borgström
Priority: normal Milestone: 0.11
Component: general Version: 0.11b1
Severity: normal Keywords: bugzilla
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

bugzilla2trac.py fails during import. Enclosed find the log and traceback.

Using Bugzilla v2180 schema. Bugzilla MySQL('bugs':'localhost':'bugzilla':''): connecting… Trac SQLite('d:\htdocs\trac'): connecting…

Cleaning all tickets… All tickets cleaned…

  1. Filtering products… Using products rttrd
  1. Import severities… inserting severity 'blocker' - '1' inserting severity 'critical' - '2' inserting severity 'major' - '3' inserting severity 'normal' - '4' inserting severity 'minor' - '5' inserting severity 'trivial' - '6'
  1. Import components… inserting component 'broker-flatex', owner 'andreas.balogh@…' inserting component 'mdf-consors', owner 'andreas.balogh@…' inserting component 'opportunity spotter', owner 'andreas.balogh@…' inserting component 'quote-poller', owner 'andreas.balogh@…'
  1. Import priorities… inserting priority 'highest' - '1' inserting priority 'high' - '2' inserting priority 'normal' - '3' inserting priority 'low' - '4' inserting priority 'lowest' - '5'
  1. Import versions… inserting version '0.9'
  1. Import milestones…
  1. Retrieving bugs…
  1. Import bugs and bug activity…
    Traceback (most recent call last):
      File "bugzilla2trac.py", line 895, in <module>
        main()
      File "bugzilla2trac.py", line 892, in main
        convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
      File "bugzilla2trac.py", line 672, in convert
        value = desc['thetext'])
      File "bugzilla2trac.py", line 365, in addTicketComment
        (ticket, time.strftime('%s'), author, 'comment', '', comment))
      File "c:\apps\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py
    ", line 50, in execute
        return self.cursor.execute(sql_escape_percent(sql), args)
      File "c:\apps\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py
    ", line 50, in execute
        return self.cursor.execute(sql_escape_percent(sql), args)
      File "C:\Apps\Python25\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\My
    SQLdb\cursors.py", line 166, in execute
      File "C:\Apps\Python25\lib\site-packages\mysql_python-1.2.2-py2.5-win32.egg\My
    SQLdb\connections.py", line 35, in defaulterrorhandler
    _mysql_exceptions.OperationalError: (1366, "Incorrect integer value: '' for column 'time' at row 1")
    

Attachments (1)

bugzilla2trac_strftime.patch (2.5 KB ) - added by xenolinguist@… 16 years ago.
patch fixing issue

Download all attachments as: .zip

Change History (4)

by xenolinguist@…, 16 years ago

patch fixing issue

comment:1 by xenolinguist@…, 16 years ago

I've encountered the exact same issue. After some code-diving (and a little schema reverse-engineering), I solved this. bugzilla2trac is using strftime('%s') in a few places to convert datetime values to epoch-seconds. The only problem with this is that the "%s" is a Glibc extension, and is unavailable on most non-Glibc platforms (such as MS Win32, the platform I'm using).

I'm attaching a patch in which I've refactored away the strftime calls into a method which will work even on non-Glibc systems. After making this change I was able to successfully run bugzilla2trac.py on my windows system.

comment:2 by Christian Boos, 16 years ago

Description: modified (diff)
Keywords: bugzilla added
Milestone: 0.11

Looks good, thanks!

comment:3 by Christian Boos, 16 years ago

Resolution: fixed
Status: newclosed

Contributed patch committed as [6501].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.