Closed Vahagn-Zaqaryan closed 1 month ago
Having the same bug
Our workaround:
-pull
from the server
push
to the serverMy team is also having this issue. Unfortunately @NilsBaumgartner1994's fix didn't work for us, so we're a bit stuck. We're using Directus 11.1.1 and directus-sync 3.1.4. Happy to provide any additional info that might be useful.
@Vahagn-Zaqaryan Thank you for your words.
I will dive into this issue.
When you say Create another folder.
, is it a standalone folder or is it a subfolder of the first one ?
Bonjour @EdouardDem,
Following up on my colleague @emhoracek's message, and to your question, in our case directus-sync
is trying to create a standalone folder that doesn't exist on the destination Directus instance. The npx directus-sync push
command ends in an error. Curiously, the folder DOES get created, though subsequent npx directus-sync push
commands result in the same error.
On the terminal, we get:
[11:44:30.325] INFO (78575): ---- Push schema ----
[11:44:32.530] INFO (78575): [snapshot] Changes applied
[11:44:32.537] INFO (78575): ---- Clean up collections ----
[11:44:32.690] INFO (78575): [settings] Deleted 0 dangling items
[11:44:32.844] INFO (78575): [folders] Deleted 0 dangling items
[11:44:32.867] INFO (78575): [translations] Deleted 0 dangling items
[11:44:32.932] INFO (78575): [flows] Deleted 0 dangling items
[11:44:32.984] INFO (78575): [operations] Deleted 0 dangling items
[11:44:33.244] INFO (78575): [roles] Deleted 0 dangling items
[11:44:33.560] INFO (78575): [policies] Deleted 0 dangling items
[11:44:35.602] INFO (78575): [permissions] Deleted 0 dangling items
[11:44:35.632] INFO (78575): [dashboards] Deleted 0 dangling items
[11:44:35.669] INFO (78575): [panels] Deleted 0 dangling items
[11:44:35.704] INFO (78575): [presets] Deleted 0 dangling items
[11:44:35.704] INFO (78575): ---- Push: iteration 1 ----
[11:44:35.971] INFO (78575): [settings] Created 1 items
[11:44:35.971] INFO (78575): [settings] Updated 0 items
[11:44:36.127] ERROR (78575):
errors: [
{
"message": "Value for field \"id\" in collection \"directus_folders\" has to be unique.",
"extensions": {
"collection": "directus_folders",
"field": "id",
"code": "RECORD_NOT_UNIQUE"
}
}
]
response: {}
The destination Directus instance logs:
2024-10-24 11:44:35 [09:44:35] GET /directus-extension-sync/table/folders/sync_id/1f646d53-adaf-4691-986e-c1f409a767ec 404 6ms
2024-10-24 11:44:35 [09:44:35] GET /directus-extension-sync/table/folders/sync_id/42002c64-89bb-45dd-af3d-64150ad755e7 404 10ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders/sync_id/5e4557b9-8b9a-4b1e-adc2-5582742d62b0 404 12ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders/sync_id/b5f9d7fd-e9bc-416d-af53-20ee5c0b129f 404 6ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders/sync_id/df21e0e7-c3ce-4944-adc2-1bb408fa5cc7 404 6ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders/sync_id/e4f3e4e8-d0b2-400d-9352-18ef74ef4240 404 7ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders/sync_id/ee7b3cbf-f444-44a2-9b35-c28c70e5a9bc 404 8ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders 200 8ms
2024-10-24 11:44:36 [09:44:36] GET /directus-extension-sync/table/folders 200 10ms
2024-10-24 11:44:36 [09:44:36] POST /folders 200 25ms
2024-10-24 11:44:36 [09:44:36] POST /directus-extension-sync/table/folders 201 8ms
2024-10-24 11:44:36 [09:44:36] POST /folders 400 17ms
Thanks for any help!
Describe the Bug
I maintain both production and testing environments, and our content writers recently organized our media files into folders. When I first attempted to sync these folders between environments, everything worked smoothly. However, after they created a few additional folders, I encountered an error:
Value for field "id" in collection "directus_folders" has to be unique.
To Reproduce
Steps to reproduce the issue:
Expected Behavior
The synchronization should complete without any issues.
Versions
Additional Context
First, I want to express my gratitude for creating and maintaining this repository. It has saved us months of work, and I'm eager to assist in making it even better! 🚀
If you need any further information, please don't hesitate to ask.