Cannot reach data - PostgreSQL View

Hi :wave:,

I have an issue with a PostgreSQL view.

I created a view in PostgreSQL and I implemented the model in ForestAdmin.
It is working well in development environment.

But in Production, I have a “cannot reach data” screen.
No error in console, no error on the server (heroku hosted).

Do you know what could be the issue ?

Heroku Logs

2021-10-26T13:39:03.037075+00:00 heroku[router]: at=info method=GET path="/forest/view_formulas/count?fields%5Bview_formulas%5D=[...]" host=URL.herokuapp.com [...] dyno=web.1 connect=0ms service=7ms status=304 bytes=261 protocol=https

2021-10-26T13:39:03.035130+00:00 app[web.1]: Executing (default): SELECT count(*) AS "count" FROM "public"."view_formulas" AS "view_formulas";

2021-10-26T13:39:03.037968+00:00 app[web.1]: GET /forest/view_formulas/count?fields%5Bview_formulas%5D=[...] 304 - - 6.368 ms

Context

Forest Express: 8.5.1
Express Version: 4.17
Sequelize Version: 7.9.1
Database Dialect: PostgreSQL
Database Version: 13

Edit: I saw the view once in ForestAdmin (and not the “cannot reach data screen”) by playing with CORS and UBlockOrigin. I tried to reproduce it but could not achieve it. So it may not be linked.

Hey @LotusBlack :wave:,

Could you share the HTTP request & response related to the data retrieval of the PG View ? (Here or as DM if you consider it private), for both production & development?

Thanks in advance :pray:

The view was missing some ID fields, causing the “cannot reach data” screen.

I just moved the “isPrimaryKey” field of the model definition to a field where I was sure there will be data.

Thanks again @jeffladiray !

1 Like