Skip to content

Create container fails claiming no partition key kind has been provided while it has #182

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

Open
DigiBanks99 opened this issue Mar 11, 2025 · 1 comment
Assignees
Labels
cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview) feature
Milestone

Comments

@DigiBanks99
Copy link

DigiBanks99 commented Mar 11, 2025

Describe the bug
I'm not sure if this is more a Cosmos API issue or an emulator issue, but if I try to call my emulator instance with a create container request, I get a message that says I did not provide a partition key kind eventhough it was provided.

This happens with direct REST API calls and using the Microsoft.EntityFrameworkCore.Cosmos v 9.02 in C#.

To Reproduce

  1. Create an http file or use any API tool to execute a REST request
  2. Send the following request:
POST http://127.0.0.1:8081/dbs/database/colls HTTP/1.1
Authorization: redacted
x-ms-date: Tue, 11 Mar 2025 08:27:10 GMT
x-ms-cosmos-sdk-supportedcapabilities: 1
x-ms-activity-id: c9683ee6-4d29-4602-8587-91f675f140d9
Cache-Control: no-cache
Content-Type: application/text+json
x-ms-version: 2020-07-15
Accept: application/json

{
  "id":"User",
  "partitionKey":{
    "paths":["/id"],
    "kind":"MultiHash",
    "version":2
  }
}
  1. Receive error: {"message":"partitionKey.kind is required in the request body"}

Expected behavior
The partition key needs to be supported or the documentation must describe the limitations of the partitionKey

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS 15.3.1 (24D70)
  • Browser: N/A
  • Version: N/A
  • SDK version: 3.46.1
  • SDK language: C#

Additional context
I've noticed that if I replace the MultiHash value with Hash it works.

@DigiBanks99 DigiBanks99 added cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview) needs-triage labels Mar 11, 2025
@DigiBanks99 DigiBanks99 changed the title Create container fails claiming not partition key kind has been provided while it has Create container fails claiming no partition key kind has been provided while it has Mar 11, 2025
@xgerman xgerman added this to the Backlog milestone Mar 19, 2025
@xgerman xgerman assigned rochaudhary and unassigned xgerman Mar 19, 2025
@rochaudhary
Copy link

Hi @DigiBanks99

Thanks for reporting this issue. This is happening because as of now, hierarchical partition keys (MultiHash kind partition key) are not supported on the V-Next emulator. However, we have a plan for adding support for hierarchical partition keys and would be releasing this out soon.

mihaitodor added a commit to redpanda-data/connect that referenced this issue Mar 26, 2025
Fixes #3189, or so I hope...

This also updates the Azure dependencies.

Annoyingly, the original CosmosDB emulator doesn't have an
ARM-based container and the new one ([`mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview`](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux))
has some gaps which break the existing tests such as: Azure/azure-cosmos-db-emulator-docker#182.

Signed-off-by: Mihai Todor <todormihai@gmail.com>
mihaitodor added a commit to redpanda-data/connect that referenced this issue Mar 26, 2025
Fixes #3189, or so I hope...

This also updates the Azure dependencies.

Annoyingly, the original CosmosDB emulator doesn't have an
ARM-based container and the new one ([`mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview`](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux))
has some gaps which break the existing tests such as: Azure/azure-cosmos-db-emulator-docker#182.

Signed-off-by: Mihai Todor <todormihai@gmail.com>
mihaitodor added a commit to redpanda-data/connect that referenced this issue Mar 26, 2025
Fixes #3189, or so I hope...

This also updates the Azure dependencies.

Annoyingly, the original CosmosDB emulator doesn't have an
ARM-based container and the new one ([`mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview`](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux))
has some gaps which break the existing tests such as: Azure/azure-cosmos-db-emulator-docker#182.

Signed-off-by: Mihai Todor <todormihai@gmail.com>
@xgerman xgerman modified the milestones: Backlog, 2025-05, 2025-04 Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview) feature
Projects
None yet
Development

No branches or pull requests

3 participants