parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

The SQL query text exceeded the maximum limit of 30720 characters

Open oproulx opened this issue 10 years ago • 4 comments

Here is my cloud code source code:

var query = new Parse.Query(Parse.User);
query.equalTo('pendingNotification', true);
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.equalTo('deviceType', 'ios');
pushQuery.matchesQuery('user', query);
Parse.Push.send({
            where: pushQuery,
            data: {
                        alert: "New notifications",
                        pending_alerts : true,
                        badge: "Increment",
                        sound : "default",
                        type: 0
            }
}, { useMasterKey: true },{
            success: function() {
                        console.log(" Push was successful");
            },
            error: function(error) {
                        console.error(error);
            }
});

This query:

var query = new Parse.Query(Parse.User);
query.equalTo('pendingNotification', true);

Returns over 4000 users.

I get an error on the Parse.Push.send:

MongoError: Message: {"Errors":["Encountered exception while executing function. Exception = Error: {"errors":[{"severity":"Error","location":{"start":0,"end":396440},"code":"SC3020","message":"The SQL query text exceeded the maximum limit of 30720 characters."}]}\r\nStack trace: Error: {"errors":[{"severity":"Error","location":{"start":0,"end":396440},"code":"SC3020","message":"The SQL query text exceeded the maximum limit of 30720 characters."}]}\n at queryCallback (.sys.commonUpdate.js:2284:26)\n at Anonymous function (.sys.commonUp"]}

I contacted my MongoDB provider and they asked how the SQL query is formatted (that would make it explode beyond 30,000 characters) by this combination of queries:

var query = new Parse.Query(Parse.User);
query.equalTo('pendingNotification', true);
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.equalTo('deviceType', 'ios');
pushQuery.matchesQuery('user', query);

How is the SQL query formatted by this combination and what is making it go over 30,000 characters?

I also contacted Parse support on Facebook and they confirmed this is a bug. I'm also filing it for investigation.

Environment Setup

  • Server
    • parse-server version (Be specific! Don't say 'latest'.) : 2.2.19
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Azure
  • Database
    • MongoDB version: DocumentDB with protocol support for MongoDB
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Azure

oproulx avatar Sep 21 '16 13:09 oproulx

@oproulx did you figure this out? I'm getting something somewhat similar

"Encountered exception while executing Javascript. Exception = Error: Invalid argument. Query root must be specified.\r\nStack trace: Error: Invalid argument. Query root must be specified

adambarghouthi avatar Feb 01 '17 05:02 adambarghouthi

Did you ever resolve this maximum limit error? I am running into an identical error on Azure.

jerodfritz avatar Aug 09 '17 12:08 jerodfritz

I never resolved it. I had to space out sending the notifications, but I wouldn't say it's a perfect solution.

Sent from my iPhone

On Aug 9, 2017, at 9:54 AM, Jerod Fritz [email protected] wrote:

Did you ever resolve this maximum limit error? I am running into an identical error on Azure.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

oproulx avatar Aug 09 '17 20:08 oproulx

Closing due to lack of activity, please update to latest parse-server version and open a new issue if the issue persist.

Don't forget to include your current:

  • node version
  • npm version
  • parse-server version
  • any relevant logs (VERBOSE=1 will enable verbose logging)

flovilmart avatar Sep 10 '17 21:09 flovilmart