Mysterious TypeError: no _dump_data is defined for class OpenSSL::Digest

Mysterious TypeError: no _dump_data is defined for class OpenSSL::Digest

我们最近发现此错误越来越频繁地出现 - 但并非始终如一,并且无法手动重现。

我们在 Ruby 2.6.5 上的 Rails 应用程序 (5.2.3) 上有一个标准 Ruby。

我已经阅读了所有其他标题相似的帖子,但我不知道这是从哪里来的,这里是我们的堆栈跟踪:

/gems/activesupport-5.2.3/lib/active_support/cache.rb:784 in dump
/gems/activesupport-5.2.3/lib/active_support/cache.rb:784 in compress!
/gems/activesupport-5.2.3/lib/active_support/cache.rb:722 in initialize
/gems/activesupport-5.2.3/lib/active_support/cache.rb:445 in new
/gems/activesupport-5.2.3/lib/active_support/cache.rb:445 in block in write
/gems/activesupport-5.2.3/lib/active_support/cache.rb:663 in block in instrument
/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170 in instrument
/gems/activesupport-5.2.3/lib/active_support/cache.rb:663 in instrument
/gems/activesupport-5.2.3/lib/active_support/cache.rb:444 in write
/gems/ddtrace-0.29.1/lib/ddtrace/contrib/active_support/cache/instrumentation.rb:120 in write
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:97 in _fetch
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:87 in fetch
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:81 in translate
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:41 in translate
/gems/i18n-1.8.3/lib/i18n.rb:206 in block in translate
/gems/i18n-1.8.3/lib/i18n.rb:202 in catch
/gems/i18n-1.8.3/lib/i18n.rb:202 in translate
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:146 in block in resolve
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:143 in catch
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:143 in resolve
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:129 in block in default
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:128 in each
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:128 in default
/gems/i18n-1.8.3/lib/i18n/backend/base.rb:35 in translate
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:81 in block in translate
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:96 in catch
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:96 in _fetch
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:87 in fetch
/gems/i18n-1.8.3/lib/i18n/backend/cache.rb:81 in translate
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:48 in block (2 levels) in translate
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:47 in catch
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:47 in block in translate
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:45 in each
/gems/i18n-1.8.3/lib/i18n/backend/fallbacks.rb:45 in translate
/gems/i18n-1.8.3/lib/i18n.rb:206 in block in translate
/gems/i18n-1.8.3/lib/i18n.rb:202 in catch
/gems/i18n-1.8.3/lib/i18n.rb:202 in translate
/gems/activemodel-5.2.3/lib/active_model/errors.rb:430 in generate_message
/gems/activemodel-5.2.3/lib/active_model/errors.rb:454 in normalize_message
/gems/activemodel-5.2.3/lib/active_model/errors.rb:298 in add
/gems/activemodel-5.2.3/lib/active_model/validations/presence.rb:7 in validate_each
/gems/activerecord-5.2.3/lib/active_record/validations/presence.rb:10 in validate_each
/gems/activemodel-5.2.3/lib/active_model/validator.rb:152 in block in validate
/gems/activemodel-5.2.3/lib/active_model/validator.rb:149 in each
/gems/activemodel-5.2.3/lib/active_model/validator.rb:149 in validate
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:426 in block in make_lambda
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:179 in block (2 levels) in halting_and_conditional
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:606 in block (2 levels) in default_terminator
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:605 in catch
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:605 in block in default_terminator
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:180 in block in halting_and_conditional
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:513 in block in invoke_before
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:513 in each
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:513 in invoke_before
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:131 in run_callbacks
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:816 in _run_validate_callbacks
/gems/activemodel-5.2.3/lib/active_model/validations.rb:409 in run_validations!
/gems/activemodel-5.2.3/lib/active_model/validations/callbacks.rb:118 in block in run_validations!
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:132 in run_callbacks
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:816 in _run_validation_callbacks
/gems/activemodel-5.2.3/lib/active_model/validations/callbacks.rb:118 in run_validations!
/gems/activemodel-5.2.3/lib/active_model/validations.rb:339 in valid?
/gems/activerecord-5.2.3/lib/active_record/validations.rb:67 in valid?
/gems/activerecord-5.2.3/lib/active_record/validations.rb:84 in perform_validations
/gems/activerecord-5.2.3/lib/active_record/validations.rb:46 in save
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:310 in block (2 levels) in save
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:387 in block in with_transaction_returning_status
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:265 in transaction
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212 in transaction
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:385 in with_transaction_returning_status
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:310 in block in save
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:325 in rollback_active_record_state!
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:309 in save
/gems/activerecord-5.2.3/lib/active_record/suppressor.rb:44 in save
/gems/activerecord-5.2.3/lib/active_record/persistence.rb:428 in block in update
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:387 in block in with_transaction_returning_status
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:265 in transaction
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212 in transaction
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:385 in with_transaction_returning_status
/gems/activerecord-5.2.3/lib/active_record/persistence.rb:426 in update
app/models/questionnaire/questionnaire_response.rb:290 in block in process_answers
288:    process_valid_blank_answer(answer)
289:  else
290:    answer.update(value: answer_attributes[:value])
291:    answers_errors[key] = answer.errors unless answer.valid?
292:  end
/gems/actionpack-5.2.3/lib/action_controller/metal/strong_parameters.rb:338 in block in each_pair
/gems/actionpack-5.2.3/lib/action_controller/metal/strong_parameters.rb:337 in each_pair
/gems/actionpack-5.2.3/lib/action_controller/metal/strong_parameters.rb:337 in each_pair
app/models/questionnaire/questionnaire_response.rb:283 in process_answers
app/models/questionnaire/questionnaire_response.rb:218 in assign_params
app/models/questionnaire/questionnaire_response.rb:155 in save_draft
app/interactors/questionnaire/update_questionnaire_response.rb:53 in save_draft
app/interactors/questionnaire/update_questionnaire_response.rb:19 in call
/gems/interactor-3.1.2/lib/interactor.rb:143 in block in run!
/gems/interactor-3.1.2/lib/interactor/hooks.rb:213 in block in with_hooks
/gems/interactor-3.1.2/lib/interactor/hooks.rb:224 in run_around_hooks
/gems/interactor-3.1.2/lib/interactor/hooks.rb:211 in with_hooks
/gems/interactor-3.1.2/lib/interactor.rb:142 in run!
/gems/interactor-3.1.2/lib/interactor.rb:115 in run
/gems/interactor-3.1.2/lib/interactor.rb:50 in tap
/gems/interactor-3.1.2/lib/interactor.rb:50 in call
app/controllers/public_questionnaire_responses_controller.rb:56 in update_questionnaire_response
app/controllers/public_questionnaire_responses_controller.rb:31 in block in update
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267 in block in transaction
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239 in block in within_new_transaction
/usr/local/lib/ruby/2.6.0/monitor.rb:235 in mon_synchronize
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236 in within_new_transaction
/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267 in transaction
/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212 in transaction
app/controllers/public_questionnaire_responses_controller.rb:27 in update
/gems/actionpack-5.2.3/lib/action_controller/metal/basic_implicit_render.rb:6 in send_action
/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:194 in process_action
/gems/ddtrace-0.29.1/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb:114 in process_action
/gems/actionpack-5.2.3/lib/action_controller/metal/rendering.rb:30 in process_action
/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:42 in block in process_action
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:109 in block in run_callbacks
app/controllers/public_questionnaire_responses_controller.rb:122 in block in set_response_locale
/gems/i18n-1.8.3/lib/i18n.rb:313 in with_locale
app/controllers/public_questionnaire_responses_controller.rb:122 in set_response_locale
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118 in block in run_callbacks
/bundler/gems/grc_insight-4cd09d7a04d6/app/controllers/grc_insight/concerns/segment_io_monitoring.rb:46 in track_events
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:118 in block in run_callbacks
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:136 in run_callbacks
/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:41 in process_action
/gems/actionpack-5.2.3/lib/action_controller/metal/rescue.rb:22 in process_action
/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:34 in block in process_action
/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168 in block in instrument
/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23 in instrument
/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168 in instrument
/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:32 in process_action
/gems/actionpack-5.2.3/lib/action_controller/metal/params_wrapper.rb:256 in process_action
/gems/activerecord-5.2.3/lib/active_record/railties/controller_runtime.rb:24 in process_action
/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:134 in process
/gems/actionview-5.2.3/lib/action_view/rendering.rb:32 in process
/gems/actionpack-5.2.3/lib/action_controller/metal.rb:191 in dispatch
/gems/actionpack-5.2.3/lib/action_controller/metal.rb:252 in dispatch
/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:52 in dispatch
/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:34 in serve
/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:52 in block in serve
/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:35 in each
/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:35 in serve
/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:840 in call
/gems/flipper-0.16.2/lib/flipper/middleware/memoizer.rb:62 in memoized_call
/gems/flipper-0.16.2/lib/flipper/middleware/memoizer.rb:40 in call
/gems/flipper-0.16.2/lib/flipper/middleware/setup_env.rb:35 in call
/gems/warden-1.2.8/lib/warden/manager.rb:36 in block in call
/gems/warden-1.2.8/lib/warden/manager.rb:34 in catch
/gems/warden-1.2.8/lib/warden/manager.rb:34 in call
/gems/rack-2.2.2/lib/rack/tempfile_reaper.rb:15 in call
/gems/rack-2.2.2/lib/rack/etag.rb:27 in call
/gems/rack-2.2.2/lib/rack/conditional_get.rb:40 in call
/gems/rack-2.2.2/lib/rack/head.rb:12 in call
/gems/actionpack-5.2.3/lib/action_dispatch/http/content_security_policy.rb:18 in call
/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:266 in context
/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:260 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28 in block in call
/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98 in run_callbacks
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26 in call
/gems/airbrake-10.0.4/lib/airbrake/rack/middleware.rb:34 in call!
/gems/airbrake-10.0.4/lib/airbrake/rack/middleware.rb:23 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:61 in call
/gems/ddtrace-0.29.1/lib/ddtrace/contrib/rails/middlewares.rb:17 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:33 in call
/gems/railties-5.2.3/lib/rails/rack/logger.rb:38 in call_app
/gems/railties-5.2.3/lib/rails/rack/logger.rb:26 in block in call
/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71 in block in tagged
/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28 in tagged
/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71 in tagged
/gems/railties-5.2.3/lib/rails/rack/logger.rb:26 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81 in call
/gems/request_store-1.5.0/lib/request_store/middleware.rb:19 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27 in call
/gems/rack-2.2.2/lib/rack/method_override.rb:24 in call
/gems/rack-2.2.2/lib/rack/runtime.rb:22 in call
/gems/activesupport-5.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:127 in call
/gems/rack-2.2.2/lib/rack/sendfile.rb:110 in call
/gems/actionpack-5.2.3/lib/action_dispatch/middleware/ssl.rb:74 in call
/gems/ddtrace-0.29.1/lib/ddtrace/contrib/rack/middlewares.rb:85 in call
/gems/railties-5.2.3/lib/rails/engine.rb:524 in call
/gems/railties-5.2.3/lib/rails/railtie.rb:190 in public_send
/gems/railties-5.2.3/lib/rails/railtie.rb:190 in method_missing
/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:605 in process_client
/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:700 in worker_loop
/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:548 in spawn_missing_workers
/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:144 in start
/gems/unicorn-5.5.3/bin/unicorn:128 in <top (required)>
/bin/unicorn:23 in load
/bin/unicorn:23 in <top (required)>
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74 in load
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74 in kernel_load
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28 in run
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:465 in exec
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27 in run
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126 in invoke_command
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387 in dispatch
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:27 in dispatch
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466 in start
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:18 in start
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/exe/bundle:30 in block in <top (required)>
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124 in with_friendly_errors
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/exe/bundle:22 in <top (required)>
/usr/local/bin/bundle:23 in load
/usr/local/bin/bundle:23 in <main>

日志:https://pastebin.com/M0mM2Zsf

已编辑以根据 pastebin

显示错误的完整堆栈跟踪
1592916416204,"Started PUT ""/questionnaire_responses/asda67SdD787a8sddadclmgh_eerw09/edit"" for 198.41.0.0 at 2020-06-23 12:46:56 +0000"
1592916416205,Processing by PublicQuestionnaireResponsesController#update as */*
1592916416206,"  Parameters: {""draft_button""=>""true"", ""authenticity_token""=>""cCGRhCDe6SUNDWKdsZ+WHT2BdLdGCHS8X1or9lJRIQBkoyRdabBgrUo+k+RCvsLMvBkk9myrnsmIiLkwOZ/Q1g=="", ""questionnaire_response""=>{""answers_attributes""=>{""4464407""=>{""question_id""=>""4464407"", ""files""=>[#<ActionDispatch::Http::UploadedFile:0x000000000c5f4fb8 @tempfile=#<Tempfile:/tmp/RackMultipart20200623-22-10wkf6r.pdf>, @original_filename=""Sep 19.pdf"", @content_type=""application/pdf"", @headers=""Content-Disposition: form-data; name=\""questionnaire_response[answers_attributes][4464407][files][]\""; filename=\""Sep 19.pdf\""\r
Content-Type: application/pdf\r
"">]}, ""4464406""=>{""question_id""=>""4464406"", ""files""=>[#<ActionDispatch::Http::UploadedFile:0x000000000c5f4dd8 @tempfile=#<Tempfile:/tmp/RackMultipart20200623-22-1ngl7kh.pdf>, @original_filename=""My PDF Sept 19, 2018.pdf"", @content_type=""application/pdf"", @headers=""Content-Disposition: form-data; name=\""questionnaire_response[answers_attributes][4464406][files][]\""; filename=\""My PDF Sept 19, 2018.pdf\""\r
Content-Type: application/pdf\r
"">]}, ""4464411""=>{""question_id""=>""4464411""}}}, ""_""=>""B728eVb0cPYcSgo3M_B7c"", ""id""=>""asda67SdD787a8sddadclmgh_eerw09""}"
1592916416208,"  [1m[36mAccount Load (0.5ms)[0m  [1m[34mSELECT  ""accounts"".* FROM ""accounts"" WHERE ""accounts"".""subdomain"" =  LIMIT [0m  [[""subdomain"", ""customer-inc""], [""LIMIT"", 1]]"
1592916416210,"  [1m[36mAccount Load (0.4ms)[0m  [1m[34mSELECT  ""accounts"".* FROM ""accounts"" WHERE ""accounts"".""subdomain"" =  ORDER BY ""accounts"".""id"" ASC LIMIT [0m  [[""subdomain"", ""customer-inc""], [""LIMIT"", 1]]"
1592916416213,"  [1m[36mQuestionnaire::QuestionnaireResponse Load (0.3ms)[0m  [1m[34mSELECT  ""questionnaire_responses"".* FROM ""questionnaire_responses"" WHERE ""questionnaire_responses"".""uid"" =  AND (""questionnaire_responses"".""done"" =  OR ""questionnaire_responses"".""done"" IS NULL) LIMIT [0m  [[""uid"", ""asda67SdD787a8sddadclmgh_eerw09""], [""done"", false], [""LIMIT"", 1]]"
1592916416215,"  [1m[36mQuestionnaire Load (0.3ms)[0m  [1m[34mSELECT ""questionnaires"".* FROM ""questionnaires"" WHERE ""questionnaires"".""id"" = [0m  [[""id"", 379305]]"
1592916416217,"  [1m[36mQuestionnaire::QuestionnaireItem Load (0.3ms)[0m  [1m[34mSELECT ""questionnaire_items"".* FROM ""questionnaire_items"" WHERE ""questionnaire_items"".""questionnaire_id"" = [0m  [[""questionnaire_id"", 379305]]"
1592916416220,"  [1m[36mQuestion Load (0.5ms)[0m  [1m[34mSELECT ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" IN (, , , , , , , , , , , , ) ORDER BY questions.position ASC, questions.id ASC[0m  [[""id"", 4464412], [""id"", 4464411], [""id"", 4464409], [""id"", 4464408], [""id"", 4464407], [""id"", 4464406], [""id"", 4463448], [""id"", 4463435], [""id"", 4463434], [""id"", 4463433], [""id"", 4463431], [""id"", 4463429], [""id"", 4463423]]"
1592916416222,"  [1m[36mPageBreak Load (0.3ms)[0m  [1m[34mSELECT ""page_breaks"".* FROM ""page_breaks"" WHERE ""page_breaks"".""id"" IN (, , )[0m  [[""id"", 360685], [""id"", 360603], [""id"", 360602]]"
1592916416225,"  [1m[36mQuestionnaire::SupportingFile Load (0.3ms)[0m  [1m[34mSELECT ""questionnaire_supporting_files"".* FROM ""questionnaire_supporting_files"" WHERE ""questionnaire_supporting_files"".""questionnaire_id"" = [0m  [[""questionnaire_id"", 379305]]"
1592916416227,"  [1m[36mProject Load (0.4ms)[0m  [1m[34mSELECT ""projects"".* FROM ""projects"" WHERE ""projects"".""id"" =  ORDER BY LOWER(projects.name)[0m  [[""id"", 119686]]"
1592916416229,"  [1m[36mAccount Load (0.5ms)[0m  [1m[34mSELECT ""accounts"".* FROM ""accounts"" WHERE ""accounts"".""id"" = [0m  [[""id"", 123456]]"
1592916416231,"  [1m[36mUser Load (0.3ms)[0m  [1m[34mSELECT  ""users"".* FROM ""users"" WHERE ""users"".""email"" IS NULL LIMIT [0m  [[""LIMIT"", 1]]"
1592916416233,"  [1m[36mUser Load (0.4ms)[0m  [1m[34mSELECT  ""users"".* FROM ""users"" INNER JOIN ""accounts_users"" ON ""users"".""id"" = ""accounts_users"".""user_id"" WHERE ""accounts_users"".""account_id"" =  AND ""users"".""email"" IS NULL LIMIT [0m  [[""account_id"", 123456], [""LIMIT"", 1]]"
1592916416235,  [1m[35m (0.2ms)[0m  [1m[35mBEGIN[0m
1592916416236,"  [1m[36mUser Load (0.3ms)[0m  [1m[34mSELECT  ""users"".* FROM ""users"" WHERE ""users"".""id"" =  ORDER BY ""users"".""id"" ASC LIMIT [0m  [[""id"", 149890], [""LIMIT"", 1]]"
1592916416239,"  [1m[35m (0.3ms)[0m  [1m[34mSELECT ""questions"".""id"" FROM ""questions"" WHERE ""questions"".""questionnaire_id"" =  ORDER BY questions.position ASC, questions.id ASC[0m  [[""questionnaire_id"", 379305]]"
1592916416241,"  [1m[36mAnswer Load (0.3ms)[0m  [1m[34mSELECT ""answers"".* FROM ""answers"" WHERE ""answers"".""questionnaire_response_id"" = [0m  [[""questionnaire_response_id"", 8072287]]"
1592916416243,"  [1m[36mQuestion Load (0.4ms)[0m  [1m[34mSELECT ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" IN (, , , ) ORDER BY questions.position ASC, questions.id ASC[0m  [[""id"", 4463448], [""id"", 4463431], [""id"", 4463429], [""id"", 4463423]]"
1592916416248,"  [1m[36mQuestion Load (0.4ms)[0m  [1m[34mSELECT  ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" =  ORDER BY questions.position ASC, questions.id ASC LIMIT [0m  [[""id"", 4464407], [""LIMIT"", 1]]"
1592916416251,"  [1m[36mAnswer Create (0.6ms)[0m  [1m[32mINSERT INTO ""answers"" (""question_id"", ""questionnaire_response_id"", ""files"", ""created_at"", ""updated_at"") VALUES (, , , , ) RETURNING ""id""[0m  [[""question_id"", 4464407], [""questionnaire_response_id"", 8072287], [""files"", ""---
- Sep_19.pdf
""], [""created_at"", ""2020-06-23 12:46:56.250131""], [""updated_at"", ""2020-06-23 12:46:56.250131""]]"
1592916416390,"  [1m[36mQuestion Load (0.6ms)[0m  [1m[34mSELECT  ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" =  ORDER BY questions.position ASC, questions.id ASC LIMIT [0m  [[""id"", 4464406], [""LIMIT"", 1]]"
1592916416393,"  [1m[36mAnswer Create (0.5ms)[0m  [1m[32mINSERT INTO ""answers"" (""question_id"", ""questionnaire_response_id"", ""files"", ""created_at"", ""updated_at"") VALUES (, , , , ) RETURNING ""id""[0m  [[""question_id"", 4464406], [""questionnaire_response_id"", 8072287], [""files"", ""---
- My_PDF_Sept_19__2018.pdf
""], [""created_at"", ""2020-06-23 12:46:56.391887""], [""updated_at"", ""2020-06-23 12:46:56.391887""]]"
1592916416489,"  [1m[36mQuestion Load (0.7ms)[0m  [1m[34mSELECT  ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" =  ORDER BY questions.position ASC, questions.id ASC LIMIT [0m  [[""id"", 4464411], [""LIMIT"", 1]]"
1592916416496,  [1m[35m (0.3ms)[0m  [1m[31mROLLBACK[0m
1592916416498,Completed 500 Internal Server Error in 292ms (ActiveRecord: 8.9ms)
1592916416501,[analytics-ruby] Sending request for 1 items
1592916416507,
1592916416509,TypeError (no _dump_data is defined for class OpenSSL::Digest):
1592916416509,
1592916416509,app/models/questionnaire/questionnaire_response.rb:290:in `block in process_answers'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/models/questionnaire/questionnaire_response.rb:283:in `process_answers'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/models/questionnaire/questionnaire_response.rb:218:in `assign_params'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/models/questionnaire/questionnaire_response.rb:155:in `save_draft'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/interactors/questionnaire/update_questionnaire_response.rb:53:in `save_draft'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/interactors/questionnaire/update_questionnaire_response.rb:19:in `call'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/controllers/public_questionnaire_responses_controller.rb:56:in `update_questionnaire_response'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/controllers/public_questionnaire_responses_controller.rb:31:in `block in update'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/controllers/public_questionnaire_responses_controller.rb:27:in `update'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/controllers/public_questionnaire_responses_controller.rb:122:in `block in set_response_locale'
1592916416509,[uuid: 939e755ed429cb6fdf6f39e96040dd28] [user_uid: xkZGncsu_vCc] [subdomain: customer-inc] app/controllers/public_questionnaire_responses_controller.rb:122:in `set_response_locale'
1592916416510,Processing by GrcShared::ErrorsController#show as */*
1592916416510,"  Parameters: {""draft_button""=>""true"", ""authenticity_token""=>""cCGRhCDe6SUNDWKdsZ+WHT2BdLdGCHS8X1or9lJRIQBkoyRdabBgrUo+k+RCvsLMvBkk9myrnsmIiLkwOZ/Q1g=="", ""questionnaire_response""=>{""answers_attributes""=>{""4464407""=>{""question_id""=>""4464407"", ""files""=>[#<ActionDispatch::Http::UploadedFile:0x000000000c5f4fb8 @tempfile=#<Tempfile:/tmp/RackMultipart20200623-22-10wkf6r.pdf>, @original_filename=""Sep 19.pdf"", @content_type=""application/pdf"", @headers=""Content-Disposition: form-data; name=\""questionnaire_response[answers_attributes][4464407][files][]\""; filename=\""Sep 19.pdf\""\r
Content-Type: application/pdf\r
"">]}, ""4464406""=>{""question_id""=>""4464406"", ""files""=>[#<ActionDispatch::Http::UploadedFile:0x000000000c5f4dd8 @tempfile=#<Tempfile:/tmp/RackMultipart20200623-22-1ngl7kh.pdf>, @original_filename=""My PDF Sept 19, 2018.pdf"", @content_type=""application/pdf"", @headers=""Content-Disposition: form-data; name=\""questionnaire_response[answers_attributes][4464406][files][]\""; filename=\""My PDF Sept 19, 2018.pdf\""\r
Content-Type: application/pdf\r
"">]}, ""4464411""=>{""question_id""=>""4464411""}}}, ""_""=>""B728eVb0cPYcSgo3M_B7c"", ""id""=>""asda67SdD787a8sddadclmgh_eerw09""}"
1592916416525,  Rendering vendor/bundle/ruby/2.6.0/bundler/gems/grc_shared-cf61a08e39dd/app/views/grc_shared/errors/_show.erb
1592916416527,  Rendered vendor/bundle/ruby/2.6.0/bundler/gems/grc_shared-cf61a08e39dd/app/views/grc_shared/errors/_show.erb (1.7ms)
1592916416529,Completed 500 Internal Server Error in 19ms (Views: 16.6ms | ActiveRecord: 0.0ms)
 

它只发生在那个控制器和动作上。

该模型称为 Answer,它有几个验证,主要是 presence: true 有一堆不同的条件是否验证答案值(例如,必需的与可选的)。参数看起来像这样:

{
  "_method": "put",
  "aclui-uploader": {
    "content_type": "application/pdf",
    "headers": "Content-Disposition: form-data; name=\"aclui-uploader\"; filename=\"Jan 1.pdf\"\r\nContent-Type: application/pdf\r\n",
    "original_filename": "Jan 1.pdf",
    "tempfile": "#<File:0x000000000c3af9b0>"
  },
  "action": "update",
  "authenticity_token": "[Filtered]",
  "controller": "public_questionnaire_responses",
  "draft_button": "true",
  "id": "7sk8PPpb_KdV_h1jzXsP",
  "questionnaire_response": {
    "answers_attributes": {
      "581102": {
        "question_id": "581102"
      },
      "581111": {
        "question_id": "581111",
        "value": ""
      },
      "581124": {
        "files": [
          {
            "content_type": "application/pdf",
            "headers": "Content-Disposition: form-data; name=\"questionnaire_response[answers_attributes][581124][files][]\"; filename=\"Jan 1.pdf\"\r\nContent-Type: application/pdf\r\n",
            "original_filename": "Jan 1.pdf",
            "tempfile": "#<File:0x000000000c347ea0>"
          }
        ],
        "question_id": "581124"
      },
      "581128": {
        "question_id": "581128",
        "value": "ABC"
      },
      ...
    }
  }
}

有时错误率高达此端点请求的 13%,但通常要低得多,有时根本不会发生:

另一个谜团是为什么它主要发生在我们的一个地区。我们部署到多个 AWS 区域,美国是我们最大的区域,但只产生 <20% 的错误,而 AP 是一个较小的区域,产生了近 80% 的错误(另一个中等规模的区域,<1%)。

如果我可以提供任何其他详细信息,请告诉我。

感谢您的帮助!

编辑:添加了堆栈跟踪的其余部分(低于 app/models/questionnaire/questionnaire_response.rb:283 in process_answers

编辑:在 pastebin 中添加日志 (https://pastebin.com/M0mM2Zsf)

现在下定论可能还为时过早,但我们可能已经通过从 config/initializers/i18n.rb

中删除以下两行来解决它
I18n::Backend::Simple.send(:include, I18n::Backend::Cache)
I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)

在部署此更改之前的 2 周内,错误已经从高达 1k errors/day 下降到个位数或两位数。

部署后我们已经 2 天没有看到任何一个。

我不确定删除该缓存是否会对性能产生任何影响 - 但我注意到我们的其他 rails 应用没有此功能。

这是缓存的一般错误

no _dump_data is definedno marshal_dump is defined这样的错误大部分发生在缓存实现中,很难知道错误发生在哪里。

为了修复这个一般性错误,我建议调查所有新的 GEMs/features/edits,因为在某些部分,实现没有在“缓存数据”中获取通用数据。

例如,在我的实际实现中,当我尝试将 searchkickview_components_reflexes(可缓存所有数据)一起使用时出现此错误。我需要调整将数据发送到 view_components_reflex 的方式。