restarone / violet_rails

an app engine for your business. Seamlessly implement business logic with a powerful API. Out of the box CMS, blog, forum and email functionality. Developer friendly & easily extendable for your next SaaS/XaaS project. Built with Rails 6, Devise, Sidekiq & PostgreSQL
https://violet.restarone.solutions
MIT License
95 stars 43 forks source link

undefined method `error_api_actions' for nil:NilClass #1472

Open donrestarone opened 1 year ago

donrestarone commented 1 year ago

Describe the bug affecting layoffsfyi.restarone.com -- we observe this error at a rate of ~2/500 form submissions

A NoMethodError occurred in resource#create:

  undefined method `error_api_actions' for nil:NilClass
  app/controllers/concerns/api_actionable.rb:104:in `create_error_actions'
donrestarone commented 1 year ago

affecting nikean.org

A NoMethodError occurred in resource#create:

  undefined method `error_api_actions' for nil:NilClass
  app/controllers/concerns/api_actionable.rb:104:in `create_error_actions'

-------------------------------
Request:
-------------------------------

  * URL        : https://nikean.org/api_namespaces/14/resource
  * HTTP Method: POST
  * IP address : 115.188.208.165
  * Parameters : {"authenticity_token"=>"[FILTERED]", "form_id"=>"69947669991060", "data"=>{"properties"=>{"first_name"=>"Amber", "last_name"=>"W", "email"=>"amber@sunshinelabs.life", "consent"=>"true"}}, "g-recaptcha-response-data"=>{"mailing_list_69947669991060"=>"03AD1IbLAG68LtZtcuKxxFOopTAFc_TMaSo8a9Z2yR6xcpc6y8picKoT7kAFZn9p2borFVOsNf1nlxCrpYT6oOahoNmwj2P9LO5eZtm2mGl4Huc3ZcvuOpOfgD91j_aUxDI-ZWjvsZ6jvuRATbfzrQm39QbPa2dCDxjkBpTvBqB8T1e2pB5A-0ovywYxtD0q5lvhSsWj6_QwECVDciykFVwfAHwrVz8bt3AGGkgKPOoMGK4aKJbvtk6GCkB5iVzV6inLAepXpubsVC_Szv15-i6xnI2_LTeIAD9SF2Q7n9ydnLawurjrAZU-E6g_TDRpcnjwqYRDPZIeAloD7W_0nRlEY57qmrpsJPi1t7hORcxAD3drfuuEQ9NXrONL-CU9_r1ZeQiwkWmiqPCXw1CJkKtikI0R5AZePvjYerVxLvIXnsmy3Uxq2ABxzOZH8WzmgHmyFHADWEV30gBRaA-6YU5pyzBNtoo9a9mkPgOGJyXrwXob98XJFicq1d55CHes4WFYLhkyKGXh5PNaHu0miX_GFpXJ_3z4ZMKQ"}, "g-recaptcha-response"=>"", "commit"=>"Submit", "controller"=>"resource", "action"=>"create", "api_namespace_id"=>"14"}
  * Timestamp  : 2023-01-11 01:13:40 UTC
  * Server : ip-172-31-14-250
    * Rails root : /var/www/violet/releases/20230106194209
  * Process: 1116385

-------------------------------
Session:
-------------------------------

  * session id: [FILTERED]
  * data: {"session_id"=>"834c7ceb0b8cacb5f635b7f922694655",
   "_csrf_token"=>"apSSNY9XKpSRqDzvwGNtfAaz2q1Gdu1HBxl63RrXXSo="}

-------------------------------
Environment:
-------------------------------

  * CONTENT_LENGTH                                          : 1839
    * CONTENT_TYPE                                            : multipart/form-data; boundary=----WebKitFormBoundaryJKZufFHfzB2xxvsB
    * GATEWAY_INTERFACE                                       : CGI/1.2
    * HTTP_ACCEPT                                             : application/json, text/javascript, */*; q=0.01
    * HTTP_ACCEPT_ENCODING                                    : gzip, deflate, br
    * HTTP_ACCEPT_LANGUAGE                                    : en-CA,en-US;q=0.9,en;q=0.8
    * HTTP_CONNECTION                                         : close
    * HTTP_HOST                                               : [nikean.org](http://nikean.org/)
    * HTTP_ORIGIN                                             : https://nikean.org/
    * HTTP_REFERER                                            : https://nikean.org/partnerships
    * HTTP_USER_AGENT                                         : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
    * HTTP_VERSION                                            : HTTP/1.0
    * HTTP_X_CSRF_TOKEN                                       : [FILTERED]
    * HTTP_X_FORWARDED_FOR                                    : 115.188.208.165
    * HTTP_X_FORWARDED_PROTO                                  : https
    * HTTP_X_REAL_IP                                          : 115.188.208.165
    * HTTP_X_REQUESTED_WITH                                   : XMLHttpRequest
    * ORIGINAL_FULLPATH                                       : /api_namespaces/14/resource
    * ORIGINAL_SCRIPT_NAME                                    :
    * PATH_INFO                                               : /api_namespaces/14/resource
    * QUERY_STRING                                            :
    * REMOTE_ADDR                                             : 127.0.0.1
    * REQUEST_METHOD                                          : POST
    * REQUEST_PATH                                            : /api_namespaces/14/resource
    * REQUEST_URI                                             : /api_namespaces/14/resource
    * ROUTES_47377763248820_SCRIPT_NAME                       :
    * SCRIPT_NAME                                             :
    * SERVER_NAME                                             : [nikean.org](http://nikean.org/)
    * SERVER_PORT                                             : 443
    * SERVER_PROTOCOL                                         : HTTP/1.1
    * SERVER_SOFTWARE                                         : puma 5.6.4 Birdie's Version
    * action_controller.instance                              : #<ResourceController:0x00007f221d294cf8>
    * action_dispatch.authenticated_encrypted_cookie_salt     : [FILTERED]
    * action_dispatch.backtrace_cleaner                       : #<Rails::BacktraceCleaner:0x0000562dfc44e898>
    * action_dispatch.content_security_policy                 :
    * action_dispatch.content_security_policy_nonce_directives:
    * action_dispatch.content_security_policy_nonce_generator :
    * action_dispatch.content_security_policy_report_only     : false
    * action_dispatch.cookies                                 : #<ActionDispatch::Cookies::CookieJar:0x00007f221d29d600>
    * action_dispatch.cookies_digest                          :
    * action_dispatch.cookies_rotations                       : #<ActiveSupport::Messages::RotationConfiguration:0x0000562df8ba8e58>
    * action_dispatch.cookies_same_site_protection            : #<Proc:0x0000562dfdb6a108@/var/www/violet/shared/bundle/ruby/2.6.0/gems/railties-6.1.5/lib/rails/application.rb:636>
    * action_dispatch.cookies_serializer                      : json
    * action_dispatch.encrypted_cookie_cipher                 : [FILTERED]
    * action_dispatch.encrypted_cookie_salt                   : [FILTERED]
    * action_dispatch.encrypted_signed_cookie_salt            : [FILTERED]
    * action_dispatch.http_auth_salt                          : [FILTERED]
    * action_dispatch.key_generator                           : #<ActiveSupport::CachingKeyGenerator:0x0000562dfade2ff0>
    * action_dispatch.logger                                  : #<ActiveSupport::Logger:0x0000562df9ee1448>
    * action_dispatch.parameter_filter                        : [:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn]
    * action_dispatch.permissions_policy                      :
    * action_dispatch.redirect_filter                         : []
    * action_dispatch.remote_ip                               : 115.188.208.165
    * action_dispatch.request.accepts                         : [#<Mime::Type:0x0000562df93f97d8 @synonyms=["text/x-json", "application/jsonrequest"], @symbol=:json, @string="application/json", @hash=-500391611733016450>, #<Mime::Type:0x0000562df93fbf38 @synonyms=["application/javascript", "application/x-javascript"], @symbol=:js, @string="text/javascript", @has...
    * action_dispatch.request.content_type                    : multipart/form-data
    * action_dispatch.request.formats                         : [#<Mime::Type:0x0000562df93f97d8 @synonyms=["text/x-json", "application/jsonrequest"], @symbol=:json, @string="application/json", @hash=-500391611733016450>, #<Mime::Type:0x0000562df93fbf38 @synonyms=["application/javascript", "application/x-javascript"], @symbol=:js, @string="text/javascript", @has...
    * action_dispatch.request.parameters                      : {"authenticity_token"=>"[FILTERED]", "form_id"=>"69947669991060", "data"=>{"properties"=>{"first_name"=>"Amber", "last_name"=>"W", "email"=>"amber@sunshinelabs.life", "consent"=>"true"}}, "g-recaptcha-response-data"=>{"mailing_list_69947669991060"=>"03AD1IbLAG68LtZtcuKxxFOopTAFc_TMaSo8a9Z2yR6xcpc6y8...
    * action_dispatch.request.path_parameters                 : {:controller=>"resource", :action=>"create", :api_namespace_id=>"14"}
    * action_dispatch.request.query_parameters                : {}
    * action_dispatch.request.request_parameters              : {"authenticity_token"=>"[FILTERED]", "form_id"=>"69947669991060", "data"=>{"properties"=>{"first_name"=>"Amber", "last_name"=>"W", "email"=>"amber@sunshinelabs.life", "consent"=>"true"}}, "g-recaptcha-response-data"=>{"mailing_list_69947669991060"=>"03AD1IbLAG68LtZtcuKxxFOopTAFc_TMaSo8a9Z2yR6xcpc6y8...
    * action_dispatch.request.unsigned_session_cookie         : {"session_id"=>"834c7ceb0b8cacb5f635b7f922694655"}
    * action_dispatch.request_id                              : 88ddf8e7-7b67-46bf-ac1c-3343f4f0c638
    * action_dispatch.routes                                  : #<ActionDispatch::Routing::RouteSet:0x0000562dfd7f5568>
    * action_dispatch.secret_key_base                         : [FILTERED]
    * action_dispatch.show_detailed_exceptions                : false
    * action_dispatch.show_exceptions                         : true
    * action_dispatch.signed_cookie_digest                    :
    * action_dispatch.signed_cookie_salt                      : [FILTERED]
    * action_dispatch.use_authenticated_cookie_encryption     : [FILTERED]
    * action_dispatch.use_cookies_with_metadata               : true
    * puma.config                                             : #<Puma::Configuration:0x0000562df7daf310>
    * puma.request_body_wait                                  : 0
    * puma.socket                                             : #<TCPSocket:0x00007f221d262208>
    * rack.after_reply                                        : []
    * rack.cors                                               : #<Rack::Cors::Result:0x00007f221d2616c8>
    * rack.errors                                             : #<IO:0x0000562df71480b8>
    * rack.hijack                                             : #<Puma::Client:0x00007f221d2621e0>
    * rack.hijack?                                            : true
    * rack.input                                              : #<StringIO:0x00007f221d261c90>
    * rack.multiprocess                                       : false
    * rack.multithread                                        : true
    * rack.request.cookie_hash                                : {}
    * rack.request.form_hash                                  : {"authenticity_token"=>"[FILTERED]", "form_id"=>"69947669991060", "data"=>{"properties"=>{"first_name"=>"Amber", "last_name"=>"W", "email"=>"amber@sunshinelabs.life", "consent"=>"true"}}, "g-recaptcha-response-data"=>{"mailing_list_69947669991060"=>"03AD1IbLAG68LtZtcuKxxFOopTAFc_TMaSo8a9Z2yR6xcpc6y8...
    * rack.request.form_input                                 : #<StringIO:0x00007f221d261c90>
    * rack.request.query_hash                                 : {}
    * rack.request.query_string                               :
    * rack.run_once                                           : false
    * rack.session                                            : #<ActionDispatch::Request::Session:0x00007f221d28d5c0>
    * rack.session.options                                    : #<ActionDispatch::Request::Session::Options:0x00007f221d28d570>
    * rack.tempfiles                                          : []
    * rack.url_scheme                                         : https
    * rack.version                                            : [1, 6]
    * warden                                                  : Warden::Proxy:69892247415360 @config={:default_scope=>:user, :scope_defaults=>{}, :default_strategies=>{:user=>[:two_factor_authenticatable, :two_factor_authenticatable, :rememberable]}, :intercept_401=>false, :failure_app=>RSolutionsFailureApp}

-------------------------------
Backtrace:
-------------------------------

  app/controllers/concerns/api_actionable.rb:104:in `create_error_actions'
  app/controllers/concerns/api_actionable.rb:81:in `execute_error_actions'
  app/controllers/concerns/api_actionable.rb:76:in `handle_error'