Forbidden Error on Dashboard SQL Charts

Hey Forest,

So up until recently dashboards worked fine but recently we realized that all of our charts that are written as SQL throw the ‘Forbidden’ error. The Simple charts work normally. How do we solve this?

Thank you.

Hello @Arda_Yurdakul,

Can you give me more details so that I can try to reproduce your error on my end please?
What type of charts are you using?
Do you have scopes or segments in place?
All the written queries throw a Forbidden error? Even simple queries?

Thank you in advance,
Mia

Hi @anon23361380 ,

We use Single Value and Time Based charts. They both produce the same error if written in SQL. Simple queries we make through the Forest UI work normally. We have scopes in place for most tables generally to filter out soft deletes. We don’t use segments currently.

Thank you.

Hello again @Arda_Yurdakul,

I will try to reproduce this regression on my end, and will get back to you as soon as I have more details on this point :slight_smile:

Hello @anon23361380,

Thank you. I’m happy to give more info if needed, the issue is a big deal to us, so I appreciate it. :pray:

Hello @Arda_Yurdakul,

I’m taking the relay on this thread. We need some information to try to dig into the issue.

  • Have you some logs on your backend ?
  • Can you share the failing request information from the Network tab ? (Payload would be appreciated :slight_smile:)
  • Can you confirm that your agent is running on forest-express-sequelize 8.0.9 ?
  • Can you try to create a new SQL chart (just for testing purposes) ?

Thank in advance. Sorry for the inconvenient.

Morgan

1 Like

Hello @morganperre ,

Thank you for the response.

image

Hi again,

Thank you for your detailed response.

  1. Ok, I’m not able to reproduce on this version.
  2. Ok, clearly we missed some informations with those the logs (I will made a correction to have clear logs)
  3. This request must fail in any case but it should return an other error. The correct one is SELECT count(*) as value FROM stats;

I think we need to have some clear log to understand the problem. I will come back to you tomorrow with more information.

Thank for your patience.

Morgan

Hey @morganperre ,

Ah sorry I forgot to add the ‘as value’ as I was trying to quickly create a new one, all the other charts do have it but the problem persists unfortunately.

Looking forward to it. Thank you so much.

1 Like

One last thing, can you give me your project name ? It could be helpful to double check some information to reproduce the issue.

Thanks.

Kind regards,
Morgan

Yes of course, the project name under package.json is ‘monta-server-test’. It has since been renamed to Monta Admin Panel in the Forest UI though. I’m not sure which one you actually need :sweat_smile:

1 Like

Hello @Arda_Yurdakul,

The right one is Monta Admin Panel, I wasn’t sure either to be honest. :smiley:

After a long digging, I think we found the culprit… You have a collection named stats am I right ? This create a conflict between the express routes /forest/stats (used by your stats collection and our internal route stats used for the charts).

If you don’t use the creation of stats records, just comment the post in your stats route.

// Comment the following lines
// Create a Stats
/* router.post('/stats', permissionMiddlewareCreator.create(), (request, response, next) => {
  // Learn what this route does here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/routes/default-routes#create-a-record
  next();
}); */

We will create a ticket on our side to make a fix but it could take some time in order to have the ressources to find a solid solution.

Really sorry for this hassling issue. We will update this thread once we release the fix. Thank again for your patience.

Kind regards,
Morgan

PS: Tell me if the workaround works for you. :pray:

2 Likes

Hello @morganperre ,

Thank you so much for your help, that indeed did the trick! :100: :pray:

1 Like

Hey @Arda_Yurdakul,

Glad that solution works for you. :muscle:

Kind regards,
Morgan