FrozenError during Projects::MergeRequestsController#update
Summary
Bug report from customer ticket 137679 (internal).
Closing a merge request results in a 500 error, but the MR is successfully closed. Refreshing the page shows a closed MR after the 500.
Following is logged in production log:
Processing by Projects::MergeRequestsController#update as HTML
Parameters: {"authenticity_token"=>"[FILTERED]", "merge_request"=>{"state_event"=>"reopen"}, "namespace_id"=>"midl", "project_id"=>"quotms", "id"=>"26"}
Completed 500 Internal Server Error in 62ms (ActiveRecord: 15.5ms | Elasticsearch: 0.0ms)
FrozenError (can't modify frozen String):
app/services/system_note_service.rb:245:in `change_status'
app/services/merge_requests/base_service.rb:6:in `create_note'
lib/gitlab/metrics/instrumentation.rb:161:in `block in create_note'
lib/gitlab/metrics/method_call.rb:36:in `measure'
lib/gitlab/metrics/instrumentation.rb:161:in `create_note'
...
...
Exact same issue was reported in similar issue #64726, but closed without follow-up information or resolution.
If it's relevant, this server is running MySQL (see env)
Steps to reproduce
Change the status of a MR to either closed, or reopened, results in the 500. I have not been able to replicate in a test environment, but I also haven't fully replicated the users exact env (see below).
What is the current bug behavior?
Status change of merge request results in 500 error to the frontend, but the MR is successfully changed
What is the expected correct behavior?
No 500 error during status change
Relevant logs and/or screenshots
Processing by Projects::MergeRequestsController#update as HTML Parameters: {"authenticity_token"=>"[FILTERED]", "merge_request"=>{"state_event"=>"reopen"}, "namespace_id"=>"midl", "project_id"=>"quotms", "id"=>"26"} Completed 500 Internal Server Error in 62ms (ActiveRecord: 15.5ms | Elasticsearch: 0.0ms)FrozenError (can't modify frozen String):
app/services/system_note_service.rb:245:in
change_status' app/services/merge_requests/base_service.rb:6:in
create_note' lib/gitlab/metrics/instrumentation.rb:161:inblock in create_note' lib/gitlab/metrics/method_call.rb:36:in
measure' lib/gitlab/metrics/instrumentation.rb:161:increate_note' app/services/merge_requests/reopen_service.rb:10:in
execute' lib/gitlab/metrics/instrumentation.rb:161:inblock in execute' lib/gitlab/metrics/method_call.rb:36:in
measure' lib/gitlab/metrics/instrumentation.rb:161:inexecute' app/services/issuable_base_service.rb:313:in
change_state' app/services/issuable_base_service.rb:194:inupdate' app/services/merge_requests/update_service.rb:24:in
execute' ee/app/services/ee/merge_requests/update_service.rb:17:inexecute' app/controllers/projects/merge_requests_controller.rb:109:in
update' lib/gitlab/session.rb:11:inwith_session' app/controllers/application_controller.rb:439:in
set_session_storage' lib/gitlab/i18n.rb:55:inwith_locale' lib/gitlab/i18n.rb:61:in
with_user_locale' app/controllers/application_controller.rb:435:inset_locale' lib/gitlab/middleware/rails_queue_duration.rb:27:in
call' lib/gitlab/metrics/rack_middleware.rb:17:inblock in call' lib/gitlab/metrics/transaction.rb:57:in
run' lib/gitlab/metrics/rack_middleware.rb:17:incall' lib/gitlab/middleware/multipart.rb:103:in
call' lib/gitlab/request_profiler/middleware.rb:16:incall' ee/lib/gitlab/jira/middleware.rb:17:in
call' lib/gitlab/middleware/go.rb:20:incall' lib/gitlab/etag_caching/middleware.rb:13:in
call' lib/gitlab/middleware/correlation_id.rb:16:inblock in call' lib/gitlab/middleware/correlation_id.rb:15:in
call' lib/gitlab/middleware/read_only/controller.rb:42:incall' lib/gitlab/middleware/read_only.rb:18:in
call' lib/gitlab/middleware/basic_health_check.rb:25:incall' lib/gitlab/request_context.rb:26:in
call' lib/gitlab/metrics/requests_rack_middleware.rb:29:incall' lib/gitlab/middleware/release_env.rb:12:in
call'
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 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: unknown
GitLab information Version: 11.11.0-ee Revision: deb6f84e91f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: MySQL DB Version: 5.6.39-log URL: http://192.168.188.74 HTTP Clone URL: http://192.168.188.74/some-group/some-project.git SSH Clone URL: git@192.168.188.74:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 9.1.0 Repository storage paths: default: /app/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.1.0 ? ... OK (9.1.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /app/gitlab/ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 1/1 ... yes 1/2 ... yes 4/3 ... yes 5/4 ... yes 7/5 ... yes 12/7 ... yes 12/9 ... yes 12/11 ... yes 4/13 ... yes 12/14 ... yes 1/15 ... yes 12/17 ... yes 12/18 ... yes 1/19 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.5.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 11 Elasticsearch version 5.6 - 6.x? ... Exception: Connection refused - Connection refused - connect(2) for "192.168.135.105" port 9200 (192.168.135.105:9200) #我的gitlab工作在vip上,所以连接不到这个地址
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished