Azure Cosmos DB - Transaction is not active #11333
Replies: 5 comments 2 replies
-
This issue has been marked as stale due to lack of activity. To keep this issue open, please indicate that it is still relevant in a comment below. |
Beta Was this translation helpful? Give feedback.
-
This issue was automatically closed due to lack of activity. |
Beta Was this translation helpful? Give feedback.
-
I get the same error message. I have Payload CMS (latest) deployed to an Azure App Service using Cosmos DB. I set the MongoDB version to 4.0, 5.0 and 7.0. Starting Payload with an empty database successfully results in all of the collections being created (website template) but when I try to update anything (add a link to the header global, for instance) it fails:
|
Beta Was this translation helpful? Give feedback.
-
@seankanderson encountered same issue, got any luck ? |
Beta Was this translation helpful? Give feedback.
-
We are considering adding to the docs that transactions must be disabled for Payload to work with Azure CosmosDB. This can be done by adding Cosmos does not support transactions that update two documents in different collections. This limitation means that our approach to transactions is incompatible with Cosmos DB for many of Payload's operations. I have not found any workarounds to this underlying problem that we want to support. |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
No response
Environment Info
Binaries:
Node: 20.18.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.0.0-beta.111
next: 15.0.0-canary.173
@payloadcms/db-mongodb: 3.0.0-beta.111
@payloadcms/email-nodemailer: 3.0.0-beta.111
@payloadcms/graphql: 3.0.0-beta.111
@payloadcms/live-preview: 3.0.0-beta.111
@payloadcms/live-preview-react: 3.0.0-beta.111
@payloadcms/next/utilities: 3.0.0-beta.111
@payloadcms/plugin-cloud: 3.0.0-beta.111
@payloadcms/plugin-form-builder: 3.0.0-beta.111
@payloadcms/plugin-nested-docs: 3.0.0-beta.111
@payloadcms/plugin-redirects: 3.0.0-beta.111
@payloadcms/plugin-search: 3.0.0-beta.111
@payloadcms/plugin-seo: 3.0.0-beta.111
@payloadcms/richtext-lexical: 3.0.0-beta.111
@payloadcms/translations: 3.0.0-beta.111
@payloadcms/ui/shared: 3.0.0-beta.111
react: 19.0.0-rc-3edc000d-20240926
react-dom: 19.0.0-rc-3edc000d-20240926
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 16323
Available CPU cores: 12
Describe the Bug
Loading any collection yields the error "Transaction is not active" when using Beta@111 and Azure Cosmos DB. The exact error is
[20:06:01] ERROR: There was an error while saving a version for the Page with ID 670431181cb76bc23a3fe149. [20:06:01] ERROR: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 1101; ActivityId: 22de57e1-0e09-4ca3-9e5f-3369ea8a56a5; Reason: (Message: {"Errors":["Transaction is not active"]} ActivityId: 22de57e1-0e09-4ca3-9e5f-3369ea8a56a5, Request URI: /apps/6f232f08-2a14-4cae-8c0a-c193554d0def/services/002fe847-6430-4464-8900-cb42bd1e8d45/partitions/30a695e4-8ca5-4e4e-a316-3cf88bcd7ba1/replicas/133728003008408827p/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.20348 cosmos-netstandard-sdk/3.18.0)
The error seems to relate to a 5sec transaction limit defined by CosmosDB however cannot find any way around this unless batching the transactions. I dont see how any transaction can be exceeding 5s at this stage though.
Reproduction Steps
Setup "Azure Cosmos DB for Mongo DB (RU) Serverless" plan.
Install payload via npx create-payload-app@beta
Connect up to DB
Setup admin account, try to create or view any collection
Adapters and Plugins
No response
Beta Was this translation helpful? Give feedback.
All reactions