directus-sync icon indicating copy to clipboard operation
directus-sync copied to clipboard

Better debugging

Open edurenye opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I'm getting an error during a schema push, and I want more information regarding the error, but when I use the debug option all I get is this:

[09:31:42.351] DEBUG (1482): [migration-client] Cache cleared
[09:31:42.363] INFO (1482): ---- Push schema ----
[09:31:43.005] ERROR (1482):
    errors: [
      {
        "message": "Cannot read properties of undefined (reading 'fields')",
        "extensions": {
          "code": "INTERNAL_SERVER_ERROR",
          "stack": "TypeError: Cannot read properties of undefined (reading 'fields')\n    at FieldsService.createField (file:///app/directus/node_modules/@directus/api/dist/services/fields.js:262:79)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async file:///app/directus/node_modules/@directus/api/dist/utils/apply-diff.js:158:21"
        }
      }
    ]
    response: {}

Describe the solution you'd like I would like it to tell me which file triggered that error so it is easier for me to debug it and find the problem.

edurenye avatar Dec 10 '24 09:12 edurenye

I was facing a similar issue. I was running some custom migrations for pgvector columns before pushing the directus-sync schema. Once I got rid of those and did them after directus-sync push, the issue went away.

In my case, I suspect that it was due to directus not recognizing pgvector columns.

spashii avatar Jan 28 '25 11:01 spashii

Your database may include one or more collections with columns that are incompatible with the Directus version you're trying to push the schema to.

Resolution:

  • Ensure that all required collections and their columns exist and are compatible with the targeted Directus version.

ussaama avatar Jan 28 '25 11:01 ussaama