Forest Admin Error After Upgrading to Rails 7.2

Hello Forest Admin Team,

After upgrading my Rails application to version 7.2, I encountered an error when accessing my models through the Forest Admin dashboard.

I have verified that the Company model exists in the application and is correctly configured. The issue seems to have started after the Rails upgrade, as it was functioning fine prior to this.

Things I’ve tried:

  • Ensuring that all models and collections are properly registered in the forest_liana configuration.
  • Verifying Smart Collection routes, but this doesn’t seem to solve the issue.

Has anyone encountered a similar problem after upgrading to Rails 7.2? Any guidance or suggestions would be greatly appreciated.

Thanks in advance!

Below is the relevant log output:

Failure Logs

Started GET "/forest/Company?timezone=Europe%2FIstanbul&fields%5BCompany%5D=id%2Cparasut_id%2Cname%2Caccess_log%2Ccompany_billing_info%2Cfeature_flags%2Clast_available_access_log%2Cparasut_attributes%2Ccreated_at%2Cupdated_at%2Ccrm_integrations_info%2Cparasut_integration%2Cdays_of_stock%2Cdeclared_yearly_revenue_by_user%2Cpricing_list%2Cboard%2Cakaunting_integration%2Cinfo%2Cowner%2Ccurrency%2Clead_time%2Cblacklist_rule%2Cactive_shopify_integration%2Clast_trial_access_log%2Csuggested_plan%2Cmonocle_plan_no_next_sequence%2Conboarding_completed_at%2Cforecasting_window%2Cinternal_apps%2Cstockhound_preference%2Cmetafields_rules%2Capp_preferences%2Caverage_order_value_goal%2Csales_revenue_value_goal%2Cfirst_subscription_access_log%2Cfirst_trial_access_log%2Clast_subscription_access_log%2Cpo_number_next_seq%2Cpo_number_prefix%2Caverage_order_quantity_goal%2Csales_count_goal%2Clocale%2Chighway_integrations%2Cshopify_capped_amount%2Csync_operation&fields%5Baccess_log%5D=id&fields%5Bactive_shopify_integration%5D=id&fields%5Bakaunting_integration%5D=id&fields%5Baverage_order_quantity_goal%5D=id&fields%5Baverage_order_value_goal%5D=id&fields%5Bboard%5D=name&fields%5Bcompany_billing_info%5D=id&fields%5Bfirst_subscription_access_log%5D=id&fields%5Bfirst_trial_access_log%5D=id&fields%5Blast_available_access_log%5D=id&fields%5Blast_subscription_access_log%5D=id&fields%5Blast_trial_access_log%5D=id&fields%5Bowner%5D=name&fields%5Bparasut_integration%5D=id&fields%5Bsales_count_goal%5D=id&fields%5Bsales_revenue_value_goal%5D=id&fields%5Bstockhound_preference%5D=id&fields%5Bsuggested_plan%5D=internal_plan_name&fields%5Bsync_operation%5D=id&page%5Bnumber%5D=1&page%5Bsize%5D=30&sort=-id" for 94.54.16.214 at 2024-10-17 11:33:21 +0300
Cannot render console from 94.54.16.214! Allowed networks: 127.0.0.0/127.255.255.255, ::1
[2024-10-17 11:33:21 +0300] Forest 🌳🌳🌳  No model found for collection Company
[2024-10-17 11:33:21 +0300] Forest 🌳🌳🌳  Routing error: Resource not found for collection Company.
[2024-10-17 11:33:21 +0300] Forest 🌳🌳🌳  If this is a Smart Collection, please ensure your Smart Collection routes are defined before the mounted ForestLiana::Engine?
Processing by ForestLiana::BaseController#route_not_found as JSON

Context

  • Environment name: Development
  • Agent technology: Ruby on Rails
  • Agent (forest package) name & version: 8.0.17
  • Database: postgres
  • Recent changes made on your end if any: rails upgrade

Hello @Alperen_Bozkurt

I didn’t manage to reproduce the bug on my side on Rails 7.2, all my models are correctly listed.
However with the deletion of Rails.application.secret in favor of rails credentials I could not use our agent.

I migrated my application from secrets to credentials. Did you do the same thing on your side?
In the config/initializers/forest_liana.rb file, you need to modify the 2 lines :

ForestLiana.env_secret = Rails.application.secrets.forest_env_secret
ForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret

by

ForestLiana.env_secret = Rails.application.credentials.forest_env_secret
ForestLiana.auth_secret = Rails.application.credentials.forest_auth_secret

I used the rails credentials:edit --environment development command and copied the contents of the config/secrets.yml file into my credentials for each environment.