MetricsGrimoire / Bicho

Bicho is a command line based tool used to parse bug/issue tracking systems
http://metricsgrimoire.github.com/Bicho/
GNU General Public License v2.0
71 stars 31 forks source link

Error when mining a specific issue from Apache's Jira #131

Closed rodrigokuroda closed 10 years ago

rodrigokuroda commented 10 years ago

I had error the following issue when I mining one issue from DERBY project:

DBG: [21/Jul/2014-23:27:51] Bug activity: https://issues.apache.org/jira/browse/DERBY-4183?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/jira.py", line 888, in analyze_bug_list
    bugsdb.insert_issue(issue, dbtrk_id)
  File "/usr/local/lib/python2.7/dist-packages/bicho/db/database.py", line 195, in insert_issue
    db_comment = self._get_db_comment(comment, db_issue.id, tracker_id)
  File "/usr/local/lib/python2.7/dist-packages/bicho/db/database.py", line 484, in _get_db_comment
    DBComment.text == comment.comment,
  File "/usr/lib/python2.7/dist-packages/storm/expr.py", line 412, in __eq__
    other = getattr(self, "variable_factory", Variable)(value=other)
  File "/usr/lib/python2.7/dist-packages/storm/variables.py", line 396, in parse_set
    % (type(value), value))
TypeError: Expected unicode, found <type 'str'>: ''

I suppose according to error message that is an encoding issue. Am I right? Is there another way to prevent it? Thanks. PS: MySQL is configured to use UTF-8 encoding.

mysql> show variables where variable_name like "collation%" or variable_name like "char%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_unicode_ci            |
| collation_database       | utf8_unicode_ci            |
| collation_server         | utf8_unicode_ci            |
+--------------------------+----------------------------+
11 rows in set (0.00 sec)

mysql> 
sduenas commented 10 years ago

This one is related to issue #133.

I used two types of database configurations without getting any problem.

CREATE DATABASE test2 CHARACTER SET utf8 COLLATE utf8_unicode_ci;

mysql> show variables where variable_name like "collation%" or variable_name like "char%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
| collation_connection     | utf8_general_ci            |
| collation_database       | utf8_unicode_ci            |
| collation_server         | latin1_swedish_ci          |
+--------------------------+----------------------------+
11 rows in set (0.00 sec)

sduenas@Guybrush:~/devel/grimoire/bicho$ bicho --db-user-out=XXXXXX --db-password-out=XXXXXX --db-database-out=test2 -d 2 -g -b jira -u https://issues.apache.org/jira/browse/DERBY-4183
Checking URL: https://issues.apache.org
DBG: [23/Sep/2014-17:23:32] Bicho object created, options and backend initialized
Running Bicho with delay of 2 seconds
DBG: [23/Sep/2014-17:23:32] https://issues.apache.org/jira/si/jira.issueviews:issue-xml/DERBY-4183/DERBY-4183.xml
DBG: [23/Sep/2014-17:23:33] Bug activity: https://issues.apache.org/jira/browse/DERBY-4183?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel

@rodrigokuroda, can you check it again, please?

sduenas commented 10 years ago

Closed because is a duplicate of #133.