Error during failsafe response: Couldn't find Person

I am trying to connect my local prod instance to Stripe and I am getting the below error on submission. Would really appreciate if you can point me at the right direction on this issue.

500 Internal Server Error
If you are the administrator of this website, then please read this web application’s log file and/or the web server’s log file to find out what went wrong.

{“method”:“PUT”,“path”:“/500”,“format”:“html”,“controller”:“PeopleController”,“action”:“update”,“status”:404,“error”:“ActiveRecord::RecordNotFound: Couldn’t find Person”,“duration”:40.4,“view”:0.0,“db”:1.27,“params”:{“utf8”:“✓”,“_method”:“put”,“authenticity_token”:“XXXXX”,“stripe_api_keys_form”:{“api_publishable_key”:“[FILTERED]”,“api_private_key”:“[FILTERED]”},“button”:“”,“locale”:“en”,“id”:“500”},“host”:“XXXX.com”,“community_id”:1,“current_user_id”:“XXXXX”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36”,“referer”:“http://XXXXX.com:3000/en/admin/payment_preferences",“forwarded_for”:“”,“request_uuid”:"XXXXX”}

Error during failsafe response: Couldn’t find Person
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-5.1.6.1/lib/active_record/core.rb:228:in find_by!' /opt/dev/sharetribe/app/controllers/people_controller.rb:177:in update’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/basic_implicit_render.rb:4:in send_action' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/abstract_controller/base.rb:186:in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/rendering.rb:30:in process_action' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/abstract_controller/callbacks.rb:20:in block in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:131:in run_callbacks' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/abstract_controller/callbacks.rb:19:in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/rescue.rb:20:in process_action' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/instrumentation.rb:32:in block in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/notifications.rb:166:in block in instrument' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/notifications/instrumenter.rb:21:in instrument’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/notifications.rb:166:in instrument' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/instrumentation.rb:30:in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal/params_wrapper.rb:252:in process_action' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activerecord-5.1.6.1/lib/active_record/railties/controller_runtime.rb:22:in process_action’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/abstract_controller/base.rb:124:in process' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionview-5.1.6.1/lib/action_view/rendering.rb:30:in process’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal.rb:189:in dispatch' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_controller/metal.rb:253:in dispatch’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/routing/route_set.rb:49:in dispatch' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/routing/route_set.rb:31:in serve’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/routing/mapper.rb:16:in block in <class:Constraints>' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/routing/mapper.rb:46:in serve’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/journey/router.rb:50:in block in serve' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/journey/router.rb:33:in each’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/journey/router.rb:33:in serve' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/routing/route_set.rb:844:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/show_exceptions.rb:49:in render_exception' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/show_exceptions.rb:34:in rescue in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/lograge-0.5.1/lib/lograge/rails_ext/rack/logger.rb:15:in call_app' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.6.1/lib/rails/rack/logger.rb:24:in block in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:69:in block in tagged' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:26:in tagged’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:69:in tagged' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.6.1/lib/rails/rack/logger.rb:24:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/remote_ip.rb:79:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/request_store-1.3.2/lib/request_store/middleware.rb:9:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/request_id.rb:25:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/runtime.rb:22:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/activesupport-5.1.6.1/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/executor.rb:12:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/actionpack-5.1.6.1/lib/action_dispatch/middleware/static.rb:125:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /opt/dev/sharetribe/lib/rack_middleware/enforce_ssl.rb:23:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /opt/dev/sharetribe/lib/rack_middleware/health_check.rb:12:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.6.1/lib/rails/engine.rb:522:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:185:in public_send' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.6.1/lib/rails/railtie.rb:185:in method_missing’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/deflater.rb:34:in call’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in call' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rack-2.0.6/lib/rack/handler/webrick.rb:86:in service’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:140:in service' /home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/2.3.0/webrick/httpserver.rb:96:in run’
/home/dwijesinghe/.rbenv/versions/2.3.4/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread’
92.20.246.101 - - [28/Mar/2019:14:37:37 UTC] “POST /en/admin/payment_preferences/update_stripe_keys HTTP/1.1” 500 154

Same thing happened with me, Stripe API keys were used to be 24 character long, now they’re 34 character long, these 34 character long keys are not supported by your version of Sharetribe,

https://www.sharetribe.com/community/t/unable-to-add-34-character-long-stripe-keys/1915

BTW how long is your API key, 24 or 34 ?

Thanks Kaleem! Yes they are 34 characters long. I changed the regex in config but that didn’t really work. Is there a version which support 34 long keys ?

Have you read that thread?
check thomasmalbaux response.

I don’t know if this is the correct way of fixing this problem or not but this is what I did and it solved the problem.

git pull origin master
bundle install
npm install
RAILS_ENV=production rake db:migrate

previously I had 24 character long keys so I had to remove the old records from database (payment_settings table ), and then executed following command from rails console

TransactionService::API::Api.processes.create(community_id: 1, process: :preauthorize, author_is_seller: true)
TransactionService::API::Api.settings.provision( community_id: 1, payment_gateway: :stripe, payment_process: :preauthorize, active: true)

and finally added the 34 char long keys.

Thanks Kaleem,

Tried above but no luck unfortunately.

It accepts the key but get the error on save.

Try this SQL query and retry to add the keys

mysql> update payment_settings set `key_encryption_padding`=1,`api_verified`=0