-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Payload V2 update and delete operations not working with Azure Cosmos DB for MongoDB #4273
Comments
Can confirm we're hitting the same issue. |
Can anyone experiencing this confirm that it hasn't been fixed since v2.2.2? We had closed out some other transaction related issues specificaly in 2.2.0 and 2.2.2. Please let me know before I start looking deeper into this. |
@DanRibbens in our environment with v2.3.1 and db-mongodb v1.1.0 this same issue persists. |
I spent some time here just trying to get a reproducable test environment. Ran into some problems using the azure cosmos db emulator. I'll revisit this when I can set up a hosted azure cosmos db to work against. |
Sorry for the delay. You might consider using the new |
@DanRibbens From what I see, it looks like |
Ah you're right! That will be released tomorrow. |
Is there any update on this? I added |
That is unrelated to anything with transactions. Have you enabled |
@DanRibbens Yes I've enabled it. The behaviour still seems flaky, it works sometimes and then it doesn't, while indexSortableFields has been enabled. I have a lot of collections with relationships. I'll report back if the issues come back again. |
Possibly related to #4350. |
I've tried various configurations with Azure + Payload in version 2 but have faced quite many reliability challenges. I -really- want to use this product, pay+recommend for it in suitable projects, and dare I say even contribute to the codebase, however, the reduced Azure compatibility in the latest version(s) has been a setback, leading me to reconsider its use with Azure environments for the time being. I am, however, looking forward to testing the PostgreSQL package once its out of beta. To provide some context, here are the issues I've encountered:
At present, the only configuration I've found viable is using Payload + MongoDB Atlas serverless over the public internet, which is less than ideal for secure, hybrid environments. My observation is that these issues with Payload + Azure were not present in v1.8.3, suggesting the problems have been introduced in newer versions. The same infrastructure and configuration worked perfectly with earlier versions. If there is any extra information that could help you to investigate these issues with azure, I'm happy to help. |
Sorry for the delay @jkauppinen, last time I pulled up this issue I couldn't create an Azure cosmos DB because something was down in Azure. I have created a serverless instance to test against. For a quick workaround, I recommend disabling transactions since it appears we haven't tested this feature enough to work on all mongo compliant databases. To do this set I opened a PR for the versions fields indexSortableFields bug: Regarding item 4.
Did you conclude anything on this? |
I am having trouble debugging on azure because I keep getting this:
How are RUs measured? This seems completely wild to me. I'm fetching a list view with ~5 seeded documets and getting this. UPDATE: It seems that I can make update and delete operations successfully. Including when I try it on collections with drafts. |
I ran into one issue in that if a colleciton is already made, you cannot add a I honestly don't think there is anything else to fix. If there are transactions issues, we have some ongoing other issue threads related to those and I don't know that they're Azure DB specific. I'm going to close this issue because I suspect you ran into similar issues with the RU limits and changing them after the fact can mean that your indexes aren't being made and it is wreaking havoc on your setup. There are a number of issues with Cosmos that I fully agree are bad DX, but I don't know that there is anything Payload can do to make it better. |
Link to reproduction
No response
Describe the Bug
We have encountered that with latest version of Payload there seem to be problems with Azure Cosmos DB for MongoDB with at least delete and update operations on collections. In our local development environment, we have been able to run payload v2 with latest image of mongo, so it seems the problems are related to azure cosmos DB and the way payload operates the database. We had no issues with Payload v1.8.3, so there seem to be regressions and/or changes with v2+Cosmos DB.
What works
What doesn't work
What we have tried
The same "Transaction is not active" error is thrown with delete and update operations.
Collection
Global referencing collection
Config
Admin panel
Existing record in "Cars" collection
![admin-panel-record](https://private-user-images.githubusercontent.com/1892872/285832882-aeccf102-37a1-4d85-a5d3-2465a6dc38ca.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NTYzNjIsIm5iZiI6MTcyMDQ1NjA2MiwicGF0aCI6Ii8xODkyODcyLzI4NTgzMjg4Mi1hZWNjZjEwMi0zN2ExLTRkODUtYTVkMy0yNDY1YTZkYzM4Y2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDhUMTYyNzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWQwNjliZWYwNWI5N2Q4MjAwYmJmNTVjYjI5MjAzZjIyYTYzYzczZjEzYWUxOGFmOTY1YzI5MTQwZjY1NDc1NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.3-fNQtbdqFGcQryYI70gi9FweH9DtOmZzqyDwoje9GY)
Adding reference to "Cars" from global collection
![admin-panel-1](https://private-user-images.githubusercontent.com/1892872/285830869-7512ff1a-ef71-45b8-b476-d361bf16c638.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NTYzNjIsIm5iZiI6MTcyMDQ1NjA2MiwicGF0aCI6Ii8xODkyODcyLzI4NTgzMDg2OS03NTEyZmYxYS1lZjcxLTQ1YjgtYjQ3Ni1kMzYxYmYxNmM2MzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDhUMTYyNzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjE0NDA4MTJiMWZlYWUxODU0MzU1NGViYjFmN2Y4ZmE1OWJkMDE3MTEyZWEzYjRiZmZkYjQ2ZmQyNDQ2NTFlOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.bSv7X0LW0Jo29IZC_ulz4rfNYpKEjI80jnBg1Fd-Dcc)
HTTP POST from Payload admin panel from "Save" button after adding reference to existing global collection:
HTTP response from payload API:
Error from Payload CMS logs:
Azure bicep
To Reproduce
Both scenarios can be reproduced with Azure Cosmos DB for MongoDB database.
Relationship update repro
Delete repro
Payload Version
2.1.1
Adapters and Plugins
mongooseAdapter
The text was updated successfully, but these errors were encountered: