Can not access to some data's table & error Related Data

check the video => Streamable

Failure Logs

Context

Please provide in this mandatory section, the relevant information about your configuration:

  • Project name: Joombo
  • Team name: Thomas EUDE / Operations
  • Environment name: Production
  • Agent type & version: Admin

Hello @JOOMBO,

Could you please share with us the details about the query that is failing (request and response)? You’ll be able to see it in the network tab.

I’m not sure to understand what went wrong with only this log.

Thanks

hello Guillaume,

Are you waiting something like that ?

  1. Request URL:

https://www.joombo.co/forest/CompanyProfile/333/relationships/views/count?fields[View]=id%2Cname%2Conboarding_customers%2Ccounter_view%2Cdefault_view%2Cprofile_view%2Ccompany_profile%2Cfooter%2Ccreated_at%2Cupdated_at%2Cdesign%2Cslug&fields[profile_view]=name&fields[company_profile]=company&fields[footer]=id&fields[design]=id&timezone=America%2FLima

  1. Request Method:

GET

  1. Status Code:

500 Internal Server Error

  1. Remote Address:

3.226.182.14:443

  1. Referrer Policy:

origin

  1. Response HeadersView source

  2. Access-Control-Allow-Credentials:

true

  1. Access-Control-Allow-Methods:

GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS

  1. Access-Control-Allow-Origin:

https://app.forestadmin.com

  1. Access-Control-Expose-Headers

  2. Access-Control-Max-Age:

86400

  1. Cache-Control:

no-cache

  1. Connection:

keep-alive

  1. Content-Type:

application/json

  1. Date:

Sat, 08 Jan 2022 20:31:46 GMT

  1. Referrer-Policy:

strict-origin-when-cross-origin

  1. Server:

Cowboy

  1. Strict-Transport-Security:

max-age=31536000; includeSubDomains

  1. Transfer-Encoding:

chunked

  1. Vary:

Origin

  1. Via:

1.1 vegur

  1. X-Content-Type-Options:

nosniff

  1. X-Download-Options:

noopen

  1. X-Frame-Options:

SAMEORIGIN

  1. X-Permitted-Cross-Domain-Policies:

none

  1. X-Request-Id:

2e253539-aa03-495b-b9e0-5e49dd495dd8

  1. X-Runtime:

0.003287

  1. X-Xss-Protection:

1; mode=block

  1. Request HeadersView source

  2. Accept:

application/json

  1. Accept-Encoding:

gzip, deflate, br

  1. Accept-Language:

en-GB,en-US;q=0.9,en;q=0.8,fr;q=0.7

  1. Authorization:

Edited

  1. Connection:

keep-alive

  1. Content-Type:

application/json

  1. Host:

www.joombo.co

  1. Origin:

https://app.forestadmin.com

  1. Referer:

https://app.forestadmin.com/

  1. sec-ch-ua:

" Not;A Brand";v=“99”, “Google Chrome”;v=“97”, “Chromium”;v=“97”

  1. sec-ch-ua-mobile:

?0

  1. sec-ch-ua-platform:

“macOS”

  1. Sec-Fetch-Dest:

empty

  1. Sec-Fetch-Mode:

cors

  1. Sec-Fetch-Site:

cross-site

  1. User-Agent:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Ok, thanks for your reply.

So, for what I can see here, your agent is returning a 500 error to the call on GET https://www.joombo.co/forest/CompanyProfile/333/relationships/views/count.

Do you have any detail in the response’s body?

Also, as your agent is returning this error, can you check if you have any logs on your agent? It would help figure out the origin of this error.

No detail in the response’s body

For the logs that I have on my app, here you can see :

632 <158>1 2022-01-11T21:10:17.508745+00:00 heroku router - - at=info method=GET path="/forest/CompanyProfile/333/relationships/views/count?fields%5BView%5D=id%2Cname%2Conboarding_customers%2Ccounter_view%2Cdefault_view%2Cprofile_view%2Ccompany_profile%2Cfooter%2Ccreated_at%2Cupdated_at%2Cdesign%2Cslug&fields%5Bprofile_view%5D=name&fields%5Bcompany_profile%5D=company&fields%5Bfooter%5D=id&fields%5Bdesign%5D=id&timezone=America%2FLima" host=www.joombo.co request_id=7034ebf8-a3fb-4fb5-814c-0fc7791f4459 fwd=“181.66.90.235” dyno=web.1 connect=0ms service=9ms status=500 bytes=750 protocol=https

Go to the log: https://api.heroku.com/myapps/app186713791@heroku.com/addons/logentries

You are receiving this email because your Logentries alarm “error_500”
has been triggered.

Correlation ID: 862efc8d-e234-4c00-922e-7257698639ed

In context:
2022-01-11 17:14:33.844 416 <158>1 2022-01-11T17:14:33.361482+00:00 heroku router - - at=info method=GET path="/magnet_profiles/1276?4py8188mo9592285&utm_source=joombo-support&utm_medium=codeqr&utm_campaign=2nd-p&utm_content=fr&utm_term=lther" host=www.joombo.co request_id=c3734c8b-63c3-4262-860e-3df90ff7f9b2 fwd=“80.215.36.192” dyno=web.1 connect=0ms service=103ms status=200 bytes=7804 protocol=https
2022-01-11 17:14:34.458 325 <158>1 2022-01-11T17:14:33.987139+00:00 heroku router - - at=info method=GET path="/codemirror/mode/javascript/javascript.js" host=www.joombo.co request_id=1cdf1393-75e3-4a35-bffd-65bd56be7264 fwd=“80.215.36.192” dyno=web.1 connect=0ms service=1ms status=200 bytes=39060 protocol=https
2022-01-11 17:49:39.805 696 <134>1 2022-01-11T17:49:04+00:00 app heroku-postgres - - source=DATABASE addon=postgresql-flexible-14288 sample#current_transaction=134374 sample#db_size=23826991bytes sample#tables=24 sample#active-connections=7 sample#waiting-connections=0 sample#index-cache-hit-rate=0.9974 sample#table-cache-hit-rate=0.99678 sample#load-avg-1m=0 sample#load-avg-5m=0 sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.30292 sample#tmp-disk-used=542765056 sample#tmp-disk-available=72436027392 sample#memory-total=4018284kB sample#memory-free=54080kB sample#memory-cached=3357124kB sample#memory-postgres=26268kB sample#wal-percentage-used=0.06576925128100947
2022-01-11 18:39:32.973 313 <158>1 2022-01-11T18:39:32.44154+00:00 heroku router - - at=info method=GET path="/codemirror/lib/codemirror.js" host=www.joombo.co request_id=d30ef9c1-0e65-440a-98f3-becb6ecf9194 fwd=“46.211.101.59” dyno=web.1 connect=0ms service=6ms status=200 bytes=398977 protocol=https
2022-01-11 19:11:11.889 311 <158>1 2022-01-11T19:11:11.421218+00:00 heroku router - - at=info method=GET path="/codemirror/lib/codemirror.js" host=joombo.co request_id=218cc437-adc3-4587-9de4-2918a6d5351f fwd=“92.184.118.154” dyno=web.1 connect=0ms service=7ms status=200 bytes=398977 protocol=https
2022-01-11 19:11:12.102 369 <158>1 2022-01-11T19:11:11.658249+00:00 heroku router - - at=info method=GET path="/assets/application-072321194eef6ed8665e223f8d85a760cd146797a51257a33f39df15c72ba45a.css" host=joombo.co request_id=dabd3cad-e5c4-457b-844c-49755896e546 fwd=“92.184.118.154” dyno=web.1 connect=0ms service=2ms status=200 bytes=48991 protocol=https
2022-01-11 19:23:27.832 676 <158>1 2022-01-11T19:23:27.347888+00:00 heroku router - - at=info method=GET path="/forest/CompanyProfile?timezone=America%2FLima&fields%5BCompanyProfile%5D=id%2Ccompany%2Cuser%2Cfirst_name%2Clast_name%2Cprofile_picture_blob%2Cprofile_picture_attachment%2Clanguage%2Conboarding%2Ccreated_at%2Cupdated_at&fields%5Bprofile_picture_attachment%5D=name&fields%5Bprofile_picture_blob%5D=filename&fields%5Buser%5D=email&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id" host=www.joombo.co request_id=f646702b-b663-4fb8-a66c-1111c04f51aa fwd=“181.66.90.235” dyno=web.1 connect=0ms service=265ms status=304 bytes=747 protocol=https
2022-01-11 20:32:43.901 329 <158>1 2022-01-11T20:32:43.292015+00:00 heroku router - - at=info method=GET path="/packs/js/application-341c06991551bd9d8700.js" host=www.joombo.co request_id=d52fc613-e86b-4885-9cb3-a30a1bc2d1c8 fwd=“37.173.79.57” dyno=web.1 connect=0ms service=5ms status=200 bytes=288639 protocol=https
2022-01-11 20:33:04.578 635 <158>1 2022-01-11T20:33:04.10596+00:00 heroku router - - at=info method=GET path="/forest/CompanyProfile/count?fields%5BCompanyProfile%5D=id%2Ccompany%2Cuser%2Cfirst_name%2Clast_name%2Cprofile_picture_blob%2Cprofile_picture_attachment%2Clanguage%2Conboarding%2Ccreated_at%2Cupdated_at&fields%5Buser%5D=email&fields%5Bprofile_picture_blob%5D=filename&fields%5Bprofile_picture_attachment%5D=name&searchExtended=0&timezone=America%2FLima" host=www.joombo.co request_id=479cbb7a-53ae-4ed6-a701-5e0b8d162652 fwd=“181.66.90.235” dyno=web.1 connect=0ms service=291ms status=304 bytes=747 protocol=https
2022-01-11 20:37:56.081 387 <158>1 2022-01-11T20:37:55.546146+00:00 heroku router - - at=info method=GET path="/assets/font-awesome/fa-brands-400-c40f9aba3abc6fd5b0b28b1b125daa3b7bc43063955d456ae4d529705a6c975c.woff2" host=www.joombo.co request_id=cd59ce89-f419-471c-b20a-db1d657ef442 fwd=“37.165.6.38” dyno=web.1 connect=0ms service=1ms status=200 bytes=78683 protocol=https
2022-01-11 21:10:17.982 632 <158>1 2022-01-11T21:10:17.508745+00:00 heroku router - - at=info method=GET path="/forest/CompanyProfile/333/relationships/views/count?fields%5BView%5D=id%2Cname%2Conboarding_customers%2Ccounter_view%2Cdefault_view%2Cprofile_view%2Ccompany_profile%2Cfooter%2Ccreated_at%2Cupdated_at%2Cdesign%2Cslug&fields%5Bprofile_view%5D=name&fields%5Bcompany_profile%5D=company&fields%5Bfooter%5D=id&fields%5Bdesign%5D=id&timezone=America%2FLima" host=www.joombo.co request_id=7034ebf8-a3fb-4fb5-814c-0fc7791f4459 fwd=“181.66.90.235” dyno=web.1 connect=0ms service=9ms status=500 bytes=750 protocol=https

Hello Guillaume,

Please tell me if you need futher information

Thomas

Hello @JOOMBO,

Unfortunately this doesn’t give us much more insight on what cause the issue on your side. Do you have any other logs for the agent/server ?

If not could you try to reproduce this in development environment ?

Thanks for your response.

Morgan

Hello Morgan,

Sure, hope it can help you

Started GET “/forest/CompanyProfile/1/relationships/views/count?fields%5BView%5D=id%2Ccompany_profile%2Ccounter_view%2Ccreated_at%2Cdefault_view%2Cfooter%2Cname%2Conboarding_customers%2Cprofile_view%2Cupdated_at%2Cslug%2Cdesign&fields%5Bcompany_profile%5D=id&fields%5Bfooter%5D=id&fields%5Bprofile_view%5D=name&fields%5Bdesign%5D=id&timezone=America%2FLima” for ::1 at 2022-01-19 11:02:33 -0500

Processing by ForestLiana::AssociationsController#count as JSON

Parameters: {“fields”=>{“View”=>“id,company_profile,counter_view,created_at,default_view,footer,name,onboarding_customers,profile_view,updated_at,slug,design”, “company_profile”=>“id”, “footer”=>“id”, “profile_view”=>“name”, “design”=>“id”}, “timezone”=>“America/Lima”, “collection”=>“CompanyProfile”, “id”=>“1”, “association_name”=>“views”}

[2022-01-19 11:02:33] Forest :deciduous_tree::deciduous_tree::deciduous_tree: Association Index Count error: undefined method `klass’ for nil:NilClass

More logs

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/reflection.rb:788:in `source_reflection’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/reflection.rb:987:in `derive_class_name’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/reflection.rb:165:in `class_name’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/reflection.rb:767:in `klass’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/services/forest_liana/has_many_getter.rb:44:in `block in compute_includes’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/services/forest_liana/has_many_getter.rb:42:in `select’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/services/forest_liana/has_many_getter.rb:42:in `compute_includes’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/services/forest_liana/has_many_getter.rb:14:in `initialize’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/controllers/forest_liana/associations_controller.rb:28:in `new’

/Users/thomaseude/.gem/ruby/2.6.0/gems/forest_liana-6.0.5/app/controllers/forest_liana/associations_controller.rb:28:in `count’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/abstract_controller/base.rb:195:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/rendering.rb:30:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/callbacks.rb:135:in `run_callbacks’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/abstract_controller/callbacks.rb:41:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/rescue.rb:22:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/notifications.rb:180:in `block in instrument’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/notifications.rb:180:in `instrument’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/instrumentation.rb:32:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal/params_wrapper.rb:245:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/railties/controller_runtime.rb:27:in `process_action’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/abstract_controller/base.rb:136:in `process’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionview-6.0.4.1/lib/action_view/rendering.rb:39:in `process’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal.rb:190:in `dispatch’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_controller/metal.rb:254:in `dispatch’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/route_set.rb:33:in `serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:49:in `block in serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:32:in `each’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:32:in `serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/route_set.rb:834:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-cors-1.1.1/lib/rack/cors.rb:100:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/engine.rb:527:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/railtie.rb:190:in `public_send’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/railtie.rb:190:in `method_missing’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/mapper.rb:19:in `block in class:Constraints

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/mapper.rb:48:in `serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:49:in `block in serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:32:in `each’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/journey/router.rb:32:in `serve’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/routing/route_set.rb:834:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch’

/Users/thomaseude/.gem/ruby/2.6.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/http/content_security_policy.rb:18:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/cookies.rb:654:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activerecord-6.0.4.1/lib/active_record/migration.rb:567:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/callbacks.rb:101:in `run_callbacks’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/callbacks.rb:26:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/executor.rb:14:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/web-console-4.0.4/lib/web_console/middleware.rb:132:in `call_app’

/Users/thomaseude/.gem/ruby/2.6.0/gems/web-console-4.0.4/lib/web_console/middleware.rb:28:in `block in call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/web-console-4.0.4/lib/web_console/middleware.rb:17:in `catch’

/Users/thomaseude/.gem/ruby/2.6.0/gems/web-console-4.0.4/lib/web_console/middleware.rb:17:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/rack/logger.rb:37:in `call_app’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/rack/logger.rb:26:in `block in call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/tagged_logging.rb:80:in `block in tagged’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/tagged_logging.rb:28:in `tagged’

/Users/thomaseude/.gem/ruby/2.6.0/gems/activesupport-6.0.4.1/lib/active_support/tagged_logging.rb:80:in `tagged’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/rack/logger.rb:26:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/quiet_assets.rb:13:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/remote_ip.rb:81:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/request_id.rb:27:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/executor.rb:14:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/static.rb:126:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/actionpack-6.0.4.1/lib/action_dispatch/middleware/host_authorization.rb:82:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-cors-1.1.1/lib/rack/cors.rb:100:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/webpacker-4.3.0/lib/webpacker/dev_server_proxy.rb:23:in `perform_request’

/Users/thomaseude/.gem/ruby/2.6.0/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/railties-6.0.4.1/lib/rails/engine.rb:527:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/puma-4.3.6/lib/puma/configuration.rb:228:in `call’

/Users/thomaseude/.gem/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:713:in `handle_request’

/Users/thomaseude/.gem/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:472:in `process_client’

/Users/thomaseude/.gem/ruby/2.6.0/gems/puma-4.3.6/lib/puma/server.rb:328:in `block in run’

/Users/thomaseude/.gem/ruby/2.6.0/gems/puma-4.3.6/lib/puma/thread_pool.rb:134:in `block in spawn_thread’

Completed 500 Internal Server Error in 3ms (ActiveRecord: 0.0ms | Allocations: 1390)

Hello @JOOMBO,

The issue seems to comes from active_record reflect_on_all_associations mechanism not working as intended.

From your logs I see that your using forest_liana version 6.0.5 and active_record version 6.0.4.1.

  • What version of ruby on rails do you use ?
  • Can you share the CompanyProfile model and also the View one ? I want to check your models associations.

Thanks in advance for your time.

Kind regards,
Morgan

Hello,

version of rails => ‘rails’, ‘~> 6.0.3’, ‘>= 6.0.3.2’

Model View
class View < ApplicationRecord
extend FriendlyId
friendly_id :slug_candidates, :use => :slugged

belongs_to :company_profile

has_one :profile_view, dependent: :destroy
has_one :footer, dependent: :destroy
has_one :design, dependent: :destroy

has_many :stat_views, dependent: :destroy
has_many :magnet_profiles
has_many :magnet, through: :magnet_profile
has_many :links, dependent: :destroy

validates :name, presence: true
validates :name, length: { in: 1…200 }
validates :counter_view, numericality: true

after_create :create_all_after_view_creation
before_destroy :change_magnet_profile_view

def change_magnet_profile_view
self.magnet_profiles.each do |mp|
self.company_profile.views.where(default_view: true).length == 0 ? mp.update(view: nil) : mp.update(view: self.company_profile.views.where(default_view: true).first)
end
end

def create_all_after_view_creation
Footer.create(view: self)
ProfileView.create(name: “#{self.company_profile.first_name.capitalize} #{self.company_profile.last_name.capitalize}”, company: self.company_profile.company, view: self)
Link.create(view: self)
Design.create(view: self)
end

def slug_candidates
[:name, [:name, :id]]
end
end

Model CompanyProfile
class CompanyProfile < ApplicationRecord
belongs_to :user

has_many :views, dependent: :destroy

has_one_attached :profile_picture

validates :first_name, :last_name, :company, presence: true
validates :first_name, :last_name, :company, length: { in: 1…20 }

before_create :default_if_empty
after_create :view_creation

def default_if_empty
self.first_name == “” ? “Stranger” : self.first_name.capitalize
self.last_name == “” ? “Thing” : self.last_name.capitalize
self.company == “” ? “Netflix” : self.company.capitalize
end

def view_creation
company_profile = self
view_created = View.create(company_profile: company_profile, name:“My first view”, counter_view: 0, default_view: true)
end

end

Thanks for your help