This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fields in Settings are duplicated #10540
Comments
I'm curious whether this is something that will only happen in CockroachDB (Thanks for the PR #10113 btw!) as this does look rather bizarre. Just curious, by "same deployment", do you mean both the "production" and local deployment are the exact same? Does it happen again when you redeploy it (not locally)? That said, it would certainly qualify for as a bug with Directus if this happens to the current DBs officially supported by Directus. |
with same deployment I mean that its running the same code. (I replaced the directus files in node modules with the ones from lerna build to have cockroach support with all migrations). The files are copied into a docker image to then be able to run directus start - and I'm using the same image both on the Staging as well as my local system. Strangely enough it does not happen locally even if I start with a new database. I'll later on try with a new database on our staging system |
Oh that makes sense. Perhaps it might be related to this after all. Currently the system fields are located over here in form of yaml files: https://github.com/directus/directus/tree/main/api/src/database/system-data/fields And then later on read & grabbed by the API into directus/api/src/database/system-data/fields/index.ts Lines 14 to 37 in 741e628
which then gets pushed to the array of fields in the fields API request: directus/api/src/services/fields.ts Line 75 in 741e628
Maybe one way to check would be to verify whether the YAML files are somehow "built wrongly" (also not super sure how this is even possible) which may explain why it ended up adding the system fields weirdly. |
mhmm :/ just trying to figure out more there. thanks for links how how this is being created - will add a few log messages in there to see what is happening on that system. The sort has always the same number -> so the yaml files themself are ok. Even weirder is that not all fields are duplicated... |
just realised that it is not limited to settings and that all of them are repeated 18 times^^
with other 195 fields only being returned only once (as they should) |
HA! it does return the relation for several entries in schema - so they actually are not identical results! {
"data": [
{
"collection": "directus_settings",
"field": "project_logo",
"type": "uuid",
"schema": {
"...": "...",
"foreign_key_schema": "public",
"foreign_key_table": "directus_presets",
"foreign_key_column": "id"
},
"meta": "..."
},
{
"collection": "directus_settings",
"field": "project_logo",
"type": "uuid",
"schema": {
"...": "...",
"foreign_key_schema": "public",
"foreign_key_table": "directus_notifications",
"foreign_key_column": "id"
},
"meta": "..."
},
{
"collection": "directus_settings",
"field": "project_logo",
"type": "uuid",
"schema": {
"...": "...",
"foreign_key_schema": "public",
"foreign_key_table": "directus_panels",
"foreign_key_column": "id"
},
"meta": "..."
},
"..." thinking now what might have gone wrong there... for reference Locally I'm running CRDB 21.1.10 and on the Staging System it is 21.2.10 So next for me is updating and checking if the error then starts to happen locally as well |
ok, it does not make a difference - but it is showing the schema entry for every table in the database. -> just confirmed that on the staging system for me it duplicates those fields for every table in the database. (still unclear why) |
I'll move this to a discussion for now, as CockroachDB is technically not officially supported yet. We can move it back in here if it turns out to be a bug in Directus itself that affects the supported database vendors 👍🏻 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Preflight Checklist
Describe the Bug
When opening the settings the fields after the first in "Branding & Style" and "Files & Storage" are multiplied
Info Api returns:
To Reproduce
unclear - same deployment does not produce this result locally.
in the fields api request there are multiple entries for the duplicated fields. Why would it create new ones there?
Errors Shown
there are no errors shown / and no errors in the chrome console
What version of Directus are you using?
9.2.2
What version of Node.js are you using?
16.13.1
What database are you using?
CockroachDB
What browser are you using?
Chrome
What operating system are you using?
OSX Monterey
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: