I’ve gone ahead and installed the ForestAdmin backend and successfully deployed it as well as ran it locally. However when I try to access some of the pages I get a 500 error. On the backend its complaining that I’m missing one of the expected fields, this seems to always be related to a relationship. The biggest difference between now and other times I’ve used ForestAdmin is that I’m not leveraging and ORM, but rather the SQL data source. Its seems to be a missmatch between what the schema is and what the GET request is asking for. I see this issue with several different types of relationships.
Does anyone know there is some convention ForestAdmin requires your database to follow for this to work? Anything I can do setting wise or as a default rule to the data source to fix this? Changing the schema or manually adding the relationships ( like an ORM ) is not really an option.
Expected behavior
Expect it just to work.
Project name: Unified Vision
Team name: none
Environment name: Development/Staging
Agent technology: NodeJS
Agent (forest package) name & version: @forestadmin/datasource-sql@1.16.3
Database type: PostgreSQL
Recent changes made on your end if any: None! Never got this working
Your agent console logs should have details and a stack trace concerning the error that causes the 500 on the frontend side.
Can you please share those to help us investigate further ?
thanks
Hello @Rein,
Thanks for the details.
I tried reproducing your issue with a similar schema, but to no avail.
to answer your specific question
Does anyone know there is some convention ForestAdmin requires your database to follow for this to work? Anything I can do setting wise or as a default rule to the data source to fix this?
No there is not really. It should work out of the box with any standard recent postgreSQL instance
Some more details that might help us investigate:
I assume that the problematic relationships are declared in the postgre schema, and not in code your forest agent, is that correct ?
Do you have collections with relationships that are displayed correctly ?
If so do you have anything different in the collections that you cannot access, for instance in the way they are declared in the pg schema ? Or they are using pg extensions ? or use non-standard data types ?
If you make changes to your development database schema, do you see those reflected in the forestadmin-schema.json file after your agent has restarted ?
Are you able to successfully perform changes to the layout on the app ? Like hiding a column for instance ? And are those saved correctly upon page reload ?
If the above is ok, could you try hiding the columns that cause an issue, and let me know if this changes anything ?
Would you be able to provide a minimal reproducible example, in the form of a simple postgre database schema with a couple tables, one of causing the same error that you see in your dev environment.
Thanks for the details answers,
Unfortunately, this does not really pinpoint anything that could lead to the behaviour that you are experiencing. Did you manage to get a reproducible example together ?