Comments (4)
Judging from the error the field was not created properly, can you consistently reproduce this when removing and recreating the field that errored activitiesimage
?
from directus.
Yes, I tried multiple times with no luck. I now restarted my server and now directus cannot find any image (they are connected with Azure Blob Storage.
I has this error for every image:
2024-05-23T12:38:45.053136472Z: [INFO] [12:38:44.707] ERROR: select top (@p0) [directus_files].[id], [directus_files].[storage], [directus_files].[filename_disk], [directus_files].[filename_download], [directus_files].[title], [directus_files].[type], [directus_files].[folder], [directus_files].[uploaded_by], [directus_files].[uploaded_on], [directus_files].[modified_by], [directus_files].[modified_on], [directus_files].[charset], [directus_files].[filesize], [directus_files].[width], [directus_files].[height], [directus_files].[duration], [directus_files].[embed], [directus_files].[description], [directus_files].[location], [directus_files].[tags], [directus_files].[metadata], [directus_files].[focal_point_x], [directus_files].[focal_point_y], [directus_files].[CinemaPage] from [directus_files] where [directus_files].[id] = @p1 order by [directus_files].[id] asc - Invalid column name 'CinemaPage'.
2024-05-23T12:38:45.053141472Z: [INFO] err: {
2024-05-23T12:38:45.053144772Z: [INFO] "type": "RequestError",
2024-05-23T12:38:45.053148172Z: [INFO] "message": "select top (@p0) [directus_files].[id], [directus_files].[storage], [directus_files].[filename_disk], [directus_files].[filename_download], [directus_files].[title], [directus_files].[type], [directus_files].[folder], [directus_files].[uploaded_by], [directus_files].[uploaded_on], [directus_files].[modified_by], [directus_files].[modified_on], [directus_files].[charset], [directus_files].[filesize], [directus_files].[width], [directus_files].[height], [directus_files].[duration], [directus_files].[embed], [directus_files].[description], [directus_files].[location], [directus_files].[tags], [directus_files].[metadata], [directus_files].[focal_point_x], [directus_files].[focal_point_y], [directus_files].[CinemaPage] from [directus_files] where [directus_files].[id] = @p1 order by [directus_files].[id] asc - Invalid column name 'CinemaPage'.",
2024-05-23T12:38:45.053152972Z: [INFO] "stack":
2024-05-23T12:38:45.053156672Z: [INFO] Error: select top (@p0) [directus_files].[id], [directus_files].[storage], [directus_files].[filename_disk], [directus_files].[filename_download], [directus_files].[title], [directus_files].[type], [directus_files].[folder], [directus_files].[uploaded_by], [directus_files].[uploaded_on], [directus_files].[modified_by], [directus_files].[modified_on], [directus_files].[charset], [directus_files].[filesize], [directus_files].[width], [directus_files].[height], [directus_files].[duration], [directus_files].[embed], [directus_files].[description], [directus_files].[location], [directus_files].[tags], [directus_files].[metadata], [directus_files].[focal_point_x], [directus_files].[focal_point_y], [directus_files].[CinemaPage] from [directus_files] where [directus_files].[id] = @p1 order by [directus_files].[id] asc - Invalid column name 'CinemaPage'.
2024-05-23T12:38:45.053165573Z: [INFO] at RequestTokenHandler.onErrorMessage (/directus/node_modules/.pnpm/[email protected]/node_modules/tedious/lib/token/handler.js:287:21)
2024-05-23T12:38:45.053169373Z: [INFO] at Readable.<anonymous> (/directus/node_modules/.pnpm/[email protected]/node_modules/tedious/lib/token/token-stream-parser.js:18:33)
2024-05-23T12:38:45.053172973Z: [INFO] at Readable.emit (node:events:517:28)
2024-05-23T12:38:45.053176173Z: [INFO] at addChunk (node:internal/streams/readable:368:12)
2024-05-23T12:38:45.053179473Z: [INFO] at readableAddChunk (node:internal/streams/readable:341:9)
2024-05-23T12:38:45.053182773Z: [INFO] at Readable.push (node:internal/streams/readable:278:10)
2024-05-23T12:38:45.053186073Z: [INFO] at next (node:internal/streams/from:98:31)
2024-05-23T12:38:45.053189373Z: [INFO] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-05-23T12:38:45.053192773Z: [INFO] "code": "EREQUEST",
2024-05-23T12:38:45.053196073Z: [INFO] "number": 207,
2024-05-23T12:38:45.053217073Z: [INFO] "state": 1,
2024-05-23T12:38:45.053220573Z: [INFO] "class": 16,
2024-05-23T12:38:45.053223973Z: [INFO] "serverName": "my-directus-server-mssql",
2024-05-23T12:38:45.053227373Z: [INFO] "procName": "",
2024-05-23T12:38:45.053230773Z: [INFO] "lineNumber": 1
2024-05-23T12:38:45.053234173Z: [INFO] }
For me it looks like directus is trying to access the column CinemaPage
(the name of my singleton) on the directus_files
table, where it for sure doesn't exist [directus_files].[CinemaPage]
:
from directus.
Heya! This is an issue specific to Azure / MS SQL. In MS SQL, you can't have multiple foreign key constraints to the same collection at the same time. Directus by default tries to nullify the related foreign key on deletion of a file, but that causes this issue when you create a second m2o field (like an image) to the same collection.
You might find an error like
Error: Introducing FOREIGN KEY constraint 'singleton_activitiesimage_foreign' on table 'singleton' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
in the logs indicating the same thing. There is a workaround though! If you go to the relationship while configuring the field, and set the "On Delete of directus_files..." option to "Prevent the deletion", it'll work as expected.
We've gotten the same bug report in multiple flavors, so I'll close this in favor of making 1 pinned issue that covers this issue and the workaround 🙂
from directus.
Superseded by: #22990
from directus.
Related Issues (20)
- Item Permissions Not Working with $CURRENT_POLICIES HOT 1
- Improvements to authentication docs
- Re-ordering the columns of a Kanban layout in a bookmark should NOT save automatically.
- Add ability to download SAML IdP metadata from provider
- Enable to translate and customize registration-wrapper HOT 3
- Performance Improvement: Optimize Login Page Animation for High-Resolution Displays HOT 5
- SDK read Role Public HOT 6
- websocket seems to be broken in 11.1 HOT 1
- /files route is completely public exposing all files that are "public" HOT 1
- Migrations are mangled in Docker cluster mode HOT 1
- represent the discriminated union in m2a queries on the type level
- Variables / Field Names - How to use! HOT 2
- Donut Chart Coloring
- `select-color` broken due to broken imports
- Calling API DELETE /files/{id} returns 403 Forbidden when the file does not exist HOT 3
- Insight - Line Diagram - Step Size?
- `system-filter` does not accept `$CURRENT_POLICIES` and `$CURRENT_ROLES` as valid inputs
- Support for S3 Access via EKS Service Accounts
- Filtering items that have all specified related items (many-to-many relation) does not work HOT 1
- Insight - Metric List - Display Relation Value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directus.