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

Receiving erro r'Request size is too large' when querying Cosmos DB. #116

Open
fr3dgu1s opened this issue Jul 25, 2018 · 1 comment
Open

Comments

@fr3dgu1s
Copy link

While running a query against my database and getting a 'Request size is too large' while iterating through the results:

The query is 'select c.id, c.snippet.channelId from c where (c.kind = 'youtube#channel' or c.kind = 'youtube#video') and c.statistics.commentCount > 0'

Stack Trace:

java.util.concurrent.ExecutionException: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: {'Errors':['Request size is too large']}
ActivityId: 00000000-0000-0000-0000-000000000000, Request URI: //, StatusCode: RequestEntityTooLarge, SubStatusCode:
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.affinio.work.Worker$class.waitUntilDone(Worker.scala:51)
at com.affinio.scanner.CommentScan$.waitUntilDone(CommentScan.scala:11)
at com.affinio.work.Worker$class.cleanUp(Worker.scala:87)
at com.affinio.scanner.CommentScan$.com$affinio$reader$Reader$$super$cleanUp(CommentScan.scala:11)
at com.affinio.reader.Reader$class.cleanUp(Reader.scala:147)
at com.affinio.scanner.CommentScan$.cleanUp(CommentScan.scala:11)
at com.affinio.work.Worker$class.main(Worker.scala:105)
at com.affinio.scanner.CommentScan$.main(CommentScan.scala:11)
at com.affinio.scanner.CommentScan.main(CommentScan.scala)
Caused by: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: {'Errors':['Request size is too large']}

Once the item is already on the database the error should not be related to document size.

@srinathnarayanan
Copy link
Contributor

Hi @fr3dgu1s, this issue is because the continuation token size sent in the header is too large. You can limit this by setting the 'responseContinuationTokenLimitInKb' in your feedOptions. (i.e. feedOptions.setResponseContinuationTokenLimitInKb() ). The maximum header size is 16 Kb, so your choice for responseContinuationTokenLimitInKb should be within that.

Documentation link : https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.documentdb._feed_options.setresponsecontinuationtokenlimitinkb?view=azure-java-stable#com_microsoft_azure_documentdb__feed_options_setResponseContinuationTokenLimitInKb_int_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants