403 Forbidden Error on Test env

Feature(s) impacted

I receive 403 errors on each model on TEST env (ADMIN role). But on Prod env all is working. Also other team members also receive 403 errors on creation (ADMIN role).

Failure Logs

==================================
2024-02-20 13:56:51.199
at async cors (/app/node_modules/@koa/cors/index.js:109:16)
2024-02-20 13:56:51.199
at async bodyParser (/app/node_modules/koa-bodyparser/index.js:78:5)
2024-02-20 13:56:51.199
at async ErrorHandling.errorHandler (/app/node_modules/@forestadmin/agent/dist/routes/system/error-handling.js:20:13)
2024-02-20 13:56:51.199
at async Logger.logger (/app/node_modules/@forestadmin/agent/dist/routes/system/logger.js:20:13)
2024-02-20 13:56:51.199
at async CountRoute.handleCount (/app/node_modules/@forestadmin/agent/dist/routes/access/count.js:15:9)
2024-02-20 13:56:51.199
at async AuthorizationService.assertCanBrowse (/app/node_modules/@forestadmin/agent/dist/services/authorization/authorization.js:15:9)
2024-02-20 13:56:51.199
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-02-20 13:56:51.199
at AuthorizationService.assertCanOnCollection (/app/node_modules/@forestadmin/agent/dist/services/authorization/authorization.js:40:26)
2024-02-20 13:56:51.199
at Object.throw (/app/node_modules/koa/lib/context.js:97:11)
2024-02-20 13:56:51.199
ForbiddenError: Forbidden
2024-02-20 13:56:51.199

2024-02-20 13:56:51.199
Forbidden

Context

  • Project name: Seaya
  • Team name: Seaya
  • Environment name: TEST
  • Agent (forest package) name & version: [Widget Name & Version]:
    “@forestadmin/agent”: “^1.36.11”,
    “@forestadmin/datasource-sequelize”: “^1.5.26”,
    “@forestadmin/datasource-sql”: “^1.7.43”,
    “@forestadmin/datasource-toolkit”: “^1.29.1”,
    “forest-express-sequelize”: “^9.3.9”,
  • Database type: PostgreSQL
  • Recent changes made on your end if any: Changing the Editor role to disable creation

Hello @Tamerlan_Musayev,

Let’s try to understand what’s going on.

First of all, you shared failure logs about the count route note the creation. :eyes:

I double-checked your role and indeed the Admin role must be able to Create a Booking and also Browse a Booking (looking at your screenshot example).

We need to dig a little more bit to find the culprit.

  • Did it work before that?
  • I see two datasources. Which one of the datasource are you using in your project?

  • Did you check your TEST database to ensure the data are right? Are every tables well-defined? (@forestadmin/datasource-sql introspect your DB at runtime when a server start this may cause troubles)

  • Did you try to restart your TEST server?

Thanks in advance for your answers.

Kind regards,
Morgan

Hello! Thanks for your answer.

  1. Other team members can view the tables, but errors occur when creating Pms users. I have the same admin role but I get 403 everywhere

  2. These are the logs that the forest admin returned to us. In the current situation I’m getting 403 everywhere

  3. Exactly. It used to work, but at one point it stopped working. Everything works in production

  4. It worked before

  5. Nothing has changed in the project code.

  6. Everything is fine with the TEST database, because… our site is working. And the content from the forest is loaded. The problem is only in Forest Admin

  7. Yes, we restarted TEST server 2-3 times, same problem

Hello Tamerlan,
It should be fixed, can you retry to navigate on you forestadmin :pray: ?

1 Like

Hello, Thanks, it works!

2 Likes