Forest Admin on Heroku with Postgres / not all the data is showing

HI,
I am new to Forest Admin, I just set up the Forest Admin App connected to a Postgres database hosted on Heroku.
When I run Forest Admin locally,

Expected behavior

Show all the data, navigate between pages.

Actual behavior

Forest Admin works as expected when I run the server locally connected to the Heroko DB. The data is correctly fetched, I can navigate to the next 50 page, I can see the total number of items per table.
However, when run on Heroku, the data is indeed fetched and I can see the first page of results. However I am not able to navigate and show the next 50 elements or see the total number of items per table. I am able to search accross all items of each table.
Heroku Logs do not show any errors.

What might be causing this error ?
Thanks a lot for your help,
Chris

Context

Server hosted on heroku, Postgres DB on Heroku

"body-parser": "1.19.0",
"chalk": "~1.1.3",
"cookie-parser": "1.4.4",
"cors": "2.8.5",
"debug": "~4.0.1",
"dotenv": "~6.1.0",
"express": "~4.16.3",
"express-jwt": "5.3.1",
"forest-express": "^7.4.0",
"forest-express-sequelize": "^6.0.0",
"morgan": "1.9.1",
"require-all": "^3.0.0",
"sequelize": "~5.15.1",
"pg": "~8.2.2"

Hi @Christopher_Bagard and welcome in our community :champagne: !

Hmm I might have an idea where that come from. In your browser console, do you have a 403 error on the /count request :thinking: ?

Hi @vince,
Thanks a lot for your reply.
Yes indeed, I do have a 403 (Forbidden) on the count request.
When I check the Forest Api message, I see “Forest cannot authenticate the user for this request.”.
This seems surprising because Forest the app has access to the data as it is showing the first page of results.

What do you have in mind ? :smiley:

1 Like

Okey this is what I though.
You are seeing this issue because of a conflict between 2 routes: the /modelName/:recordId and /modelName/count.
To fix it you just need to replace: /modelName/:recordId by /modelName/:recordId(?!count) and it should fix your issue :smile:

Awesome ! That did the trick, thanks a lot for your fast answers @vince.
Just for my understanding, how come the routes conflicted together ? I can’t see any overlap
And why only in production ?

Why they are conflicting together I’m still trying to understand as the /count is declared before the /:recordId so this should not… :thinking:

For your question why it’s only on production, it’s because you have deactivated the Access record details in your production environment :wink: