directus
directus copied to clipboard
Cannot create Many to One field on System collection Directus Users
Describe the Bug
When creating a Many to One field on Directus Users I get this error message
The field is generated regardless, but it is in an invalid state. It does appear in the users UI but the field just reads "The relationship is not configured correctly".
When I try to edit or delete the field, I get the same message.
Note: using Directus Cloud with a free project (https://b3339lek.directus.app/).
To Reproduce
Go to Settings > Data Model > System collections > directus_users
Then add a One to Many field. That does not work properly
Errors Shown
{
"errors": [
{
"message": "DROP TABLE \"directus_users\" - SQLITE_CONSTRAINT: FOREIGN KEY constraint failed",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}
What version of Directus are you using?
9.13.0
What version of Node.js are you using?
16.15.1
What database are you using?
SQLite (Directus Cloud with free project... that's SQLite right?)
What browser are you using?
Chrome
How are you deploying Directus?
Directus Cloud
I am unable to reproduce the issue using the given instructions, could you elaborate on the specific O2M settings used? https://www.loom.com/share/fddd0a3d23f84b86b7720fdbd897bca5
Thanks for checking!
Hmm interesting. Whenever I create a One to Many on the User table it gives me this error. Creating e.g. a text field works fine. I can make you admin on my project so you can check from your end? https://b3339lek.directus.app/admin/settings/data-model/directus_users
I have the same issue.
I was able to reproduce this now using a m2o from directus_user
to another collection on a free tier cloud app.
Same error for me on a free tier cloud app brand new
{
"errors": [
{
"message": "DROP TABLE \"directus_users\" - SQLITE_CONSTRAINT: FOREIGN KEY constraint failed",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}
Adding any many to one field will create this error message. No special settings just a field name and a collection linked to it
I can't seem to reproduce this anymore on the current free Community Cloud which is on Directus 9.15.1 🤔
https://user-images.githubusercontent.com/42867097/185082062-d3b12ccd-0523-48f8-9dbd-23b0e81234a3.mp4
@alexdabast do you know what was the version when you had that error? Is it still reproducible on 9.15.1?
On the already existing instance i have i am still able to reproduce it but after creating a new one i cannot reproduce it there anymore 🤔
On the already existing instance i have i am still able to reproduce it but after creating a new one i cannot reproduce it there anymore 🤔
@br41nslug Just to confirm, the existing instance has been upgraded to 9.15.1 as well? Wondering if there's some form of version mismatch here. Or if it is in fact already upgraded to 9.15.1, maybe something is off with the upgrade 🤔
It was but i suppose it could be an artifact in the database from that previous test
Linear: ENG-220