ForestAdmin behind a proxy

Expected behavior

I am trying to deploy my forest-admin server in production. My company uses a proxy. When I try to open my admin panel, I get an authentication error. It looks like some outgoing request is not going through our proxy and is reaching a timeout. Here is the log I get:

1|upsignon | POST /forest/authentication - - - - ms
1|upsignon | [forest] 🌳🌳🌳  Unexpected error: Forest server request error: connect ETIMEDOUT 18.202.119.50:443
1|upsignon | {
1|upsignon |   "jse_shortmsg": "Forest server request error",
1|upsignon |   "jse_cause": {
1|upsignon |     "errno": -110,
1|upsignon |     "code": "ETIMEDOUT",
1|upsignon |     "syscall": "connect",
1|upsignon |     "address": "18.202.119.50",
1|upsignon |     "port": 443
1|upsignon |   },
1|upsignon |   "jse_info": {},
1|upsignon |   "stack": "VError: Forest server request error: connect ETIMEDOUT 18.202.119.50:443\n    at /root/upsignon-forestadmin/node_modules/forest-express/dist/services/forest-server-requester.js:52:23\n    at Request.callback (/root/upsignon-forestadmin/node_modules/superagent/lib/node/index.js:893:3)\n    at ClientRequest.<anonymous> (/root/upsignon-forestadmin/node_modules/superagent/lib/node/index.js:810:12)\n    at ClientRequest.emit (events.js:315:20)\n    at TLSSocket.socketErrorListener (_http_client.js:469:9)\n    at TLSSocket.emit (events.js:315:20)\n    at emitErrorNT (internal/streams/destroy.js:106:8)\n    at emitErrorCloseNT (internal/streams/destroy.js:74:3)\n    at processTicksAndRejections (internal/process/task_queues.js:80:21)"
1|upsignon | }

Have you ever encountered this type of error ?

Context

  • Package Version: 7.0.0
  • Express Version: 4.17
  • Sequelize Version: 5.15.1

Hello,

At startup and in order to correctly process requests, your server needs to send data to the Forest Admin server (api.forestadmin.com).

It looks like these requests are blocked on your side, and you server does not have access to our API, which is causing these issues.

Hello Guillaume,

These requests are not sent through the proxy. Hence why they error.
I believe something needs to be done in the code so it can work.

I solved my problem by installing global-agent. I think it should be be added to the forest server template by default, or at least documented.
Thank for your help.