Closed NilsBaumgartner1994 closed 2 months ago
It seems that your JSON files are not up to date with the Directus 11. Did you follow these steps ?
Yup. Delete Database Start my server on directus 10 Push schema Dop server upgrade to 11 and rebuild docker, then start let migration finish pull schema push schema --> error
Wait, maybe i forgot to reinstall directus sync from 3 back to 2
No, i made sure that i used
cleared database directus sync 2 for directus 10 setup and push scheme switch to directus 11 and extension v3 and confirm in backend api install directus sync 3 and pull then directly push
So i tried with a clean database with a new table and that works. So the problem must rely somewhere in my schema?
When i create the field "role" in permissions the push works. Lets see if i can then make a pull, and push. And then if I can delete the field and make a pull and push
Okay so by creating a custom field role the push works. Lets check if we can then remove it.
Removing the field, then pulling and pushing does not work. Resulting in the same error
Disabled all extensions (2), still no change
Also deleting all tables and removing all permissions result in the same error.
Ahhhh i found a first problem.
When preserving permissions for public policies in the collection file:
"policy": "abf8a154-5b1c-4a46-ac9c-7300570f4f17",
"role": null,
is saves the role as null, for well the public role. Removing this, manually, fixed that error.
So basically when pulling with preserve ids, we have to delete the field "role" in the collection permissions
We deleted the presered ids for permissions and roles. Now trying to recreate them and to pull them
it seems there is also a problem when saving the policies for the role:
[16:07:05.374] INFO (8809): [roles] Created 0 items
[16:07:05.436] ERROR (8809):
errors: [
{
"message": "You don't have permission to access this.",
"extensions": {
"code": "FORBIDDEN"
}
}
]
response: {}
In my directus logs:
```rocket-meals-directus-4 | [16:07:05] PATCH /roles/abe3a726-f85c-4d70-a86c-15e7092e5da2 403 21ms```
It tries to update the relation of the role to the policies:
[
{
"name": "User",
"icon": "supervised_user_circle",
"description": null,
"parent": null,
"children": [],
"policies": [
"dcdd19da-d0eb-4adf-8a3b-b40c1f67e5a4",
"a780fc0d-de6d-4ebf-aaa1-5b4421e29b7d"
],
"_syncId": "abe3a726-f85c-4d70-a86c-15e7092e5da2"
}
]
and exactly here seems to be the problem, that he does not find the access_ids which are here preserved
Because our policies have different ids:
{
"collection": "devices",
....
"policy": "abe3a726-f85c-4d70-a86c-15e7092e5da2",
"role": null,
"_syncId": "dd9ccdca-0be6-435a-ba1e-9c8f3cbc9d45"
},
In the roles collection it seems that not the policy id is saved but the "directus_access" relation
Was my bad.Was my bad. I installed in package.json the correct version but then used the wrong version with npx for my script.