Service invocation failed by timeout

The hosted API Service is working only in Debug, when I deploy, keeps getting “Service invocation failed by timeout”

https://api.backendless.com/v1/services/InvitationService/1.0.0/Coupons?personId="3B743F80-EB86-F8B3-FF3F-051822A76E00"

AppId = 8475C161-FC49-E358-FFB5-930D4295C700

Your code looks good.
It could be possible that it just takes longer than allowed (5 seconds by default)

Please go trough the Troubleshooting Guide and analyze your code execution time

Hello Anderson

Could you please provide the code of your service you’re trying to invoke so we could figure out where the problem is.

Regards Anton

‘use strict’;

class InvitationService {

/**

  • @param {String} personId
  • @returns {Promise.<Array.<Coupon>>}
    */
    getCoupons(personId) {
var invitationQuery = new Backendless.DataQuery();
invitationQuery.properties = ['EntityId'];
invitationQuery.condition = "PersonId = '" + personId + "' AND Type = 'Coupon'";
invitationQuery.options = {
  pageSize: 20,
  offset: 0,
  sortBy: 'created asc'
};


return Backendless.Persistence.of("Invitation").find(invitationQuery)
  .then(function(response){


    var ids = [];
    for(var i = 0; i < response.data.length; i++){
      ids.push(response.data.EntityId);
    }


    //console.log(ids);




    var whereCondition = JSON.stringify(ids)
      .replace("[","(")
      .replace("]",")")
      .replace(new RegExp('"', 'g'),"'");


    var couponQuery = new Backendless.DataQuery();
    couponQuery.condition = "objectId IN " + whereCondition;
    couponQuery.options = {
      pageSize: 20,
      offset: 0,
      sortBy: 'created asc',
      relationsDepth: 1,
    };
    
    return Backendless.Persistence.of("Coupon").find(couponQuery)
      .then(function(response){
        
        return response.data;
    });


  });

}

}

Backendless.enablePromises();
Backendless.ServerCode.addService(InvitationService);

Ok Thanks. I put some console.log() in my code. But the logger never register. Any tips? I am missing any configuration?

Our developers are investigating this issue (BKNDLSS-13465 Logging in BL doesn’t work)

Thanks Vitaly