Forest Admin 500 Internal Server Error

Hello, community,

On this occasion, I am doing a simple integration test with Node.js, Express, and a model defined with Mongoose.Schema.

Additionally, I am using Ngrok to expose my local environment as a connection to a production environment, allowing it to receive requests from Forest Admin.

Environment:

Failure Logs

Ngrok log

image

Browser errors

Context

  • Project name: wallet-forestadmin
  • Team name: Operations
  • Environment name: QA
  • Database type: MongoDB
    “dependencies”: {
    @forestadmin/agent”: “^1.0.0”,
    @forestadmin/datasource-mongoose”: “^1.0.0”,
    “cors”: “^2.8.5”,
    “dotenv”: “^16.0.1”,
    “express”: “^4.18.2”,
    “mongoose”: “^6.10.3”
    },

Hello,
Can you start the agent before listening on the server :pray: ?

Hi again,

Done. But the problem is the same

Can you upgrade your agent and datasource-mongoose dependencies to the latest version :pray: ?

Now I’m using the latest version:

image

Still the problem

It’s a bit strange, on ngrok’s side you get a 500 error, but on your agent’s side it’s a 404 error.
Do you know why? Instead of using ngrok, is it possible to use localhost directly?
In development environment, your agent can be run on your localhost.

Okay…

After enabling the development environment, but I still have the same problem

Can you add an other collection on your mongo database to check if we have the same behavior ?

When I set my NODE_ENV=development I get this error but when change it to production, disappears

Wow, the agent doesn’t seem to support your time zone… I’m checking on my side.
Can you try to change your timezone please?

from here:

the same

Hello again,
What is your node version? :pray:
Can you upgrade your version and try again?

The code that causes problem =>

 if (!QueryStringParser.VALID_TIMEZONES.has(timezone)) {
    // This is a method to validate a timezone using node only
    // @see https://stackoverflow.com/questions/44115681
    if (!Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone) {
    throw new Error('Time zones are not available in this environment');
  }

The Intl documentation: Internationalization support | Node.js v21.6.0 Documentation. You can also try to build without intertonalization features.

We need your timezone because when you are requesting some data included date field we need it to make the right computation.