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

CreateContainerIfNotExistsAsync throws ArgumentException incorrectly stating the PKs don't match #623

Closed
wilcobmsft opened this issue Aug 2, 2019 · 5 comments · Fixed by #629
Assignees
Labels
bug Something isn't working needs-investigation

Comments

@wilcobmsft
Copy link
Member

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
After upgrading to latest SDK, CreateContainerIfNotExistsAsync throws an ArgumentException stating PK "/x" in Container "foo" does not match PK "/x". The actual paths in the error message are identical though.

Environment summary
SDK Version: 3.1.0
OS Version (e.g. Windows, Linux, MacOSX) Windows

@wilcobmsft
Copy link
Member Author

Oddly enough I don't see this for every container of mine. Looking at fiddler, it appears the container for which I get this exception, the partition key is explicitly marked as "systemKey": false.

@j82w
Copy link
Contributor

j82w commented Aug 2, 2019

This is likely a bug with PR 572. This feature was added because users were doing create if not exist, but giving a different container pk. Later they would try to do an insert, and it would fail. This causes it to fail fast with a specific error message.

@j82w j82w added bug Something isn't working needs-investigation labels Aug 2, 2019
@simplynaveen20 simplynaveen20 self-assigned this Aug 2, 2019
@simplynaveen20
Copy link
Member

@wilcobmsft Do we know how those container got created initially which is having "systemKey": false. Means which SDK version

@adstep
Copy link

adstep commented Aug 8, 2019

I'm still seeing this issue using Microsoft.Azure.Cosmos 3.1.0. #659

@j82w
Copy link
Contributor

j82w commented Aug 9, 2019

If you look at the changelog PR 629 is under the Unreleased tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-investigation
Projects
None yet
4 participants