Skip to content

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

Azure Cosmos DB - Transaction is not active #8588

Closed
MeridianTrustDev opened this issue Oct 7, 2024 · 5 comments
Closed

Azure Cosmos DB - Transaction is not active #8588

MeridianTrustDev opened this issue Oct 7, 2024 · 5 comments
Assignees

Comments

@MeridianTrustDev
Copy link

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

@MeridianTrustDev MeridianTrustDev added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 7, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 28, 2024
@denolfe denolfe removed the v3 label Nov 19, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Dec 13, 2024
Copy link
Contributor

This issue was automatically closed due to lack of activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2024
@denolfe denolfe reopened this Dec 21, 2024
@github-actions github-actions bot added the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 21, 2024
@seankanderson
Copy link

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:

"errmsg": "Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 1101; ActivityId: 52cef688-9cfe-42f2-9eec-9bd3414c0761; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 1101; ActivityId: 52cef688-9cfe-42f2-9eec-9bd3414c0761; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 1101; ActivityId: 52cef688-9cfe-42f2-9eec-9bd3414c0761; Reason: (Message: {\"Errors\":[\"Transaction is not active\"]}\r\nActivityId: 52cef688-9cfe-42f2-9eec-9bd3414c0761, Request URI: /apps/eb821fd6-b356-42cd-a806-8dc3afb49f7a/services/22c2dd39-9e24-4d19-9890-6b299f6997b7/partitions/07130eb5-c155-4fa0-a3aa-6506716e108e/replicas/133806093015385575p/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.20348 cosmos-netstandard-sdk/3.18.0);););"

@aman-technyx
Copy link

@seankanderson encountered same issue, got any luck ?

@DanRibbens
Copy link
Contributor

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 transactionOptions: false to the mongoDB adapter.

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.

@payloadcms payloadcms locked and limited conversation to collaborators Feb 21, 2025
@DanRibbens DanRibbens converted this issue into discussion #11333 Feb 21, 2025
@github-actions github-actions bot removed status: needs-triage Possible bug which hasn't been reproduced yet stale labels Feb 21, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants