Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1' #1688

Closed
tychota opened this Issue Feb 18, 2018 · 12 comments

Comments

Projects
8 participants
@tychota
Copy link

tychota commented Feb 18, 2018

Setup used

Infos

[Mailer config] Host:     redacted
[Mailer config] Protocol: https://
Evaluated configuration:
---
email:
  from: portus@example.com
  name: Portus
  reply_to: no-reply@example.com
  smtp:
    enabled: false
    address: smtp.example.com
    port: 587
    user_name: username@example.com
    password: "****"
    domain: example.com
gravatar:
  enabled: true
delete:
  enabled: false
ldap:
  enabled: false
  hostname: ldap_hostname
  port: 389
  method: plain
  base: ''
  filter: ''
  uid: uid
  authentication:
    enabled: false
    bind_dn: ''
    password: "****"
  guess_email:
    enabled: false
    attr: ''
oauth:
  google_oauth2:
    enabled: false
    id: ''
    secret: ''
    domain: ''
    options:
      hd: ''
  open_id:
    enabled: false
    identifier: ''
    domain: ''
  github:
    enabled: false
    client_id: ''
    client_secret: ''
    organization: ''
    team: ''
    domain: ''
  gitlab:
    enabled: false
    application_id: ''
    secret: ''
    group: ''
    domain: ''
    server: ''
  bitbucket:
    enabled: false
    key: ''
    secret: ''
    domain: ''
    options:
      team: ''
first_user_admin:
  enabled: true
signup:
  enabled: true
check_ssl_usage:
  enabled: false
registry:
  jwt_expiration_time:
    value: 5
  catalog_page:
    value: 100
  timeout:
    value: 2
  read_timeout:
    value: 120
machine_fqdn:
  value: redacted
display_name:
  enabled: false
user_permission:
  change_visibility:
    enabled: true
  create_team:
    enabled: true
  manage_team:
    enabled: true
  create_namespace:
    enabled: true
  manage_namespace:
    enabled: true
security:
  clair:
    server: ''
    health_port: 6061
  zypper:
    server: ''
  dummy:
    server: ''
anonymous_browsing:
  enabled: true
background:
  registry:
    enabled: true
  sync:
    enabled: true
    sync-strategy: initial

Portus version: 2.3.0@dd4b1644c8f275a5c851f7329c547f6317a0648f

Impact

Not sure what are the consequences

Logs

After a success push (Handling "push" event), I see this logs in background image

crono_1     | /srv/Portus/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query': Mysql2::Error: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1': SELECT COUNT(*) FROM `tags` WHERE (name COLLATE utf8_bin = 'latest' AND repository_id = 1) (ActiveRecord::StatementInvalid)
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `block in query'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `handle_interrupt'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `query'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:317:in `block in execute'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:317:in `execute'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/mysql2_adapter.rb:217:in `execute'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/mysql2_adapter.rb:221:in `exec_query'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:356:in `select'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/calculations.rb:270:in `execute_simple_calculation'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/calculations.rb:227:in `perform_calculation'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/calculations.rb:133:in `calculate'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/calculations.rb:48:in `count'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation.rb:268:in `empty?'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation.rb:278:in `any?'
crono_1     | 	from /srv/Portus/app/validators/unique_tag_validator.rb:19:in `validate_each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validator.rb:151:in `block in validate'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validator.rb:148:in `each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validator.rb:148:in `validate'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:455:in `public_send'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:455:in `block in make_lambda'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:192:in `block in simple'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:504:in `block in call'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:504:in `each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:504:in `call'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:778:in `_run_validate_callbacks'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validations.rb:399:in `run_validations!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validations/callbacks.rb:113:in `block in run_validations!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.10/lib/active_support/callbacks.rb:778:in `_run_validation_callbacks'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validations/callbacks.rb:113:in `run_validations!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activemodel-4.2.10/lib/active_model/validations.rb:338:in `valid?'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/validations.rb:58:in `valid?'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/validations.rb:83:in `perform_validations'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/validations.rb:37:in `save'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/attribute_methods/dirty.rb:21:in `save'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:220:in `transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:286:in `block in save'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:285:in `save'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/has_many_association.rb:41:in `insert_record'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:506:in `block (2 levels) in _create_record'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:419:in `replace_on_target'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:414:in `add_to_target'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:504:in `block in _create_record'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:194:in `block in transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:220:in `transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:193:in `transaction'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:503:in `_create_record'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/has_many_association.rb:187:in `_create_record'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_association.rb:164:in `create'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/associations/collection_proxy.rb:290:in `create'
crono_1     | 	from /srv/Portus/app/models/repository.rb:152:in `add_repo'
crono_1     | 	from /srv/Portus/app/models/repository.rb:101:in `handle_push_event'
crono_1     | 	from /srv/Portus/app/models/registry_event.rb:35:in `block in handle!'
crono_1     | 	from /srv/Portus/app/models/registry_event.rb:35:in `each'
crono_1     | 	from /srv/Portus/app/models/registry_event.rb:35:in `handle!'
crono_1     | 	from /srv/Portus/lib/portus/background/registry.rb:30:in `block in execute!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/batches.rb:51:in `block (2 levels) in find_each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/batches.rb:51:in `each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/batches.rb:51:in `block in find_each'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/batches.rb:124:in `find_in_batches'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/relation/batches.rb:50:in `find_each'
crono_1     | 	from /srv/Portus/lib/portus/background/registry.rb:28:in `execute!'
crono_1     | 	from /srv/Portus/bin/background.rb:56:in `block (2 levels) in <top (required)>'
crono_1     | 	from /srv/Portus/bin/background.rb:54:in `each'
crono_1     | 	from /srv/Portus/bin/background.rb:54:in `each_with_index'
crono_1     | 	from /srv/Portus/bin/background.rb:54:in `block in <top (required)>'
crono_1     | 	from /srv/Portus/bin/background.rb:53:in `loop'
crono_1     | 	from /srv/Portus/bin/background.rb:53:in `<top (required)>'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/runner.rb:60:in `load'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/runner.rb:60:in `<top (required)>'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:123:in `require'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:90:in `runner'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
crono_1     | 	from /srv/Portus/vendor/bundle/ruby/2.5.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'
crono_1     | 	from bin/rails:12:in `require'
crono_1     | 	from bin/rails:12:in `<main>'
crono_1     | RuntimeError: Something went wrong while invoking: /srv/Portus/vendor/bundle/ruby/2.5.0/bin/bundler.ruby2.5 exec rails r /srv/Portus/bin/background.rb
crono_1     |   /srv/Portus/packaging/suse/portusctl/lib/runner.rb:12:in `exec'
crono_1     |   /srv/Portus/packaging/suse/portusctl/lib/runner.rb:34:in `block in bundler_exec'
crono_1     |   /srv/Portus/packaging/suse/portusctl/lib/runner.rb:30:in `chdir'
crono_1     |   /srv/Portus/packaging/suse/portusctl/lib/runner.rb:30:in `bundler_exec'
crono_1     |   /srv/Portus/packaging/suse/portusctl/lib/cli.rb:272:in `exec'
crono_1     |   /srv/Portus/vendor/bundle/ruby/2.5.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
crono_1     |   /srv/Portus/vendor/bundle/ruby/2.5.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
crono_1     |   /srv/Portus/vendor/bundle/ruby/2.5.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
crono_1     |   /srv/Portus/vendor/bundle/ruby/2.5.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
crono_1     |   packaging/suse/portusctl/bin/portusctl:6:in `<top (required)>'
crono_1     | bundler: failed to load command: packaging/suse/portusctl/bin/portusctl (packaging/suse/portusctl/bin/portusctl)
@mssola

This comment has been minimized.

Copy link
Collaborator

mssola commented Feb 19, 2018

This is something that we had to workaround from the official mariadb docker image. That is, we have to make sure that it uses utf. In our examples (see this one) we use the following command:

command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0

This is the easiest way to fix this that we found (after checking the issues and comments for this image). Maybe there are better/easier ways to fix this? Anyways, this is a good thing to document before the final release.

Please confirm whether the above solution works for you 😃

@Vad1mo

This comment has been minimized.

Copy link
Contributor

Vad1mo commented Feb 20, 2018

IMHO
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
is not the right Approach as its a global setting for all databases. If someone happens to have a shared DB, which not such an uncommon case. Portus will dictate the further setup.

However I think the right way is to extend rake db:create to create a DB in the right character set and collation. In this case we don't have to bother with that on the global level. Also the db:status could check if the db is in the right format and complain otherwise.

Example:

default: &default
  adapter: mysql2
  pool: 5
  encoding: utf8mb4
  charset: utf8mb4
  collation: utf8mb4_unicode_ci
  socket: /tmp/mysql.sock
@mssola

This comment has been minimized.

Copy link
Collaborator

mssola commented Feb 20, 2018

It's bad, yeah, but I already tried your example configuration when we first encountered this and it doesn't work for me. It looks like mariadb has to be called with that command (or to provide an alternative my.cnf), or otherwise the encoding, the charset and the collation will be messed up 😞

PostgreSQL doesn't have this, so using PostgreSQL instead of MariaDB might be a good option when starting as well 😅

@Vesli

This comment has been minimized.

Copy link

Vesli commented Apr 11, 2018

Hey, I've tried to start the mariaDB container with the command you pointed out above, but my portus background continues on restarting and displaying:

/srv/Portus/vendor/bundle/ruby/2.5.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in _query': Mysql2::Error: COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1': SELECT COUNT(*) FROM tags` WHERE (name COLLATE utf8_bin = 'latest' AND repository_id = 4) (ActiveRecord::StatementInvalid)
11/04/2018 12:28:21bundler: failed to load command: packaging/suse/portusctl/bin/portusctl (packaging/suse/portusctl/bin/portusctl)

:'(

@Vad1mo

This comment has been minimized.

Copy link
Contributor

Vad1mo commented Apr 11, 2018

@Vesli you have to create the db when those setting are set. so execute rake db:drop and rake db:setup

@Vesli

This comment has been minimized.

Copy link

Vesli commented Apr 11, 2018

In the main portus application, I wanted to use both command, but I received this error message:

rake aborted!
LoadError: cannot load such file -- bundler/setup
/srv/Portus/config/boot.rb:5:in <top (required)>' /srv/Portus/config/application.rb:3:in <top (required)>'
/srv/Portus/Rakefile:6:in `<top (required)>'
(See full trace by running task with --trace)

With --trace:

rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:698:in raw_load_rakefile' /usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:104:in block in load_rakefile'
/usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:186:in standard_exception_handling' /usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:103:in load_rakefile'
/usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:82:in block in run' /usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:186:in standard_exception_handling'
/usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/lib/rake/application.rb:80:in run' /usr/lib64/ruby/gems/2.5.0/gems/rake-12.3.0/exe/rake:27:in <top (required)>'
/usr/bin/rake:23:in load
/usr/bin/rake:23:in main

Do I need to stop Portus first?

@aleksejlopasov

This comment has been minimized.

Copy link

aleksejlopasov commented Apr 27, 2018

--character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;'
really helps, but it was not an obvious solution for smb like me ;)
Will it be fixed in future?

@mssola

This comment has been minimized.

Copy link
Collaborator

mssola commented Apr 30, 2018

Moving to the 2.4 project, but I haven't found a proper good solution yet (it's either global or a complete hack...).

@mssola mssola added this to To do in 2.4 Apr 30, 2018

@zstyblik

This comment has been minimized.

Copy link

zstyblik commented Jul 27, 2018

Actually, it seems you can change the charset as per https://www.a2hosting.com/kb/developer-corner/mysql/convert-mysql-database-utf-8.

Also, you've got to be joking with rake db:drop.

@agherzan

This comment has been minimized.

Copy link

agherzan commented Aug 16, 2018

What is the impact of this issue? In my setup, I can't use such a global configuration.

@mssola mssola moved this from To do to In progress in 2.4 Sep 5, 2018

@mssola

This comment has been minimized.

Copy link
Collaborator

mssola commented Sep 5, 2018

Documentation already contains information about this (see this). As for a less hackish solution, I'm open to ideas. For now, I haven't found a solution that works and that is more elegant than the one described above... Thank you everybody for the feedback.

What is the impact of this issue? In my setup, I can't use such a global configuration.

The recommended setup is with docker containers, and in that case you can use the following command to start the MariaDB container:

command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0

This has already been written in our examples. Hope it helps.

@mssola mssola closed this Sep 5, 2018

2.4 automation moved this from In progress to Done Sep 5, 2018

@maticmeznar

This comment has been minimized.

Copy link

maticmeznar commented Sep 13, 2018

@mssola utf8 encoding should never be used with MySQL/MariaDB, because it's broken. utf8mb4 should be used instead.

https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434
https://www.eversql.com/mysql-utf8-vs-utf8mb4-whats-the-difference-between-utf8-and-utf8mb4/

I was able to fix this bug by changing the COLLATION of portus tables to utf8_bin since I run my MariaDB with "--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci" command line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.