After upgrading to Rails 7.1 I can’t access my data.
I get :
[2023-11-23 11:45:02 +0100] Forest 🌳🌳🌳 An error occured while retrieving your IP whitelist. Your Forest env_secret seems to be missing or unknown. Can you check that you properly set your Forest env_secret in the forest_liana initializer?
If I rollback to Rails 7.0.8 it works perfectly.
Expected behavior
I should see my data
Failure Logs
[2023-11-23 11:45:02 +0100] Forest 🌳🌳🌳 An error occured while retrieving your IP whitelist. Your Forest env_secret seems to be missing or unknown. Can you check that you properly set your Forest env_secret in the forest_liana initializer?
Context
Environment name: Rails in development
Agent (forest package) name & version: forest_liana (8.0.16) gem
Database type: postgresql
Recent changes made on your end if any: Upgrade to Rails 7.1
Thank you for your answer. I supposed that your team did test with Rails 7.1 as it is out for a while now.
I did rails dev:cache (twice). First answer was Development mode is no longer being cached. and the second one Development mode is now being cached. (which I believe is what we want). Then I did a rails tmp:cache:clear. Restarted the server and still got the same error.
It’s probably something on my side but I can’t se what. I had trouble with custom SmartActions and fields so I did this in config/application.rb but it shouldn’t change anything there…
Did you follow this migration note when upgrading?
Could you please share the result of that command rails zeitwerk:check?
And can you share the exact server logs you’re having when you’re trying to access your data?
You may verify them manually, or add them to config.eager_load_paths
in config/application.rb and run zeitwerk:check again.
Otherwise, all is good!
which should be ok for Forest purposes.
This is the log I see when trying to access my data :
Started GET “/admin/sidekiq/stats” for ::1 at 2023-11-23 16:20:42 +0100
User Load (2.4ms) SELECT “users”.* FROM “users” WHERE “users”.“id” = $1 ORDER BY “users”.“created_at” ASC, “users”.“id” ASC LIMIT $2 [[“id”, “cdadbf61-8f16-4290-b413-32555fa1c025”], [“LIMIT”, 1]]
Started POST “/forest/authentication” for ::1 at 2023-11-23 16:20:51 +0100
Processing by ForestLiana::AuthenticationController#start_authentication as /
Parameters: {“renderingId”=>“207252”}
[2023-11-23 16:20:51 +0100] Forest An error occured while retrieving your IP whitelist. Your Forest env_secret seems to be missing or unknown. Can you check that you properly set your Forest env_secret in the forest_liana initializer?
Filter chain halted as :reject_unauthorized_ip rendered or redirected
Completed 403 Forbidden in 172ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 1738)
Our account is on team plan (marketing discussions are in progress for upgrading but they are not done yet) so I can’t see the “security” panel in settings.
I’ll try adding debugger breakpoints into Forest gem on Monday to investigate further and understand where the issue comes from but this will be a long process.
In the mean time, if you have any idea of anything else to test or a place where I should break in the gem (Saving me some reading/debug time), that would be awesome !
The error I get from the response is :
Status : 422
Body :
{
"errors": [
{
"status": 422,
"detail": "Missing or invalid secretKey in the request is unprocessable",
"meta": {
"entityName": "Missing or invalid secretKey in the request"
},
"name": "InvalidSecretKeyError"
}
]
}
I went down a bit lower into the rabbit hole with some extra breakpoints and the issue was indeed on my side. I’ve missed a migration from secrets (which forest installer uses/creates and are now deprecated in Rails 7.1) to credentials.
Thanks a lot for your help and sorry for the time it took you