Mysql error upgrading from 9.5 to 10.1
I get this error after upgrade 9.5 to 10.1:
==> production.log <==
ActionView::Template::Error (Mysql2::Error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=': SELECT `events`.* FROM `events` INNER JOIN `push_event_payloads` ON `push_event_payloads`.`event_id` = `events`.`id` WHERE `events`.`action` IN (5) AND (NOT EXISTS (SELECT 1 FROM `merge_requests` WHERE `merge_requests`.`deleted_at` IS NULL AND (merge_requests.source_project_id = events.project_id) AND (merge_requests.source_branch = push_event_payloads.ref))) AND `push_event_payloads`.`action` IN (2, 0) AND `push_event_payloads`.`ref_type` = 0 AND `events`.`id` = 57922 LIMIT 1):
1: - event = last_push_event
2: - if event && show_last_push_widget?(event)
3: .row-content-block.top-block.hidden-xs.white
4: .event-last-push
config/initializers/connection_fix.rb:20:in `execute'
app/services/users/last_push_event_service.rb:62:in `find_event_in_database'
app/services/users/last_push_event_service.rb:47:in `find_cached_event'
app/services/users/last_push_event_service.rb:30:in `last_event_for_user'
app/models/user.rb:687:in `recent_push'
app/helpers/projects_helper.rb:143:in `last_push_event'
app/views/projects/_last_push.html.haml:1:in `_app_views_projects__last_push_html_haml__3983927651486954531_47312233557260'
app/views/dashboard/projects/index.html.haml:10:in `_app_views_dashboard_projects_index_html_haml__3285765044640251629_47312234872000'
app/controllers/dashboard/projects_controller.rb:10:in `index'
app/controllers/root_controller.rb:18:in `block in index'
lib/gitlab/gitaly_client.rb:193:in `allow_n_plus_1_calls'
app/controllers/root_controller.rb:17:in `index'
lib/gitlab/i18n.rb:47:in `with_locale'
lib/gitlab/i18n.rb:53:in `with_user_locale'
app/controllers/application_controller.rb:337:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:30:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
My config/database.yml and mysql selects:
production:
adapter: mysql2
database: "gitlab"
username: gitlab
password: "gitlab"
host: localhost
encoding: utf8
mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+-----------------+
| 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 |
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+--------------------------+-----------------+
10 rows in set (0.01 sec)
mysql> SELECT @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8 | utf8_general_ci |
+--------------------------+----------------------+
1 row in set (0.00 sec)
mysql> use gitlab;
mysql> show variables like "character_set_database";
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| character_set_database | utf8 |
+------------------------+-------+
mysql> show table status like 'push_event_payloads';
+---------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+---------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| push_event_payloads | InnoDB | 10 | Dynamic | 14067 | 187 | 2637824 | 0 | 0 | 4194304 | NULL | 2017-10-23 14:04:42 | 2017-10-23 14:22:53 | NULL | utf8_unicode_ci | NULL | | |
+---------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)
The database was created by:
CREATE DATABASE IF NOT EXISTS `gitlab` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
Following this guide (https://docs.gitlab.com/ce/install/database_mysql.html#tables-and-data-conversion-to-utf8mb4) I get same error.
Edited by pacolotero