- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 09:08 AM
Hi,
Has anyone ran into this issue and know how to solve it?
When running a background script from VSCode using the ServiceNow extension I get this output in red:
Error in executing script!
The script I am running is trivial:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2022 02:13 PM
Finally found the answer after digging through the extension minified source code (that was painful).
All users I was testing with, had "Password needs reset" set to true. Which forces the execution of "Background Scripts" to redirect (with 302) to "login_cpw.do".
The execution of Background Script relies on a special type of "POST" which does not go through the regular API. So, it attempts to authenticate as a normal user.
The extension does not make this easy to identify, giving a cryptic useless message. Solution was to simply change the password or change the flag to false.
There goes part of my sanity for 2022 yay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 11:28 AM
Thanks Maik, I've tried that already, sadly it does not. I've added further info to the original question with things I've tried a bit more info about DEV1 & DEV2 instances being clones from the same MAIN instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2022 06:46 PM
In fact, you have already done more than I could have advised.
As a workaround, I recommend using Xplore (https://developer.servicenow.com/connect.do#!/share/contents/9650888_xplore_developer_toolkit). This is my favorite execution console for scripts.
I hope you can find the root cause.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2022 02:13 PM
Finally found the answer after digging through the extension minified source code (that was painful).
All users I was testing with, had "Password needs reset" set to true. Which forces the execution of "Background Scripts" to redirect (with 302) to "login_cpw.do".
The execution of Background Script relies on a special type of "POST" which does not go through the regular API. So, it attempts to authenticate as a normal user.
The extension does not make this easy to identify, giving a cryptic useless message. Solution was to simply change the password or change the flag to false.
There goes part of my sanity for 2022 yay.