Skip to content
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

Can't delete file from library #9774

Closed
3 tasks done
federicocappellotto97 opened this issue Nov 13, 2021 · 4 comments
Closed
3 tasks done

Can't delete file from library #9774

federicocappellotto97 opened this issue Nov 13, 2021 · 4 comments

Comments

@federicocappellotto97
Copy link

Preflight Checklist

Describe the Bug

If i delete an image from library i get this error:
{ "errors": [ { "message": "delete fromdirectus_fileswhereid in ('e9c5f419-f465-4548-8be9-42e5ec32e0f1') - ER_ROW_IS_REFERENCED_2: Cannot delete or update a parent row: a foreign key constraint fails (directus-saccardo.directus_settings, CONSTRAINT directus_settings_project_logo_foreign FOREIGN KEY (project_logo) REFERENCES directus_files (id))", "extensions": { "code": "INTERNAL_SERVER_ERROR" } } ] }

To Reproduce

Delete an image from library

Errors Shown

{
"errors": [
{
"message": "delete from directus_files where id in ('e9c5f419-f465-4548-8be9-42e5ec32e0f1') - ER_ROW_IS_REFERENCED_2: Cannot delete or update a parent row: a foreign key constraint fails (directus-saccardo.directus_settings, CONSTRAINT directus_settings_project_logo_foreign FOREIGN KEY (project_logo) REFERENCES directus_files (id))",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}

What version of Directus are you using?

9.0.1

What version of Node.js are you using?

14.18.1

What database are you using?

MysQL

What browser are you using?

Chrome

What operating system are you using?

macOS Monterey (12)

How are you deploying Directus?

Locally

@federicocappellotto97
Copy link
Author

Update, resolved: this file was the project logo.
I removed the logo then i deleted correctly the file.

@ruihildt
Copy link

I hit the same error for the same reason, either the logo should be deleted or a nicer error be shown.

@federicocappellotto97
Copy link
Author

Maybe it would be better to give more tips about the error instead of "Internal server error"

@azrikahar
Copy link
Contributor

This has indeed been brought up quite a few times, and technically a duplicate of #9507, so I'll proceed to close this 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants