Mysql OperationalError in RB3.0.3

17 views
Skip to first unread message

Hema

unread,
Jun 15, 2018, 6:21:24 AM6/15/18
to Review Board Community
We get the following mysql OperationalError often when there is a special character in the description field of review request.

------------------------------------------------------------------------------------------------------------------------------

Traceback (most recent call last):

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/core/handlers/base.py", line 112, in get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func

    response = view_func(request, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/views/decorators/vary.py", line 19, in inner_func

    response = func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/resources/base.py", line 243, in __call__

    request, method, view, api_format=api_format, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/ReviewBoard-3.0.3-py2.7.egg/reviewboard/webapi/base.py", line 338, in call_method_view

    request, method, view, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/resources/mixins/api_tokens.py", line 66, in call_method_view

    request, method, view, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/resources/mixins/oauth2_tokens.py", line 102, in call_method_view

    request, method, view, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/resources/base.py", line 314, in call_method_view

    return view(request, *args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/resources/base.py", line 496, in post

    return self.create(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 125, in _call

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/ReviewBoard-3.0.3-py2.7.egg/reviewboard/webapi/decorators.py", line 169, in _check

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 125, in _call

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 146, in _checklogin

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 125, in _call

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 125, in _call

    return view_func(*args, **kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/webapi/decorators.py", line 319, in _validate

    return view_func(*args, **new_kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/ReviewBoard-3.0.3-py2.7.egg/reviewboard/webapi/resources/review_request.py", line 777, in create

    review_request.save(update_counts=True)

 

  File "/opt/software/lib/python2.7/site-packages/ReviewBoard-3.0.3-py2.7.egg/reviewboard/reviews/models/review_request.py", line 805, in save

    super(ReviewRequest, self).save(**kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/ReviewBoard-3.0.3-py2.7.egg/reviewboard/reviews/models/base_review_request_details.py", line 547, in save

    super(BaseReviewRequestDetails, self).save(**kwargs)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/base.py", line 545, in save

    force_update=force_update, update_fields=update_fields)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/base.py", line 573, in save_base

    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/base.py", line 635, in _save_table

    forced_update)

 

  File "/opt/software/lib/python2.7/site-packages/Djblets-1.0.3-py2.7.egg/djblets/db/fields.py", line 862, in _model_do_update

    base_qs, using, pk_val, values, update_fields, forced_update)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/base.py", line 679, in _do_update

    return filtered._update(values) > 0

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/query.py", line 510, in _update

    return query.get_compiler(self.db).execute_sql(None)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/sql/compiler.py", line 980, in execute_sql

    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/models/sql/compiler.py", line 786, in execute_sql

    cursor.execute(sql, params)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/backends/util.py", line 53, in execute

    return self.cursor.execute(sql, params)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/utils.py", line 99, in __exit__

    six.reraise(dj_exc_type, dj_exc_value, traceback)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/backends/util.py", line 53, in execute

    return self.cursor.execute(sql, params)

 

  File "/opt/software/lib/python2.7/site-packages/Django-1.6.11-py2.7.egg/django/db/backends/mysql/base.py", line 124, in execute

    return self.cursor.execute(query, args)

 

  File "/opt/software/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/cursors.py", line 205, in execute

    self.errorhandler(self, exc, value)

 

  File "/opt/software/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/connections.py", line 36, in defaulterrorhandler

    raise errorclass, errorvalue

 

OperationalError: (1366, "Incorrect string value: '\\x93New-S...' for column 'description' at row 1")

------------------------------------------------------------------------------------------------------------------------------


MySQL [ReviewBoard]> show variables like '%colla%'\G

*************************** 1. row ***************************

Variable_name: collation_connection

        Value: utf8_general_ci

*************************** 2. row ***************************

Variable_name: collation_database

        Value: latin1_swedish_ci

*************************** 3. row ***************************

Variable_name: collation_server

        Value: latin1_swedish_ci

3 rows in set (0.00 sec)

------------------------------------------------------------------------------------------------------------------------------

MySQL [ReviewBoard]> show variables like '%charac%'\G

*************************** 1. row ***************************

Variable_name: character_set_client

        Value: utf8

*************************** 2. row ***************************

Variable_name: character_set_connection

        Value: utf8

*************************** 3. row ***************************

Variable_name: character_set_database

        Value: latin1

*************************** 4. row ***************************

Variable_name: character_set_filesystem

        Value: binary

*************************** 5. row ***************************

Variable_name: character_set_results

        Value: utf8

*************************** 6. row ***************************

Variable_name: character_set_server

        Value: latin1

*************************** 7. row ***************************

Variable_name: character_set_system

        Value: utf8

*************************** 8. row ***************************

Variable_name: character_sets_dir

        Value: /usr/share/mysql/charsets/

8 rows in set (0.00 sec)

------------------------------------------------------------------------------------------------------------------------------


We didn't face this issue in RB2.0. Could you please let us know what's wrong here?


Regards,

Hema.

Hema

unread,
Jun 18, 2018, 2:44:57 AM6/18/18
to Review Board Community
Can I get some pointers on this, please?

Regards,
Hema.

Christian Hammond

unread,
Jun 18, 2018, 4:48:42 PM6/18/18
to revie...@googlegroups.com
Hi Hema,

When you upgraded Review Board, did you do a dump and re-import of the database? Can you walk me through any steps you performed? This sort of problem is database-level, and should not have happened solely due to an upgrade.

This may be due to the encoding-related settings on the table. Can you show me the results of:

    SHOW CREATE TABLE reviews_reviewrequest;
    SHOW CREATE TABLE reviews_reviewrequestdraft;

Christian


--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Hemapriya

unread,
Jun 19, 2018, 4:21:39 AM6/19/18
to revie...@googlegroups.com
Actually, condensediffs command was taking longer and we faced slowness while viewing diffs in RB3.0.3 test instance. So, we upgraded mysql from 5.1 to 5.6. We also changed the storage engine from MyISAM to InnoDB. For this, we took the metadata of tables; changed the storage engine; created the tables and then loaded the data. We did this as we have huge data in database and changing the storage engine using alter command was taking longer.

MySQL [RAT_ReviewBoard_Prod]> SHOW CREATE TABLE reviews_reviewrequest\G
*************************** 1. row ***************************
       Table: reviews_reviewrequest
Create Table: CREATE TABLE `reviews_reviewrequest` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `submitter_id` int(11) NOT NULL,
  `time_added` datetime NOT NULL,
  `last_updated` datetime NOT NULL,
  `status` varchar(1) NOT NULL,
  `public` tinyint(1) NOT NULL,
  `changenum` int(10) unsigned DEFAULT NULL,
  `repository_id` int(11) DEFAULT NULL,
  `email_message_id` varchar(255) DEFAULT NULL,
  `time_emailed` datetime DEFAULT NULL,
  `summary` varchar(300) NOT NULL,
  `description` longtext NOT NULL,
  `testing_done` longtext NOT NULL,
  `bugs_closed` varchar(300) NOT NULL,
  `diffset_history_id` int(11) NOT NULL,
  `branch` varchar(300) NOT NULL,
  `last_review_timestamp` datetime DEFAULT NULL,
  `shipit_count` int(11) DEFAULT NULL,
  `client_name` varchar(100) NOT NULL,
  `client_root` varchar(300) NOT NULL,
  `local_site_id` int(11) DEFAULT NULL,
  `local_id` int(11) DEFAULT NULL,
  `commit_id` varchar(64) DEFAULT NULL,
  `rich_text` tinyint(1) NOT NULL,
  `extra_data` longtext,
  `issue_dropped_count` int(11) DEFAULT NULL,
  `issue_resolved_count` int(11) DEFAULT NULL,
  `issue_open_count` int(11) DEFAULT NULL,
  `description_rich_text` tinyint(1) NOT NULL,
  `testing_done_rich_text` tinyint(1) NOT NULL,
  `issue_verifying_count` int(11) DEFAULT NULL,
  `inactive_file_attachments_count` int(11) DEFAULT NULL,
  `file_attachments_count` int(11) DEFAULT NULL,
  `inactive_screenshots_count` int(11) DEFAULT NULL,
  `screenshots_count` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `changenum` (`changenum`,`repository_id`),
  UNIQUE KEY `reviews_reviewrequest_b8c24015` (`commit_id`,`repository_id`),
  UNIQUE KEY `reviews_reviewrequest_30fd075f` (`local_site_id`,`local_id`),
  KEY `reviews_reviewrequest_submitter_id` (`submitter_id`),
  KEY `reviews_reviewrequest_status` (`status`),
  KEY `reviews_reviewrequest_changenum` (`changenum`),
  KEY `reviews_reviewrequest_repository_id` (`repository_id`),
  KEY `reviews_reviewrequest_diffset_history_id` (`diffset_history_id`),
  KEY `reviews_reviewrequest_45ded6af` (`local_site_id`),
  KEY `reviews_reviewrequest_3b0377a9` (`commit_id`),
  KEY `reviews_reviewrequest_summary` (`summary`(255))
) ENGINE=InnoDB AUTO_INCREMENT=488029 DEFAULT CHARSET=latin1
1 row in set (0.00 sec)




MySQL [RAT_ReviewBoard_Prod]>  SHOW CREATE TABLE reviews_reviewrequestdraft;
+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table                      | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| reviews_reviewrequestdraft | CREATE TABLE `reviews_reviewrequestdraft` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `review_request_id` int(11) NOT NULL,
  `last_updated` datetime NOT NULL,
  `summary` varchar(300) NOT NULL,
  `description` longtext NOT NULL,
  `testing_done` longtext NOT NULL,
  `bugs_closed` varchar(300) NOT NULL,
  `diffset_id` int(11) DEFAULT NULL,
  `changedesc_id` int(11) DEFAULT NULL,
  `branch` varchar(300) NOT NULL,
  `client_name` varchar(100) NOT NULL,
  `client_root` varchar(300) NOT NULL,
  `changenum` int(10) unsigned DEFAULT NULL,
  `rich_text` tinyint(1) NOT NULL,
  `extra_data` longtext,
  `commit_id` varchar(64) DEFAULT NULL,
  `description_rich_text` tinyint(1) NOT NULL,
  `testing_done_rich_text` tinyint(1) NOT NULL,
  `owner_id` int(11) DEFAULT NULL,
  `inactive_file_attachments_count` int(11) DEFAULT NULL,
  `file_attachments_count` int(11) DEFAULT NULL,
  `inactive_screenshots_count` int(11) DEFAULT NULL,
  `screenshots_count` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `review_request_id` (`review_request_id`),
  KEY `reviews_reviewrequestdraft_diffset_id` (`diffset_id`),
  KEY `reviews_reviewrequestdraft_changedesc_id` (`changedesc_id`),
  KEY `reviews_reviewrequestdraft_changenum` (`changenum`),
  KEY `reviews_reviewrequestdraft_3b0377a9` (`commit_id`),
  KEY `reviews_reviewrequestdraft_f2f3f201` (`owner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1134297 DEFAULT CHARSET=latin1 |
+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)




You received this message because you are subscribed to a topic in the Google Groups "Review Board Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/Pl4M8MvrbTU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages