Fix script error - 'maximum execution time exceeded'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 10:35 AM - edited 03-25-2024 05:54 AM
Hello, I am running a fix script which will update the few fields on a table.
After 180s, I got this message. I see that around 1500 records got updated and the script had to update around 2k more records but then got this message.
Below is the script:
var rec = new GlideRecord('u_tableau');
rec.addEncodedQuery("sys_domain=f5b0bd2800e34444d9a15f45c6cfg466");
rec.query();
while(rec.next()) {
rec.setWorkflow(false);
rec.setValue('short_description','Deactivating as per G12 policy');
rec.setValue('u_str1','Approved');
rec.setValue('u_str2', 'Deactivated')
rec.setValue('active','false');
rec.update();
}
I checked in Transactio quota rules, its set to 4 hours.
What could be the issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 10:46 AM
Hi @Suggy ,
could you please share the script ? and if you are running for large number of data, try running it in Proceed in background.If this also doesn't work try running it in schedule job and also if there any possibility try adding more filter in query .
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:50 AM
Hi There, thanks for replying. I cannot share the script. Its a simple script to set value to a field.
Yes, I know that I can run in background script/scheduled job, but all that I wanted to know why Fix script is failing? Where is that time restriction done?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 12:46 PM
Hi, if a fix script fails, it will usually be failing as a result of the script that is being run, this could be anything from code syntax to scoping issue; Unfortunately, if you are unable to share your script then there is no way that the community can constructively evaluate it and advise of potential issues.
Perhaps you could share the script in plain text, so that the community can review?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 05:55 AM
Hi @Tony Chatfield1 udpated my question 🙂