Same Azure Cosmos DB one time it runs other time shows message Size is too large
up vote
0
down vote
favorite
I am writing Azure Cosmos DB stored procedure in azure portal , I am checking the what is max size response it can give initially it gave me 4.8 MB response later on any size more that it was showing error of message size is too large . Later on after 5 min executed same procedure and same parameters it was showing error of too large page size.
// SAMPLE STORED PROCEDURE
function sample(prefix)
var collection = getContext().getCollection();
// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
'SELECT r.data.truckSerialNo FROM root r',pageSize : -1,
function (err, feed, options) !feed.length)
var response = getContext().getResponse();
response.setBody('no docs found');
else
console.log(feed.length);
var response = getContext().getResponse();
var body = prefix: prefix, feed: feed ;
var str = ;
str.x1 = body ;
str.x2 = body ;
response.setBody(JSON.stringify(str));
);
if (!isAccepted) throw new Error('The query was not accepted by the server.');
and error
Failed to execute stored procedure testProcedure for collection iotcollection: "code":400,"body":""code":"BadRequest","message":"Message: \"Errors\":[\"Encountered exception while executing function. Exception = Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\r\\nStack trace: Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\n at validateSize (bulkUpsert_v_1_0.js:177:25)\\n at setValueInternal (bulkUpsert\"]\r\nActivityId: d61226ab-4d5e-4a3d-aa09-83351649ce4c, Request URI: /apps/59d3b9ef-17ca-4bbf-8a11-39d0199a8d29/services/1b26e00f-1f51-4d34-88ec-4090b8e7db00/partitions/45a313b7-2cf2-419e-9885-48bf9cfe6277/replicas/131862936473830809p/, RequestStats: \r\nRequestStartTime: 2018-11-10T06:41:26.3320532Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"","activityId":"d61226ab-4d5e-4a3d-aa09-83351649ce4c","substatus":413
add a comment |
up vote
0
down vote
favorite
I am writing Azure Cosmos DB stored procedure in azure portal , I am checking the what is max size response it can give initially it gave me 4.8 MB response later on any size more that it was showing error of message size is too large . Later on after 5 min executed same procedure and same parameters it was showing error of too large page size.
// SAMPLE STORED PROCEDURE
function sample(prefix)
var collection = getContext().getCollection();
// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
'SELECT r.data.truckSerialNo FROM root r',pageSize : -1,
function (err, feed, options) !feed.length)
var response = getContext().getResponse();
response.setBody('no docs found');
else
console.log(feed.length);
var response = getContext().getResponse();
var body = prefix: prefix, feed: feed ;
var str = ;
str.x1 = body ;
str.x2 = body ;
response.setBody(JSON.stringify(str));
);
if (!isAccepted) throw new Error('The query was not accepted by the server.');
and error
Failed to execute stored procedure testProcedure for collection iotcollection: "code":400,"body":""code":"BadRequest","message":"Message: \"Errors\":[\"Encountered exception while executing function. Exception = Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\r\\nStack trace: Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\n at validateSize (bulkUpsert_v_1_0.js:177:25)\\n at setValueInternal (bulkUpsert\"]\r\nActivityId: d61226ab-4d5e-4a3d-aa09-83351649ce4c, Request URI: /apps/59d3b9ef-17ca-4bbf-8a11-39d0199a8d29/services/1b26e00f-1f51-4d34-88ec-4090b8e7db00/partitions/45a313b7-2cf2-419e-9885-48bf9cfe6277/replicas/131862936473830809p/, RequestStats: \r\nRequestStartTime: 2018-11-10T06:41:26.3320532Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"","activityId":"d61226ab-4d5e-4a3d-aa09-83351649ce4c","substatus":413
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am writing Azure Cosmos DB stored procedure in azure portal , I am checking the what is max size response it can give initially it gave me 4.8 MB response later on any size more that it was showing error of message size is too large . Later on after 5 min executed same procedure and same parameters it was showing error of too large page size.
// SAMPLE STORED PROCEDURE
function sample(prefix)
var collection = getContext().getCollection();
// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
'SELECT r.data.truckSerialNo FROM root r',pageSize : -1,
function (err, feed, options) !feed.length)
var response = getContext().getResponse();
response.setBody('no docs found');
else
console.log(feed.length);
var response = getContext().getResponse();
var body = prefix: prefix, feed: feed ;
var str = ;
str.x1 = body ;
str.x2 = body ;
response.setBody(JSON.stringify(str));
);
if (!isAccepted) throw new Error('The query was not accepted by the server.');
and error
Failed to execute stored procedure testProcedure for collection iotcollection: "code":400,"body":""code":"BadRequest","message":"Message: \"Errors\":[\"Encountered exception while executing function. Exception = Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\r\\nStack trace: Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\n at validateSize (bulkUpsert_v_1_0.js:177:25)\\n at setValueInternal (bulkUpsert\"]\r\nActivityId: d61226ab-4d5e-4a3d-aa09-83351649ce4c, Request URI: /apps/59d3b9ef-17ca-4bbf-8a11-39d0199a8d29/services/1b26e00f-1f51-4d34-88ec-4090b8e7db00/partitions/45a313b7-2cf2-419e-9885-48bf9cfe6277/replicas/131862936473830809p/, RequestStats: \r\nRequestStartTime: 2018-11-10T06:41:26.3320532Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"","activityId":"d61226ab-4d5e-4a3d-aa09-83351649ce4c","substatus":413
I am writing Azure Cosmos DB stored procedure in azure portal , I am checking the what is max size response it can give initially it gave me 4.8 MB response later on any size more that it was showing error of message size is too large . Later on after 5 min executed same procedure and same parameters it was showing error of too large page size.
// SAMPLE STORED PROCEDURE
function sample(prefix)
var collection = getContext().getCollection();
// Query documents and take 1st item.
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
'SELECT r.data.truckSerialNo FROM root r',pageSize : -1,
function (err, feed, options) !feed.length)
var response = getContext().getResponse();
response.setBody('no docs found');
else
console.log(feed.length);
var response = getContext().getResponse();
var body = prefix: prefix, feed: feed ;
var str = ;
str.x1 = body ;
str.x2 = body ;
response.setBody(JSON.stringify(str));
);
if (!isAccepted) throw new Error('The query was not accepted by the server.');
and error
Failed to execute stored procedure testProcedure for collection iotcollection: "code":400,"body":""code":"BadRequest","message":"Message: \"Errors\":[\"Encountered exception while executing function. Exception = Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\r\\nStack trace: Error: Resulting message would be too large because of \\\"Body\\\". Return from script with current message and use continuation token to call the script again or modify your script.\\n at validateSize (bulkUpsert_v_1_0.js:177:25)\\n at setValueInternal (bulkUpsert\"]\r\nActivityId: d61226ab-4d5e-4a3d-aa09-83351649ce4c, Request URI: /apps/59d3b9ef-17ca-4bbf-8a11-39d0199a8d29/services/1b26e00f-1f51-4d34-88ec-4090b8e7db00/partitions/45a313b7-2cf2-419e-9885-48bf9cfe6277/replicas/131862936473830809p/, RequestStats: \r\nRequestStartTime: 2018-11-10T06:41:26.3320532Z, Number of regions attempted: 1\r\n, SDK: Microsoft.Azure.Documents.Common/2.1.0.0"","activityId":"d61226ab-4d5e-4a3d-aa09-83351649ce4c","substatus":413
asked 11 hours ago
Amjath Khan
355
355
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53236915%2fsame-azure-cosmos-db-one-time-it-runs-other-time-shows-message-size-is-too-large%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password