Deployment on remote server

Hey everyone, hope you’re doing great !

I could deploy my forest to a remote preprod server, I can find the “Preprod” in the environment tab in forest but it’s not shown in the environment switch dropdown list (screen image)

Capture d’écran 2021-03-17 à 10.36.27

Thanks a lot for your help !

  • forest-express-sequelize: ^7.0.0
  • Express Version: ~4.17.1
  • Sequelize Version: ~5.15.1
  • Database Dialect: postgresSQL
  • Project Name: nostrumcare

Hi @caid,

Is it the same after a page refresh?

Best

Hey @Sliman_Medini

Yes I refreshed and restarted my local forest too :confused:

Ok,

You should be able to see your new environment after having:

  • Enable the environment in the roles
  • Assign this role to your user in order to see it

and also:

https://docs.forestadmin.com/documentation/reference-guide/teams-and-users/manage-roles#manage-a-users-role-and-permission-level

Thanks for the help @Sliman_Medini !

I could create a new role and add a new user, there is what I have now :

I just checked and the forest app is running on remote

Hi @caid ,

Can you please provide any logs you have about this issue?
Both from the browser and the server

Best

@Sliman_Medini I just checked the logs from the server, there is no error :confused:
From the bowser, I have a forbidden error (403) for the request : https://…forest/authentication

Ok,

Can you check on the browser side?
The network tab in dev tools should contain information about the failing request.
Note: you can right-click on the failing request and select “save all as HAR with content”

I have additional questions:
What is your forest-express-sequelize version?
What is your browser model and version?

Thanks

@Sliman_Medini I don’t have the option “save all as HAR” but could get this log file :

“forest-express-sequelize”: “^7.0.0”
Google chrome : Version 88.0.4324.150 (Build officiel) (x86_64)

Best,

Hello @caid,

Could you please share with us more details about the request that are failing? We need to know their request & response headers for both the OPTIONS and GET verbs, from the network tab of your browser.

Without these information, we cannot know why you get some 403 errors at all.

You can blur sensible data if you want, such as the tokens that are shared between the browser and the agent.

We also need to know the precise version that you are using. Could you please launch this command npm list forest-express-sequelize in your directory and past the result here? It will log the exact version that you are using.

Thanks

Hey @GuillaumeGautreau I could get this message from the browser in the network tab for the forest/authentication request :

{error: "invalid_client", error_description: "client authentication failed"}
error: "invalid_client"
error_description: "client authentication failed"

I don’t know how I can give you more information :confused:

I ran the command “npm list forest-express-sequelize” that gave me : forest-express-sequelize@7.0.0

Thanks !

Thank you for these details.

First of all, can you upgrade forest-express-sequelize to the latest version? We released several fixes that might be useful to you.

Regarding your error, can you please verify in your .env file that:

  • The variable FOREST_ENV_SECRET is ending with 79 (I won’t share the whole secret for security reasons)
  • The variable APPLICATION_URL is equal to https://preprod-forest.nostrumcare.fr

Are you running multiple instances of your server in preproduction? Behind a load balancer?

@GuillaumeGautreau yes the secret is finishing by “…cc79” and yes we are running a multiple instances behind a load balancer.

best,

Ok, thanks for the details.

Did you fix the client id variable, as stated in the documentation?

When you deploy an agent to multiple instances, you need to set the variable FOREST_CLIENT_ID to a static value, otherwise it won’t work.

@GuillaumeGautreau thank you soo much, that was the missing part!!! So we generated a FOREST_CLIENT_ID for each of or environment and it’s working now!!!
Thank you so much guys for your precious help :pray::pray::pray:

1 Like

Hey @GuillaumeGautreau I could deploy on preprod and prod but did the same stuff for my remote dev server, the route /forest/authentication is working, but it’s saying that I’m running Forest on my local environment, and there’s this request and error :

https://xxx/forest/coverLists?fields%xxx%5D=createdAt%xxx%xxx%xxx%5D=id&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id&timezone=Europe%2FParis

{errors: [{status: 403, detail: "Forbidden", name: "ForbiddenError"}]}
errors: [{status: 403, detail: "Forbidden", name: "ForbiddenError"}]

Thanks a lot !

Hello @caid,

Would you mind creating a new issue for this? It does not seem to be the same problem. It will help us with following up.

This might be an issue with role setup for said environment.

Hey @anon79585656 dure, sorry for that!!!