Schedule event could not be created for productive app

Hello,

I tried to look for some answers on the forum but could not find a clear explanation.

I have a custom app with schedules that works fine locally. Then I packaged it and uploaded it on the instance as a custom app. Unfortunately, whenever a user tries to create a schedule (e.g., 2021-11-28T21:28:00.000Z) from the front-end (clicking a button triggers $schedule.create()), it fails with a vague error message:

{ status: 400, message: 'Schedule event could not be created' } @Santhosh

We don’t get anything more than this message in the logs and the payload (not the real one for privacy) looks good:

{ scheduleName: 'faf3-d716-4554-47c4', scheduleData: { subject: 'blahblah' schedule_utc: '2021-11-28T21:28:00.000Z' }, iparams: { __meta: { secure: [Array] }, domain: 'blahblah.freshdesk.com', api_key: 'blahblah' }, '$domain': 'blahblah.freshdesk.com', isInstall: false, account_id: 000, region: 'US' }

With the event:

createSchedule: function(args) {
    $schedule.create({
      name: args.scheduleName,
      data: args.scheduleData,
      schedule_at: args.scheduleData.schedule_utc
    }).then(function(data) {
      renderData(null, data);
    }, function(err) {
      console.log(args)
      console.log(err)
      renderData(err);
    });
  }

For version 2.2:

  "functions": {
    "fetchSchedule": {
      "timeout": 10
    },
    "createSchedule": {
      "timeout": 10
    },
    "updateSchedule": {
      "timeout": 10
    },
    "deleteSchedule": {
      "timeout": 10
    }
  }

Doe we need to setup anything for the scheduler to work? We haven’t setup any onAppInstall() since none was required during our testing locally.

Thanks!

@Raviraj I’m facing the exact same issue with your sample app marketplace-sample-apps/Freshworks-Samples/Freshdesk/tickets_creation_scheduler_app at master · freshworks/marketplace-sample-apps (github.com).

1 Like

Hi @sabatale,

When I retested the app now, it works both on local simulation testing and as a custom app in production.

I will initiate a private message thread with you to get account credentials to check the issue and troubleshoot further.

Update of the result of troubleshooting this issue:

When published as a new custom app, the scheduled event worked fine and couldn’t reproduce the issue in the originally tested account and app.

@sabatale Please add a message in this thread if it’s reproducible again.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.