ruby Mysterious TypeError:为OpenSSL::Digest类定义no _dump_data

ee7vknir  于 2023-04-29  发布在  Ruby
关注(0)|答案(3)|浏览(86)

我们最近看到这个错误越来越多地出现-但不是一致的,也无法手动重现。

我们有一个标准的Ruby on Rails应用程序(5.2.3)在Ruby 2上。6.5.
我读过所有其他类似标题的帖子,但我不知道这是从哪里来的,这里是我们的堆栈跟踪:

/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"" = $1 LIMIT $2[0m  [[""subdomain"", ""customer-inc""], [""LIMIT"", 1]]"
1592916416210,"  [1m[36mAccount Load (0.4ms)[0m  [1m[34mSELECT  ""accounts"".* FROM ""accounts"" WHERE ""accounts"".""subdomain"" = $1 ORDER BY ""accounts"".""id"" ASC LIMIT $2[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"" = $1 AND (""questionnaire_responses"".""done"" = $2 OR ""questionnaire_responses"".""done"" IS NULL) LIMIT $3[0m  [[""uid"", ""asda67SdD787a8sddadclmgh_eerw09""], [""done"", false], [""LIMIT"", 1]]"
1592916416215,"  [1m[36mQuestionnaire Load (0.3ms)[0m  [1m[34mSELECT ""questionnaires"".* FROM ""questionnaires"" WHERE ""questionnaires"".""id"" = $1[0m  [[""id"", 379305]]"
1592916416217,"  [1m[36mQuestionnaire::QuestionnaireItem Load (0.3ms)[0m  [1m[34mSELECT ""questionnaire_items"".* FROM ""questionnaire_items"" WHERE ""questionnaire_items"".""questionnaire_id"" = $1[0m  [[""questionnaire_id"", 379305]]"
1592916416220,"  [1m[36mQuestion Load (0.5ms)[0m  [1m[34mSELECT ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) 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 ($1, $2, $3)[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"" = $1[0m  [[""questionnaire_id"", 379305]]"
1592916416227,"  [1m[36mProject Load (0.4ms)[0m  [1m[34mSELECT ""projects"".* FROM ""projects"" WHERE ""projects"".""id"" = $1 ORDER BY LOWER(projects.name)[0m  [[""id"", 119686]]"
1592916416229,"  [1m[36mAccount Load (0.5ms)[0m  [1m[34mSELECT ""accounts"".* FROM ""accounts"" WHERE ""accounts"".""id"" = $1[0m  [[""id"", 123456]]"
1592916416231,"  [1m[36mUser Load (0.3ms)[0m  [1m[34mSELECT  ""users"".* FROM ""users"" WHERE ""users"".""email"" IS NULL LIMIT $1[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"" = $1 AND ""users"".""email"" IS NULL LIMIT $2[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"" = $1 ORDER BY ""users"".""id"" ASC LIMIT $2[0m  [[""id"", 149890], [""LIMIT"", 1]]"
1592916416239,"  [1m[35m (0.3ms)[0m  [1m[34mSELECT ""questions"".""id"" FROM ""questions"" WHERE ""questions"".""questionnaire_id"" = $1 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"" = $1[0m  [[""questionnaire_response_id"", 8072287]]"
1592916416243,"  [1m[36mQuestion Load (0.4ms)[0m  [1m[34mSELECT ""questions"".* FROM ""questions"" WHERE ""questions"".""id"" IN ($1, $2, $3, $4) 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"" = $1 ORDER BY questions.position ASC, questions.id ASC LIMIT $2[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 ($1, $2, $3, $4, $5) 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"" = $1 ORDER BY questions.position ASC, questions.id ASC LIMIT $2[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 ($1, $2, $3, $4, $5) 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"" = $1 ORDER BY questions.position ASC, questions.id ASC LIMIT $2[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

myss37ts

myss37ts1#

这是缓存的一般错误

no _dump_data is definedno marshal_dump is defined这样的错误在缓存实现中大多数都发生,并且很难知道错误发生在哪里。
为了修复这个错误,我建议调查所有新的GEMs/features/edits,因为在某些部分,实现没有在“缓存数据”中获取通用数据。
例如,在我的实际实现中,当我尝试将searchkickview_components_reflexes(可缓存所有数据)一起使用时,我得到了这个错误。我需要调整如何发送数据到view_components_reflex工作。

0md85ypi

0md85ypi2#

现在下结论可能还为时过早,但我们可以通过从config/initializers/i18n.rb中删除以下两行来解决这个问题

I18n::Backend::Simple.send(:include, I18n::Backend::Cache)
I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)

在部署此更改之前的2周内,错误已经从每天高达1 k个错误下降到个位数或两位数。
在部署后的两天里,我们没有看到一个人。
我不确定删除缓存是否会对性能产生影响--但我注意到我们的其他Rails应用程序没有这个功能。

34gzjxbg

34gzjxbg3#

根本原因

该错误的根本原因是将HTTP connection作为示例变量编组一个对象。
关于Marshal docs
某些对象无法转储:如果要转储的对象包括绑定、过程或方法对象、类IO的示例或单例对象,则将引发TypeError。

附加信息

在这种情况下,连接是HTTPS连接(因此错误的“OpenSSL等”部分)。但是,HTTP连接仍然存在相同的根本问题(在这种情况下,错误将显示为“can't dump TCPSocket”)。
这并不是因为HTTP连接是打开的。即使调用了HTTP.finish,错误仍然存在。奇怪的是,如果连接没有开始,以避免错误。

溶液

就我个人而言,我首先会建议在面向公众的环境中根本不要使用编组,因为安全问题。
但是,如果决定使用编组,并且代码可以更改,则正确的方法是实现自己的序列化策略。the docs
如果类有特殊的序列化需求(例如,如果您希望以某种特定格式序列化),或者如果它包含的对象本来是不可序列化的,则可以实现自己的序列化策略。
如果问题存在于来自另一方的Gem或代码中,则需要提交错误报告。

示例

样本最小可行示例:

def make_error
  require 'net/http'

  uri = URI('https://localhost:5010')
  @http_conn = Net::HTTP.new(uri.host, uri.port)
  @http_conn.use_ssl = true
  @http_conn.start
  Marshal.dump(self)
end

将连接设置为局部变量而不是示例变量可避免以下错误:

def make_error
  require 'net/http'

  uri = URI('https://localhost:5010')
  http_conn = Net::HTTP.new(uri.host, uri.port)
  http_conn.use_ssl = true
  http_conn.start
  Marshal.dump(self)
end

相关问题