agent-nodejs icon indicating copy to clipboard operation
agent-nodejs copied to clipboard

App Crashes due to some timeout

Open WardBrink opened this issue 2 years ago • 4 comments

Expected behavior

Forest Admin should not crash my application when running idle.

Actual behavior

Sometimes our production application crashes bcause of some timeout that happens when doing some kind of backgorund auth call.

Failure Logs

Oct 20 16:46:06 Schema was not updated since last run Oct 20 16:46:09 [20-10-2023 14:46:09] [error]: uncaughtException: outgoing request timed out after 3500ms Oct 20 16:46:09 RPError: outgoing request timed out after 3500ms Oct 20 16:46:09 at /app/node_modules/openid-client/lib/helpers/request.js:137:13 Oct 20 16:46:09 at async Function.register (/app/node_modules/openid-client/lib/client.js:1453:22) Oct 20 16:46:09 at async Authentication.bootstrap (/app/node_modules/@forestadmin/agent/dist/routes/security/authentication.js:17:23) Oct 20 16:46:09 at async Promise.all (index 3) Oct 20 16:46:09 at async Agent.getRouter (/app/node_modules/@forestadmin/agent/dist/agent.js:150:9) Oct 20 16:46:09 at async Promise.all (index 0) Oct 20 16:46:09 at async Agent.buildRouterAndSendSchema (/app/node_modules/@forestadmin/agent/dist/agent.js:165:26) Oct 20 16:46:09 at async Agent.restart (/app/node_modules/@forestadmin/agent/dist/agent.js:76:31) Oct 20 16:46:09 RPError: outgoing request timed out after 3500ms Oct 20 16:46:09 at /app/node_modules/openid-client/lib/helpers/request.js:137:13 Oct 20 16:46:09 at async Function.register (/app/node_modules/openid-client/lib/client.js:1453:22) Oct 20 16:46:09 at async Authentication.bootstrap (/app/node_modules/@forestadmin/agent/dist/routes/security/authentication.js:17:23) Oct 20 16:46:09 at async Promise.all (index 3) Oct 20 16:46:09 at async Agent.getRouter (/app/node_modules/@forestadmin/agent/dist/agent.js:150:9) Oct 20 16:46:09 at async Promise.all (index 0) Oct 20 16:46:09 at async Agent.buildRouterAndSendSchema (/app/node_modules/@forestadmin/agent/dist/agent.js:165:26) Oct 20 16:46:09 at async Agent.restart (/app/node_modules/@forestadmin/agent/dist/agent.js:76:31)

Context

We are running a Node.js application with Express on Heroku. Sometimes our application crashes because of this timeout.

This is the codesnippet we use to start Forest Admin in our app.js

createAgent({ authSecret: process.env.FOREST_AUTH_SECRET, envSecret: process.env.FOREST_ENV_SECRET, isProduction: process.env.NODE_ENV === 'production' }) .addDataSource(createMongooseDataSource(connection, {flattenMode: 'none'})) .mountOnExpress(app) .start();

  • Package Version: "@forestadmin/agent": "^1.35.10", "@forestadmin/datasource-mongoose": "^1.5.28",

WardBrink avatar Oct 20 '23 14:10 WardBrink

Hello, Thank you for the report. we'll investigate the problem and get back to you as soon as possible. 🙏

Scra3 avatar Oct 23 '23 07:10 Scra3

What is your project name and your environment name? It will help us to monitor your http requests 🙏 .

Scra3 avatar Oct 23 '23 08:10 Scra3

Project is Tradermath and environment where it happens is Production.

WardBrink avatar Oct 23 '23 09:10 WardBrink

Hello @WardBrink,

Do you still experience the issue? If it's the case, can you please open a topic on the community forum?

ghusse avatar Dec 14 '23 11:12 ghusse