Sidekiq worker arguments get improperly casted to Strings
I'm not sure how I triggered this error, but it looks like there's an assumption that params[:push_options]
is a Hash in https://gitlab.com/gitlab-org/gitlab/blob/6a6b5d8c815848fb9ce469e40c866fd1e4fc231a/app/services/git/base_hooks_service.rb#L99, but somehow it got passed in as a string. Looking at https://gitlab.com/gitlab-org/gitlab/blob/f78af0fc6865fc3e58d2bbf3b4f6b911f45e3674/app/workers/post_receive.rb#L11, it seems like it could get passed in as String to Sidekiq?
{
"severity": "WARN",
"time": "2020-02-29T00:08:36.718Z",
"error_class": "NoMethodError",
"error_message": "undefined method `deep_symbolize_keys' for \"{}\":String",
"context": "Job raised exception",
"jobstr": "{\"class\":\"PostReceive\",\"args\":[\"project-142\",\"user-1\",\"0000000000000000000000000000000000000000 fdc3afa1043018158e00e04052fb3cac28107ea6 refs/heads/master\n\",{}],\"retry\":3,\"queue\":\"post_receive\",\"backtrace\":true,\"jid\":\"0fbe476f0944d1be849790a6\",\"created_at\":1582933648.310584,\"meta.user\":\"root\",\"meta.project\":\"root/test-project2\",\"meta.root_namespace\":\"root\",\"meta.subscription_plan\":\"default\",\"meta.caller_id\":\"/api/:version/internal/post_receive\",\"correlation_id\":\"181f6e54-6245-40e6-9163-24f4a1fd6ad5\",\"uber-trace-id\":\"74050efe3541a7b1:b26e037c8b378978:74050efe3541a7b1:1\",\"enqueued_at\":1582933648.3401659}",
"class": "PostReceive",
"args": [
"project-142",
"user-1",
"0000000000000000000000000000000000000000 fdc3afa1043018158e00e04052fb3cac28107ea6 refs/heads/master\n",
"{}"
],
"retry": 3,
"queue": "post_receive",
"backtrace": true,
"jid": "0fbe476f0944d1be849790a6",
"created_at": "2020-02-28T23:47:28.310Z",
"meta.user": "root",
"meta.project": "root/test-project2",
"meta.root_namespace": "root",
"meta.subscription_plan": "default",
"meta.caller_id": "/api/:version/internal/post_receive",
"correlation_id": "181f6e54-6245-40e6-9163-24f4a1fd6ad5",
"uber-trace-id": "74050efe3541a7b1:b26e037c8b378978:74050efe3541a7b1:1",
"enqueued_at": "2020-02-28T23:47:28.340Z",
"error_backtrace": [
"app/services/git/base_hooks_service.rb:99:in `block in ci_variables_from_push_options'",
"lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'",
"app/services/git/base_hooks_service.rb:98:in `ci_variables_from_push_options'",
"app/services/git/base_hooks_service.rb:104:in `generate_vars_from_push_options'",
"app/services/git/base_hooks_service.rb:89:in `block in pipeline_params'",
"lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'",
"app/services/git/base_hooks_service.rb:84:in `pipeline_params'",
"app/services/git/base_hooks_service.rb:60:in `create_pipelines'",
"app/services/git/base_hooks_service.rb:13:in `execute'",
"app/services/git/branch_hooks_service.rb:8:in `execute'",
"app/services/git/branch_push_service.rb:62:in `execute_related_hooks'",
"app/services/git/branch_push_service.rb:28:in `execute'",
"ee/app/services/ee/git/branch_push_service.rb:13:in `execute'",
"app/services/git/process_ref_changes_service.rb:55:in `block in process_changes'",
"app/services/git/process_ref_changes_service.rb:46:in `each'",
"app/services/git/process_ref_changes_service.rb:46:in `process_changes'",
"app/services/git/process_ref_changes_service.rb:20:in `block in process_changes_by_action'",
"app/services/git/process_ref_changes_service.rb:19:in `each'",
"app/services/git/process_ref_changes_service.rb:19:in `process_changes_by_action'",
"app/services/git/process_ref_changes_service.rb:10:in `execute'",
"app/workers/post_receive.rb:83:in `process_ref_changes'",
"app/workers/post_receive.rb:55:in `process_project_changes'",
"app/workers/post_receive.rb:28:in `perform'",
"lib/gitlab/with_request_store.rb:7:in `with_request_store'",
"lib/gitlab/sidekiq_daemon/monitor.rb:49:in `within_job'"
]
}
Edited by Stan Hu