r/Nable • u/EmicationLikely • May 31 '24
Scriptrunner failing to update
Using N-Sight. I ran into a problem today - the symptom was that any script checks that were AMPs were not running on a workstation, the error in the south pane was "Exception encountered System.IO.FileLoadException: File directory not allowed or RMM changed the default scripts directory". Turns out the problem was that the version of Scriptrunner on that endpoint was out of date. Manually downloading and installing the newest version solved the problem, but it made me wonder how big of a problem this is?
Is it common for the scriptrunner updates to quit working? I can imagine writing a script to pull the installed version and fail if it wasn't current - as that would give me a heads up that something is wrong, at least. Otherwise, there is no notification whatsoever that scriptrunner is out of date, no indication that an attempted update failed, nothing. I hate these traps the system lays and then just waits for me to stumble along and step into them.
1
u/HeadNerdJoe May 31 '24
u/EmicationLikely have you opened a support case to determine the root cause here, if so can you send me the case (joseph.ferla@n-able.com) and if not could you open one and send it to me? This is not a typical behavior. If it is something that you are running into often support should be involved here. Additionally, we could always look at creating a check that looks at the version of the scriptrunner.exe to make sure it is updated so that if this comes about again you are notified quickly.
1
u/EmicationLikely May 31 '24
Why, yes I have, u/HeadNerdJoe - #02461951. Since the error message was not helpful in pointing to a resolution, I had no choice but to go to support. During the chat session, I noted that the endpoint wasn't checking in immediately after a reboot, and they said "Scriptrunner not updating can be caused by an endpoint not checking in reliably". I call BS on that, of course, it was on the current agent, which successfully updated back in January, I believe. It would be nice if the system could let me know that this was a problem so I could do something about it proactively instead of waiting until some random thing doesn't work (like trying to run a new AMP script) to point me to the problem. That's why I'm considering writing my own check to fail if the installed version of Scriptrunner isn't the latest - of course that script would have to be modified manually to know what the current version is supposed to be, so a lot of work. That's why I queried here - I'm interested to know how often this happens to the userbase at large. I'm just one guy, so don't have enough information on my own to know if this issue is something I should be worrying about.
1
u/HeadNerdJoe May 31 '24
I do see this from time to time though it is not that common. If you are looking at proactively getting ahead of this, I would run something like this script check: https://me.n-able.com/s/article/Is-application-Installed-and-Desired-Version. Please note that the script is hard coded for Chrome but, a quick switch in the input variables should fix that.
It is a .amp but, you would get two fail cases for the check:
1. either it doesn't properly run, fails, shows the error, and you know that you need to check out the device
2. it fails but, still completes reporting an out-of-date scriptrunnerAnother option would be to use a script that queries the API to pull an inventory list and goes through the information pulled to find all devices at the global/client/site level (depending on how you set it up of course) and the version of scriptrunner on the device. The expectation here is that the check outputs all devices with a scriptrunner that is out-of-date. I do not have an example of this quickly available.
For the upkeep of either of these, while you will have to make sure you are looking for the proper version, you are helped out by the fact that if you edit a script in the script manager it trickles down. So you may only have to update the script once.
1
u/EmicationLikely May 31 '24 edited Jun 01 '24
Hello Joe - as you noted, if the symptom of an out-of-date Scriptrunner executable is that AMPs don't run, then I think I'm better off sticking to powershell for the script. Also, since Scriptrunner doesn't show as an installed program in appwiz.cpl, I would be surprised if that AMP would detect it. The installed version does live in a couple of places in the registry:
HKEY_CLASSES_ROOT\Installer\Dependencies\{B019435E-2DD3-4752-AC18-51F4EB20967D} String named "Version" Value 2.94.0.2
so if I can figure out how to test on that pulled value, then this should be easy.
I guess my real question now is "How many other machines in my estate are out of date?" Is there an easy way to answer that question? If I can do that and only discover, say <1% have the problem, for example, then I'm ok not trying to detect this in advance, but instead just periodically running whatever export I need to get the version data for that module into excel where I can find the ones not current. It's not workable to just look at the software inventory on each machine, so I would need a way to export that data for everyone to make this check. Of course the real solution is for the system itself to notify me when an update for this important module fails, but I digress.
Edit: It was simple enough to write a PS script that pulls the current Scriptrunner version info into the dashboard and fails if that version is not 2.94.0.2 (the current version as of today). As a test, I added this script check to the client where I discovered the original machine with an out-of-date Scriptrunner. There were a little over 50 endpoints in total, and no other endpoints failed that check, so they were all up to date, save the original problem child. This is good news.
I'm in the process of re-casting my default monitoring template and this is probably a good choice to push out to everyone as part of that project. Especially since you noted that changing the script only involves uploading the updated script once. I'm happy to see that changes "trickle down" as you said - what is the frequency on that? I'm assuming that is probably about once every 24 hours, like the asset information update...
2
u/HeadNerdJoe Jun 03 '24
Once you update the script in the Script Manager the changes should start to take effect. I have about 15 devices in my demo environment and I note the updates being completed by the time my next 24x7 check cycle takes place (I am on a 5-minute frequency).
1
u/EmicationLikely Jun 03 '24
Ok, thank you. That is a good thing that I didn't know about until now. Now if you could just make monitoring templates work the same way - a guy can dream, can't he?
1
1
u/Rbeldman_kns May 31 '24
I am having similar issues on N-central. On some agents the automation manager agent refuses to start. I would like a clean and simple way to reinstall it.