Cloud Discovery Virtual Machine Schedules are not getting triggered once the Cloud Discovery schedule is completed successfullyIssue Cloud Discovery VM Schedules are not getting triggered once the Cloud discovery schedule is completed successfully. When the 'run_as' user has insufficient or no proper privileges to run the discovery. When checked the system logs, we see the VM Schedule discovery are falling with below exceptions: org.mozilla.javascript.JavaScriptException: Error: You don't have permissions to use this script -CloudWizardDiscovery (sys_script_include.ed07e248c79023000a1123622b97631a.script; line 31): org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1036)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_ed07e248c79023000a1123622b97631a_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_4b4c7dd0c75423000a1123622b976351_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2576)org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300)org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:102)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_d22e7bdbc0a8016500a18e024bfc9aa3_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:372)org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2476)org.mozilla.javascript.ScriptRuntime.newObjectEx(ScriptRuntime.java:2491)org.mozilla.javascript.gen.sys_script_include_96891f3953f313007f3c48f153dc348b_script_91._c_script_0_literal1(sys_script_include.96891f3953f313007f3c48f153dc348b.script)org.mozilla.javascript.gen.sys_script_include_96891f3953f313007f3c48f153dc348b_script_91._c_script_0(sys_script_include.96891f3953f313007f3c48f153dc348b.script:2)org.mozilla.javascript.gen.sys_script_include_96891f3953f313007f3c48f153dc348b_script_91.call(sys_script_include.96891f3953f313007f3c48f153dc348b.script)org.mozilla.javascript.gen.sys_script_include_96891f3953f313007f3c48f153dc348b_script_91.exec(sys_script_include.96891f3953f313007f3c48f153dc348b.script)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.system.ASystemInclude.includeScript(ASystemInclude.java:198)com.glide.script.system.ASystemInclude.include(ASystemInclude.java:135)com.glide.script.AGlideRhinoScopeHandler.isScriptInclude(AGlideRhinoScopeHandler.java:46)com.glide.script.GlideRhinoScopeHandler.found(GlideRhinoScopeHandler.java:27)com.glide.script.RhinoScope.has(RhinoScope.java:69)org.mozilla.javascript.ScriptableObject.getBase(ScriptableObject.java:2667)org.mozilla.javascript.ScriptableObject.hasProperty(ScriptableObject.java:2419)org.mozilla.javascript.ScriptRuntime.initScript(ScriptRuntime.java:3532)org.mozilla.javascript.gen.sys_script_include_fb9b7ed40b275300f198812f15673a20_script_90._c_script_0(sys_script_include.fb9b7ed40b275300f198812f15673a20.script)org.mozilla.javascript.gen.sys_script_include_fb9b7ed40b275300f198812f15673a20_script_90.call(sys_script_include.fb9b7ed40b275300f198812f15673a20.script)org.mozilla.javascript.gen.sys_script_include_fb9b7ed40b275300f198812f15673a20_script_90.exec(sys_script_include.fb9b7ed40b275300f198812f15673a20.script)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.system.ASystemInclude.includeScript(ASystemInclude.java:198)com.glide.script.system.ASystemInclude.include(ASystemInclude.java:135)com.glide.script.AGlideRhinoScopeHandler.isScriptInclude(AGlideRhinoScopeHandler.java:46)com.glide.script.GlideRhinoScopeHandler.found(GlideRhinoScopeHandler.java:27)com.glide.script.ARhinoScope.get(ARhinoScope.java:82)com.glide.script.RhinoScope.get(RhinoScope.java:52)org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2318)org.mozilla.javascript.ScriptRuntime.topScopeName(ScriptRuntime.java:1871)org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1766)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1591)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_094122a46773130022646c706785ef13_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$exec$1(InterpretedFunction.java:168)com.glide.caller.gen.sys_script_094122a46773130022646c706785ef13_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:167)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:82)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:321)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:225)com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:212)com.glide.script.BusinessRule.runScript(BusinessRule.java:422)com.glide.script.BusinessRule.runSyncBusinessRule(BusinessRule.java:305)com.glide.script.BusinessRule.runBusinessRule(BusinessRule.java:213)com.glide.script.BusinessRule.run(BusinessRule.java:189)com.glide.script.GlideRecordBusinessRules.run(GlideRecordBusinessRules.java:101)com.glide.script.GlideRecord.runScripts(GlideRecord.java:1383)com.glide.script.GlideRecord.runScriptsAndEngines(GlideRecord.java:1317)com.glide.script.GlideRecord.postChange(GlideRecord.java:5078)com.glide.script.GlideRecord.postInsert(GlideRecord.java:5042)com.glide.script.GlideRecord.insert(GlideRecord.java:4973)com.glide.script.GlideRecord.insert(GlideRecord.java:4868)com.glide.script.GlideRecord.jsFunction_insert(GlideRecord.java:5414)sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)java.lang.reflect.Method.invoke(Method.java:498)org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)org.mozilla.javascript.FunctionObject.call(FunctionObject.java:614)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2609)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_0923b5ee0ab30150007c408f74342949_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_0923b5ee0ab30150007c408f74342949_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_0923b5ee0ab30150007c408f74342949_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2576)org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300)org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:102)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_092266f60ab30150007b0466d082578c_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)org.mozilla.javascript.gen.sys_script_include_a6cdaf5bc0a802550004f460b6c04967_script_61._c_anonymous_3(sys_script_include.a6cdaf5bc0a802550004f460b6c04967.script:38)org.mozilla.javascript.gen.sys_script_include_a6cdaf5bc0a802550004f460b6c04967_script_61.call(sys_script_include.a6cdaf5bc0a802550004f460b6c04967.script)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen._refname_.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3459)org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:164)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:82)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:73)com.glide.script.Evaluator.evaluateString(Evaluator.java:103)com.snc.automation.ScriptJob.executeInSingleDomain(ScriptJob.java:57)com.snc.automation.ScriptJob.execute(ScriptJob.java:41)com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:115)com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:118)com.glide.schedule.JobExecutor.execute(JobExecutor.java:102)com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:300)com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:188)com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:188)com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:102)com.glide.ui.ServletErrorListener <user who has created the schedules> and WARNING *** WARNING *** Evaluator: java.lang.ClassCastException: org.mozilla.javascript.Undefined cannot be cast to java.util.ListCaused by error in sys_script_include.a6cdaf5bc0a802550004f460b6c04967.script at line 38com.snc.discovery.js.DiscoveryRangesDB.jsStaticFunction_getByScheduleID(DiscoveryRangesDB.java:103)sun.reflect.GeneratedMethodAccessor4431.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)java.lang.reflect.Method.invoke(Method.java:498)org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)org.mozilla.javascript.FunctionObject.call(FunctionObject.java:547)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2609)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_092329440ab30150009e4c93176ef3d0_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2576)org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300)org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:102)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen.sys_script_include_092266f60ab30150007b0466d082578c_script.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)org.mozilla.javascript.gen.sys_script_include_a6cdaf5bc0a802550004f460b6c04967_script_41._c_anonymous_3(sys_script_include.a6cdaf5bc0a802550004f460b6c04967.script:38)org.mozilla.javascript.gen.sys_script_include_a6cdaf5bc0a802550004f460b6c04967_script_41.call(sys_script_include.a6cdaf5bc0a802550004f460b6c04967.script)org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2678)org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2617)org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1501)org.mozilla.javascript.Interpreter.interpret(Interpreter.java:829)org.mozilla.javascript.InterpretedFunction.lambda$call$0(InterpretedFunction.java:152)com.glide.caller.gen._refname_.call(Unknown Source)com.glide.script.ScriptCaller.call(ScriptCaller.java:18)org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:151)org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3459)org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:164)com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:279)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:118)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:82)com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:73)com.glide.script.Evaluator.evaluateString(Evaluator.java:103)com.snc.automation.ScriptJob.executeInSingleDomain(ScriptJob.java:57)com.snc.automation.ScriptJob.execute(ScriptJob.java:41)com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:115)com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:118)com.glide.schedule.JobExecutor.execute(JobExecutor.java:102)com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:300)com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:188)com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:188)com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:102) CauseWhen the 'run_as' user has insufficient or lost privileges to script includes used by discovery during the discovery process. ResolutionProviding proper permission to the 'run_as' user to access the required script includes or change the 'run_as' to users that have proper permissions to access the script includes.