Creating sale via CRMScript and Scheduled Task will timeout
Hi,
we've got an issue with a customer in Online, and I'm trying to figure out what's going on. We've narrowed the problem down to this script;
#setLanguageLevel 3;
NSSaleAgent agent;
NSSaleEntity sale = agent.CreateDefaultSaleEntity();
sale.SetHeading("Dummysale ignore");
sale = agent.SaveSaleEntity(sale);
If we run that script manually via "Execute script" button it completes in less than a second.
But, if we run the exact same script as a Scheduled Task it'll timeout after a couple of minutes. However, it seems like the sale is created, but blocks further execution.
If I try to reproduce the problem in SOD or another Online database, it works as expected. So the issues only happens for a specific customer tenant, and when executed as scheduled task.
Any ideas?
All Replies (3)
Run as Scheduled Task means that the script is ran as ejSysUser, so maybe something weird is configured as a default on the associate? (was this customer migrated to Online from OnSite?)
Maybe this customer runs on the seperate API cluster? Have seen issues registered related to CRMScript before with that being (part of) the issue.
Try asking appdev@ for some insight? Margrethe can see a lot of useful debugging info in Application Insights.
Yes, I agree, when executed as a scheduled task or via customer.fcgi?action=safeParse, the script is executed as ejSysUser. And yes, the script is executed on a separate API cluster. With the help of Margrethes Application Insights I've seen it run against /ApiCluster.
And yes, this is a database which has been migrated from on-prem to online, and the issue started some time in august. It worked prior to that. I'm not sure when SuperOffice made their changes with the backend API cluster.
If you look in the userpreferences table for anything set on the associate id of the EjSysUser, anything weird/strange that?