Giter VIP home page Giter VIP logo

Comments (5)

veena-udayabhanu avatar veena-udayabhanu commented on July 24, 2024

'Unexpected Response Code for Operation: 1' basically means that the operation at index 1 (i.e. the second operation) in the batch failed. The index of the failed operation is returned in the error thrown so it makes it easier for users to go and change the specific operation in the batch that failed.

You can get more information about the request that failed and the error by catching the StorageException and checking exception.RequestInformation.HttpStatusCode, exception.RequestInformation.ExtendedErrorInformation.ErrorCode and exception.RequestInformation.ExtendedErrorInformation.ErrorMessage. These should tell you that the request input is invalid.

The same information is also available in the OperationContext's last result if you use an OperationContext to track the request and use suitable method overloads that take in the OperationContext.

We will look at changing the error message in the future so it is less confusing. Thanks for the feedback!

from azure-storage-net.

pemari-msft avatar pemari-msft commented on July 24, 2024

We've made this message more clear in our 6.0.0 release -- it now reads: "Element i in the batch returned an unexpected response code." with i being the relevant index. Thanks for the feedback!

from azure-storage-net.

tbithell avatar tbithell commented on July 24, 2024

Why does it throw an error to begin with, or really why does it kill the batch? I've got a batch operation that is filled over and over again via a loop. Each individual entity is InsertOrMerge which shouldn't care if I put 100 entities in it with the same partition and row keys. There will be occasions when a duplicate will happen due to improper data entry, but I'm OK with that as long as the batch runs. Is there a way to code around this without having to dig through my batch and remove these entities? I'm asking all this because if I wasn't batching these it'd work fine, which is a pretty big con for batching. It seems like it'd make a lot more sense to provide a batch log that we could pull vs killing a batch and throwing an exception for something that would run outside of a batch.

from azure-storage-net.

golfalot avatar golfalot commented on July 24, 2024

This delightfully unhelpful error Microsoft.Azure.Cosmos.Table.StorageException: Element 0 in the batch returned an unexpected response code can also occur if you have a disallowed character in PartionKey or RowKey

@tbithell I investigated the problem by catching StorageException and within that iterate over TableOperation.InsertOrReplace which still returned a rather useless 400 BadRequest My problem item was a forward slash in RowKey.

from azure-storage-net.

amnguye avatar amnguye commented on July 24, 2024

Table support has moved to the CosmosDB NuGet package. Please follow up there.

https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Table

from azure-storage-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.