Express agent causing entire app to restart once in a while

Hi there,

We’ve been using ForestAdmin for a few months now and are quite happy with it, thanks for a great product!

However, we’ve been seeing some unexpected restarts of our app (around once a week) that seem to be caused by the ForestAdmin servers being unreachable.

This is an express backend using createAgent().mountOnExpress(app) to initialize ForestAdmin, we’re using @forestadmin/agent v1.16.2 .

Is there a better way to initialize the agent, to prevent this error from causing the entire app to crash?

Merci d’avance,
Julien

Failure Logs

2023-10-15 04:33:06.393835285 +0200 CEST [web-2] info: Schema was not updated since last run
2023-10-15 04:53:14.190726442 +0200 CEST [web-2] /app/node_modules/openid-client/lib/helpers/request.js:137
2023-10-15 04:53:14.190747533 +0200 CEST [web-2] throw new RPError(`outgoing request timed out after ${opts.timeout}ms`);
2023-10-15 04:53:14.190749441 +0200 CEST [web-2] RPError: outgoing request timed out after 3500ms
2023-10-15 04:53:14.190748997 +0200 CEST [web-2] ^
2023-10-15 04:53:14.190749894 +0200 CEST [web-2] at /app/node_modules/openid-client/lib/helpers/request.js:137:13
2023-10-15 04:53:14.190752606 +0200 CEST [web-2] at async Agent.buildRouterAndSendSchema (/app/node_modules/@forestadmin/agent/dist/agent.js:165:26)
2023-10-15 04:53:14.190751757 +0200 CEST [web-2] at async Agent.getRouter (/app/node_modules/@forestadmin/agent/dist/agent.js:150:9)
2023-10-15 04:53:14.190752979 +0200 CEST [web-2] at async Agent.restart (/app/node_modules/@forestadmin/agent/dist/agent.js:76:31)
2023-10-15 04:53:14.190753356 +0200 CEST [web-2] Node.js v18.17.1
2023-10-15 04:53:14.190751318 +0200 CEST [web-2] at async Promise.all (index 3)
2023-10-15 04:53:14.190750442 +0200 CEST [web-2] at async Client.register (/app/node_modules/openid-client/lib/client.js:1426:22)
2023-10-15 04:53:14.190750864 +0200 CEST [web-2] at async Authentication.bootstrap (/app/node_modules/@forestadmin/agent/dist/routes/security/authentication.js:17:23)
2023-10-15 04:53:14.190752183 +0200 CEST [web-2] at async Promise.all (index 0)

Context

  • Project name: carecare-coordination
  • Environment name: Staging
  • Agent (forest package) name & version: @forestadmin/agent:1.16.2
  • Database type: Postgre

Hello,
Did you try to update your agent to the latest version?
:pray: