Still seeing UTF-8 issues in QA tests
This happened again during today's demo.
The QA tests did also fail with 500s, but we were unable to view MRs from the UI. The error we were getting was:
ActiveRecord::StatementInvalid (PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8": 0x98
: SELECT "notes".* FROM (SELECT "notes".* FROM "notes" WHERE "notes"."noteable_id" = 4 AND "notes"."noteable_type" = 'MergeRequest'
UNION ALL
SELECT "notes".* FROM "notes" WHERE "notes"."project_id" IN (16, 16) AND "notes"."noteable_type" = 'Commit' AND "notes"."commit_id" = 'RqI^��&~� ������<��O') notes ORDER BY "notes"."created_at" ASC, "notes"."id" ASC):
app/models/discussion.rb:25:in `build_collection'
app/models/note.rb:135:in `discussions'
app/models/concerns/noteable.rb:40:in `discussions'
app/controllers/projects/merge_requests_controller.rb:49:in `block (2 levels) in show'
app/controllers/projects/merge_requests_controller.rb:41:in `show'
lib/gitlab/i18n.rb:50:in `with_locale'
lib/gitlab/i18n.rb:56:in `with_user_locale'
app/controllers/application_controller.rb:335:in `set_locale'
lib/gitlab/middleware/multipart.rb:95:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
ee/lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only/controller.rb:28:in `call'
lib/gitlab/middleware/read_only.rb:16:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
lib/gitlab/middleware/release_env.rb:10:in `call'
Which we have tried to fix a couple time: https://gitlab.com/charts/gitlab/issues/372
The error is not reproducable from the rails console, even while the same unicorn pod is having the issue.
(Tried with MergeRequest.find(<id>).discussions
and Gitlab.I18n.with_locale('en') { MergeRequest.find(<id>).discussions }
) and didn't see any failures.
And if fact if you restart the unicorn pod, or just kill and restart the unicorn process. The errors are resolved.