Youtrack-remote-api aborts connection when importing from Mantis

Hi All

I tried to import all issues from Mantis to YouTrack and did it how it's described here: http://confluence.jetbrains.net/display/YTD2/Import+from+Mantis

It most often worked for small Mantis Projects but not for the big ones.

Facts:

YouTrack is installed on a XP Pofessional SP3 machine

mySQL db is on a Windows Server 2003 SP2 machine

Mantis version is 1.2.4

YouTrack version is 2.2.0 (build #802 [15-Dec-2010 20:09] )

I tried it with Python 2.7 togehter with MySQL python 1.2.3 py 2.7 and also with Python 2.6 together with MySQL python 1.2.3 py 2.6

Command to start the import:

c:\Python27\python.exe mantis2youtrack.py http://YouTrackServer:8081 root rootPassword MantisDatabase MantisServer 3306  importUser importUserPassword MantisProject

Stack trace:

     .

     .
    All Issues...

     .

     .
  </issue>
  <issue>
    <field name="subsystem">
      <value>Category</value>
    </field>
    <field name="OS">
      <value></value>
    </field>
    <field name="updated">
      <value>1250543253000</value>
    </field>
    <field name="Subproject">
      <value>Dev Stopped</value>
    </field>
    <field name="description">
      <value>This is a dummy description

"This is a dummy text
    </field>
    <field name="created">
      <value>1070353093000</value>
    </field>
    <field name="type">
      <value>feature</value>
    </field>
    <field name="reporterName">
      <value>reporter.name</value>
    </field>
    <field name="numberInProject">
      <value>1863</value>
    </field>
    <field name="summary">
      <value>This is a dummy text</value>
    </field>
    <field name="priority">
      <value>1</value>
    </field>
    <field name="Platform">
      <value></value>
    </field>
    <field name="state">
      <value>Open</value>
    </field>
    <field name="Reproducibility">
      <value>Always</value>
    </field>
    <field name="fixedInBuild">
      <value></value>
    </field>
    <field name="OS version">
      <value></value>
    </field>
    <field name="assigneeName">
      <value>asignee.name</value>
    </field>
    <field name="Target Branch">
      <value>Trunk</value>
    </field>
    <field name="Severity">
      <value>Feature</value>
    </field>
  </issue>
</issues>
Traceback (most recent call last):
  File "mantis2youtrack.py", line 332, in <module>
    main()
  File "mantis2youtrack.py", line 18, in main
    mantis_port, mantis_login, mantis_pass, mantis_product_names)
  File "mantis2youtrack.py", line 296, in mantis2youtrack
    print target.importIssues(str(project_id), name + "Assignees", yt_issues)
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\youtrack\connection.py", line 250, in importIssues
    xml, 400).toxml()
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\youtrack\connection.py", line 47, in _reqXml
    response, content = self._req(method, url, body, ignoreStatus)
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\youtrack\connection.py", line 38, in _req
    response, content = self.http.request(self.baseUrl + url, method, headers=headers, body=body)
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\httplib2\__init__.py", line 1049, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\httplib2\__init__.py", line 853, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\YouTrack\MantisImport\youtrack-remote-api\python\httplib2\__init__.py", line 822, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "c:\Python26\lib\httplib.py", line 874, in request
    self._send_request(method, url, body, headers)
  File "c:\Python26\lib\httplib.py", line 914, in _send_request
    self.send(body)
  File "c:\Python26\lib\httplib.py", line 719, in send
    self.sock.sendall(str)
  File "<string>", line 1, in sendall
socket.error: [Errno 10053] An established connection was aborted by the software in your host machine

Please not that all Issues are printed to stdout as xml

Does anybody know how to fix this issue?

Kind Regards,

Markus

5 comments
Comment actions Permalink

Hello,

Can you provide youtrack.log file? You can find it in your home directory.

0
Comment actions Permalink

Thank you for youtrack.log, corresponding issue is http://youtrack.jetbrains.net/issue/JT-7926

0
Comment actions Permalink

I could not reproduce this exception, but I attached python client library with fix that should help.



Attachment(s):
youtrack-rest-api-python-2.1.4(2).zip
0
Comment actions Permalink

Many thanks! I will try this. The problem could also be in our data. Our Mantis database is approx 10 years old. Issues are related to each other, sometimes users are deleted (reporter, assignee and so on), related issues are deleted and our projects have many sub projects.

0
Comment actions Permalink

I've updated attachment in previous message to avoid problems with deleted users. But you'll need to allow anonymous access in your youtrack settings.

0

Please sign in to leave a comment.