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

partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection #108

Closed
SogoGolf opened this issue Feb 1, 2019 · 4 comments
Assignees

Comments

@SogoGolf
Copy link

SogoGolf commented Feb 1, 2019

Bug Information

Received this error after trying to retrieve all collections in the database

BadRequest | The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection.
ActivityId: d6f2ee8b-0863-4fd6-b818-c6795c44bc04
Request URI: /apps/4270906a-2001-4446-8042-4bebcb78d23a/services/b46badbc-b14d-4a04-88e0-cb04d5146585/partitions/b134861e-6fa8-474a-a9a6-960ed909e0db/replicas/131934514209902361p/
RequestStats: 
RequestStartTime: 2019-02-01T10:15:55.9803291Z, Number of regions attempted: 1

Note that "Storage Capacity" on the collection is Unlimited

Partition key was set to "id/type"

Steps to Reproduce

AzureData.get (collectionsIn: "sogodb") { r in
    // collections = r.resource?.items
    print(r.resource?.items)
}

Screenshots

image

@jparismorgan
Copy link

jparismorgan commented Feb 3, 2019

I'm having the same issue with creating documents.

var document = CustomDocument()

document.testDate   = Date(timeIntervalSince1970: 1510865595)
document.testNumber = 1234
document.anchorId = "1234567890"
document.regionCode = "US"

AzureData.create (document, inCollection: "Anchors", inDatabase: "Items") { r in
   debugPrint(r.result)
   if let document = r.resource {
       let test = document
   } else if let error = r.error {
       debugPrint(error.localizedDescription)
   }
}

❌ FAILURE: ❌ badRequest ❌
BadRequest | The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection.

ActivityId: 8f4e02df-9f3b-4817-ac37-282d50f441e1

Have regionCode set as the partition key:
image

@SogoGolf
Copy link
Author

SogoGolf commented Feb 7, 2019

@NateRickard are these issues same/related? Azure/azure-sdk-for-android#75

@ftchirou
Copy link

ftchirou commented Feb 7, 2019

Yes. They are related @SogoGolf.

@NateRickard
Copy link
Member

Closing as PR #114 should have fixed this behavior

@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants