Strapi Troubleshooting

  1. Why relation not included in REST API responses?
  2. PostgreSQL connection error when declaring No for SSL

Why relation not included in REST API responses?

  1. Check the content type by using Content-Type Builder, make sure the the field with Relation type is corrected set.
  2. If you are building the frontend part of your app, keep in mind that the users and permissions are not the same as the counterparts used by the Admin Panel. You can view all the users by visiting “Content Manager” -> “COLLECTION TYPES” -> “User”, the roles can be configurated via “Settings” -> “USERS & PERMISSIONS PLUGIN” -> “Roles”.
  3. Remember to assign corresponding permissions to specific roles, also set correct role for specific users.
  4. When fetching data from Strapi REST API, you will need to the populate parameter to populate specific relation fields, for example GET /api/articles?populate=*.
  5. Add the authorization header with your token in the HTTP HEADERS part:
    1
    2
    3
    {
    "Authorization" : "Bearer <TOKEN>"
    }

PostgreSQL connection error when declaring No for SSL

  1. Make sure your PostgreSQL connection information is correct, especially SSLmode is not required by the database server.
  2. Edit config.database.js, replace ssl: env.bool('DATABASE_SSL', false), with the following content:
1
2
3
ssl: {
rejectUnauthorized: env.bool('DATABASE_SSL_SELF', false),
},