Can't get comments after updating to GitLab CE Omnibus to 12.x

Hello everyone, after upgrading to GitLab 12.0.X Anyone can’t get the comments from an issue or from a MergeRequest.

The given error is the following one: “Something went wrong while fetching comments. Please try again.”

This is the error traced in production.log:
* Started GET “/-/peek/results?request_id=ZvGBovge1j9” for 172.17.10.212 at 2019-07-17 19:55:24 +0200
* Processing by Peek::ResultsController#show as JSON
* Parameters: {“request_id”=>“ZvGBovge1j9”}
* NoMethodError (undefined method to_sym' for nil:NilClass): * config/initializers/config_initializers_active_record_locking.rb:13:in _update_row’
* app/models/resource_label_event.rb:72:in refresh_invalid_reference' * lib/gitlab/metrics/instrumentation.rb:161:in block in refresh_invalid_reference’
* lib/gitlab/metrics/method_call.rb:36:in measure' * lib/gitlab/metrics/instrumentation.rb:161:in refresh_invalid_reference’
* app/models/label_note.rb:59:in block in update_outdated_markdown' * app/models/label_note.rb:57:in each’
* app/models/label_note.rb:57:in update_outdated_markdown' * lib/gitlab/metrics/instrumentation.rb:161:in block in update_outdated_markdown’
* lib/gitlab/metrics/method_call.rb:36:in measure' * lib/gitlab/metrics/instrumentation.rb:161:in update_outdated_markdown’
* app/models/label_note.rb:31:in events=' * lib/gitlab/metrics/instrumentation.rb:161:in block in events=’
* lib/gitlab/metrics/method_call.rb:36:in measure' * lib/gitlab/metrics/instrumentation.rb:161:in events=’
* app/models/label_note.rb:25:in from_events' * lib/gitlab/metrics/instrumentation.rb:161:in block in from_events’
* lib/gitlab/metrics/method_call.rb:36:in measure' * lib/gitlab/metrics/instrumentation.rb:161:in from_events’
* app/services/resource_events/merge_into_notes_service.rb:29:in block in label_notes' * app/services/resource_events/merge_into_notes_service.rb:28:in each’
* app/services/resource_events/merge_into_notes_service.rb:28:in map' * app/services/resource_events/merge_into_notes_service.rb:28:in label_notes’
* app/services/resource_events/merge_into_notes_service.rb:22:in execute' * app/controllers/concerns/issuable_actions.rb:110:in discussions’
* app/controllers/projects/merge_requests_controller.rb:212:in discussions' * lib/gitlab/session.rb:11:in with_session’
* app/controllers/application_controller.rb:445:in set_session_storage' * lib/gitlab/i18n.rb:55:in with_locale’
* lib/gitlab/i18n.rb:61:in with_user_locale' * app/controllers/application_controller.rb:439:in set_locale’
* lib/gitlab/middleware/rails_queue_duration.rb:27:in call' * lib/gitlab/metrics/rack_middleware.rb:17:in block in call’
* lib/gitlab/metrics/transaction.rb:57:in run' * lib/gitlab/metrics/rack_middleware.rb:17:in call’
* lib/gitlab/middleware/multipart.rb:103:in call' * lib/gitlab/request_profiler/middleware.rb:16:in call’
* lib/gitlab/middleware/go.rb:20:in call' * lib/gitlab/etag_caching/middleware.rb:13:in call’
* lib/gitlab/middleware/correlation_id.rb:16:in block in call' * lib/gitlab/middleware/correlation_id.rb:15:in call’
* lib/gitlab/middleware/read_only/controller.rb:40:in call' * lib/gitlab/middleware/read_only.rb:18:in call’
* lib/gitlab/middleware/basic_health_check.rb:25:in call' * lib/gitlab/request_context.rb:26:in call’
* lib/gitlab/metrics/requests_rack_middleware.rb:29:in call' * lib/gitlab/middleware/release_env.rb:12:in call’

And this is the output of gitlab env:

System information
System:         Ubuntu 18.04
Current User:   git
Using RVM:      no
Ruby Version:   2.6.3p62
Gem Version:    2.7.9
Bundler Version:1.17.3
Rake Version:   12.3.2
Redis Version:  3.2.12
Git Version:    2.21.0
Sidekiq Version:5.2.7
Go Version:     go1.10.4 linux/amd64

GitLab information
Version:        12.0.3
Revision:       08a51a9db93
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     9.6.11
URL:            https://gitlab.domain.com
HTTP Clone URL: https://gitlab.domain.com/some-group/some-project.git
SSH Clone URL:  git@gitlab.domain.com:some-group/some-project.git
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        9.3.0
Repository storage paths:
- default:      /var/opt/gitlab/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git

Anyone can help find out whats going wrong?. Thank you in advance!

Hi everyone!

This is the error log line from postgresql

2019-07-24_11:27:42.68313 ERROR:  zero-length delimited identifier at or near """" at character 592
2019-07-24_11:27:42.68317 STATEMENT:  UPDATE "resource_label_events" SET "reference" = '~470', "cached_markdown_version" = 1048576, "reference_html" = '<a href="/puppet/m4chocolatey/issues?label_name=Performance" data-original="~470" data-link="false" data-link-reference="false" data-project="105" data-label="470" data-reference-type="label" data-container="body" data-placement="bottom" title="" class="gfm gfm-label has-tooltip"><span class="badge color-label has-tooltip" data-html="true" style="background-color: #69D100; color: #FFFFFF" title="" data-container="body">Performance</span></a>' WHERE "resource_label_events"."" = 23