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

Cloud Functions suddenly stopped working.

Open faizsameerahmed96 opened this issue 10 years ago • 3 comments

v 2.2.19

DESCRIPTION Cloud code was working fine all the time. But for a certain time it stopped working. I am using the Android SDK and was getting the i/o error. I even updated to 2.2.21 (latest as of 4 Oct) and this was still occurring. Then I again reverted to 2.2.19 and the problem suddenly disappeared the next morning. (it crashed a few times after reverting). Why did this happen?

faizsameerahmed96 avatar Oct 04 '16 17:10 faizsameerahmed96

Run with VERBOSE=1 environment variable and check the logs. There is nothing that can be guessed out.

bohemima avatar Oct 04 '16 18:10 bohemima

Same here the code below has suddenly stopped working

Parse.Cloud.beforeSave("Campaign", function(request, response) {

    var campaign = request.object;

    var end = campaign.get("end")

    if (end == null) {

        response.error("Campaign expiration required.")

    } else {

        if (campaign.existed() == false) {

            campaign.set("executed", false);
            campaign.set("countLikes", 0);
            campaign.set("countShares", 0);
            campaign.set("countCheckIns", 0);
            campaign.set("countRSVP", 0);
            campaign.set("countPeople", 0);

            var business = campaign.get("business");
            business.increment("countCampaigns");

            business.save().then(function() {

                response.success();

            });

        } else {

             response.success();

         }
    }
});

nathan-charles avatar Oct 04 '16 20:10 nathan-charles

Hey, thanks for reporting this issue.

Can you please add all the info specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

hramos avatar Oct 04 '16 21:10 hramos