Rails 6 app model changes do not show in ForestAdmin

Hi there

Actual behavior

I am actively evaluating ForestAdmin for a Rails6 project hosted on Heroku.

When I redeploy my Herokuapp I could not find the new models in my ForestAdmin.

Actual behavior

What is the current behavior?

Failure Logs

none

Context

Please provide any relevant information about your setup.

Rails 6.1.3.1
forest_liana 6.1.1
pg 1.2.3
psql 13.2

It would not be a big deal if redeploying the Admin Interface would be possible, which, I am quite confident, shows the new models, as in a newly created forest admin

Right now I would need to

  • Create a new ForestAdmin app (from dev machine)
  • Deploy it to Heroku
  • Change env vars in Heroku
  • restart all dynos
  • Recreate all roles and invites

this is of course not a sustainable workflow

Hello @Robert_Dober and welcome on our community forum ! :slight_smile:

I would need some more informations to be able to help you. Can you tell me if your environment is a development environment or a production one?
Did you make your changes in your database and also in your rails model?
What is your project name? And what is the new table / properties name you’ve just added?

Regards,

Hello @Iclisson

yeah that was lot of condensed information so let’s take it step by step again:

I have a Rails6.3.1.3 forest_liana 6.1.1 project deployed to Heroku

Therefore I deployed it locally to my dev machine which then allowed me to deploy it to heroku.

Worked

Then we added two new ActiveRecord models which failed to show up in ForestAdmin, which I could not just redeploy.

As bad as this is I wanted to recreate the app from sratch in order to satisfy our urgent need for a demo.

This however was not possible, as of this error

rails g forest_liana:install 3ac******************************************************d09                                                                                                                     [10:31:43]
Running via Spring preloader in process 62144
/Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/forest_liana-6.1.1/lib/generators/forest_liana/install_generator.rb:11:in `install': undefined method `env_secret' for ForestLiana:Module (NoMethodError)
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:134:in `block in invoke_all'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:134:in `each'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:134:in `map'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:134:in `invoke_all'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/group.rb:232:in `dispatch'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3.1/lib/rails/generators.rb:275:in `invoke'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3.1/lib/rails/commands/generate/generate_command.rb:26:in `perform'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3.1/lib/rails/command/base.rb:69:in `perform'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3.1/lib/rails/command.rb:50:in `invoke'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/railties-6.1.3.1/lib/rails/commands.rb:18:in `<main>'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/robert/derniercri/mooncard-etl/bin/rails:5:in `<main>'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:10:in `block in fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:10:in `block in fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:8:in `fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:8:in `fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:26:in `fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:8:in `fork'
        from /Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/fork_tracker.rb:26:in `fork'
        from <internal:/Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/robert/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from -e:1:in `<main>'

Thanks for your quick answer !

Can you tell me the ruby version you are using? And what is your forestadmin project’s name?
What are the model’s name you added so that I can check if they are present?

Thanks,

I am switching between Ruby 2.7.2 and 3.0.0 (no apparent changes) and I will redploy a new app wihin minutes it will be called MooncardEtlStaging

By default your new models does not show up on your admin interface because you have to activate it. Here is a little video on how to do it.

Let me know if it helps, :slight_smile:

Thank you but the video does not seem to apply to aRails connected app

We made good progress though, something did not work with the upgrade of th .forestadmin-schema.josn file. Right now we just remove it before starting the server and then push it to the production env,

this can be automated, however should that not happen automatically at the rails server restart.

Thank you

Well done, actually I suppose it should be done automatically :slight_smile:

Tell me if you encounter new issue on our platform

Unfortunately I do

after the successful deploy to Heroku we repushed a new version to our staging app, meaning that the
env vars FOREST_ADMIN_* did not change, however we cannot connect FA to the heroku app anymore

here are the rails app traces

2021-04-06T17:03:41.303480+00:00 heroku[router]: at=info method=OPTIONS path="/forest/authentication" host=mooncard-etl-staging.herokuapp.com request_id=1a80e0c4-a864-42e4-8962-ea4dd31d193a fwd="88.160.134.237" dyno=web.1 connect=1ms service=36ms status=404 bytes=1902 protocol=https
2021-04-06T17:03:41.293372+00:00 app[web.1]: I, [2021-04-06T17:03:41.293045 #48]  INFO -- : [1a80e0c4-a864-42e4-8962-ea4dd31d193a] Started OPTIONS "/forest/authentication" for 88.160.134.237 at 2021-04-06 17:03:41 +0000
2021-04-06T17:03:41.300827+00:00 app[web.1]: F, [2021-04-06T17:03:41.300717 #48] FATAL -- : [1a80e0c4-a864-42e4-8962-ea4dd31d193a]
2021-04-06T17:03:41.300829+00:00 app[web.1]: [1a80e0c4-a864-42e4-8962-ea4dd31d193a] ActionController::RoutingError (No route matches [OPTIONS] "/forest/authentication"):
2021-04-06T17:03:41.300830+00:00 app[web.1]: [1a80e0c4-a864-42e4-8962-ea4dd31d193a]

Hopefully I did not miss anything obvious, has been a long day :sweat:
Thank you in advance

definitely not a ForestAdmin problem per se, as I have now done redeploys without problems, so there must be a stupid but not easy to find mistake here

maybe a routine checklist?

Thx in advance

Like e.g. loosing config/initializers/forest_liana.rb

Sorry for the noise