Installation not working on my Rails App

Hi, I was having some issues with Forest in my Rails App, so I decided to create a new project and install de Ruby on Rails Admin Panel. However, when I’m installing it, I get to the part were I generate the forest_liana:install command with my key. Then, I run my server and Forest starts calling the localhost:3000 url for development environment. And my local machine is getting the logs that Forest is trying to call my app, but everytime it calls it, I get:

Started GET "/forest" for ::1 at 2021-04-19 13:34:08 -0500
Processing by ForestLiana::ApimapsController#index as */*
Completed 204 No Content in 0ms (ActiveRecord: 0.0ms | Allocations: 67)

And it keeps calling and callign, but the same answer. And, in the installation page, it keeps in the “Waiting for server to respond” part. I don’t know if I’m doing something wrong or what, but I haven’t been able to install it. Please help

I have a PostrgreSQL database, for development and production. Does that mean I have to install for PostgreSQL? I can’t do it for the new Rails feature?

Hello @Santiago_Giraldo,

Thanks for your message and sorry to hear you’re having some troubles installing Forest Admin!
Let’s dig into your issue. :male_detective:

I have a PostrgreSQL database, for development and production. Does that mean I have to install for PostgreSQL? I can’t do it for the new Rails feature?

→ You definitely can use Forest Admin through the new in-app Rails feature.

Silly question: are you sure your Rails App is running on http://localhost:3000?
And can you tell what you see in your browser network? Failing calls to http://localhost:3000/forest? :thinking:

Thanks!

Hi adriguy. Thanks for your anwer. Amazing that I can use the Rails feature!

Yes, I’m sure. I tried changing the port in the installation process and lunch my server in that port, but it doesn’t work either. So I kept going with the http://localhost:3000.

No, the call is made and it returns this:

Captura de pantalla de 2021-04-20 08-44-59

Also, in my local machine, I get the logs:

But the installation page stays in the same

Captura de pantalla de 2021-04-20 08-47-27

Ok thanks for your answer @Santiago_Giraldo.

Do you have any error when you start your server?

And can you check that the forest_env_secret that is given in your secrets.yml file matches the key following the rails g forest_liana:install command?
image

Yes, I already checked that the forest_env_secret is the same in secrets.yml and in the installation page. But still doesn’t work.

Ok and do you have any error when you start your server?

Nope, no error:

@Santiago_Giraldo too bad, it could have given us some clues…

I’ve just tried to create an in-app Rails forest admin server and it worked well :thinking:

What is your Rails version?

Yess, that would be great, to have some clues :frowning:

My Rails version is 6.0.2
And I’m using the 6.0.0 version of forest_liana gem

Hello @Santiago_Giraldo,

Would you mind updating your forest_liana gem to 6.3.1 to see if you still have the issue?

I tried it, but it didn’t work either. Stays in the same page with the same behaviour.

I got this in console:

Captura de pantalla de 2021-04-21 09-10-55

Could you please give me the project name? So I can check our internal tools? Thank you

Yes. It’s Arkangel AI Rails.

Thank you @Santiago_Giraldo

Apparently, something in the process went wrong, and I am unable to reproduce your issue.

Would you mind redoing the onboarding once again and let me know if the issue persists?

Thanks

I already did everything, but still doesn’t work :frowning: Deleted the project and create a new one with the same name, and still didn’t work @anon90145840

Hello @Santiago_Giraldo,

It looks like your server is running, but its first action on startup should be to send the model to Forest Admin.

As you could see, the frontend is checking if the endpoint is running, but it also waits for the model to be received by our server. And in your case it looks like it was not.

I’m investigating to see if I can find more details about the issue, but the first thing you’d like to check is the environment secret, and how it is passed to the liana.

Could you please add a log just to check that the value is correct?

I checked the code, and created an issue on the package forest-rails because it does not show any error if the env_secret is missing when initializing the liana.

For what I understand of your issue, it’s really very likely that this value is not correctly passed to the ForestLiana.

In a working example, I have 2 important lines that you might want to check:

In my config/secrets.yml

development:
  forest_env_secret: ABCDE
  forest_auth_secret: FGHI
  secret_key_base: XXXX
  forest_application_url: https://localhost:3000

And then in config/initializers/forest_liana.rb

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

Can you please that the variable names are matching in your case? Can you add a log that will display the value that you are passing to ForestLiana.env_secret just to check that it’s correctly executed with the right value?

Okay, so I verified and I print the value of ForestLiana in the logs and here is the proof that everything is the same :confused:

Still not working, in the onboarding it keeps on the same screen @GuillaumeGautreau

Ok, I checked your env secret and it looks correct too.

It seems that the liana is correctly initialized. Then we need to discover why Forest Admin is not receiving the data model. I’m investigating on my side to see if I can spot something.