Skip to content

Impossible to run scripts due to hanging debug session (ISE Editing session) #1067

@alan-null

Description

@alan-null

Expected Behavior

No errors, I can run scripts in ISE.

Actual Behavior

image

23984 17:35:21 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exception

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   at Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline)
   at Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic)
   at Sitecore.Web.UI.Sheer.ClientPage.RunPipelines()
   at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.Management.Automation.PSInvalidOperationException
Message: You should only run a nested pipeline from within a running pipeline.
Source: System.Management.Automation
   at System.Management.Automation.Runspaces.PipelineBase.DoConcurrentCheck(Boolean syncCall, Object syncObject, Boolean isInLock)
   at System.Management.Automation.Runspaces.RunspaceBase.DoConcurrentCheckAndAddToRunningPipelines(PipelineBase pipeline, Boolean syncCall)
   at System.Management.Automation.Runspaces.PipelineBase.CoreInvoke(IEnumerable input, Boolean syncCall)
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Cognifide.PowerShell.Core.Host.ScriptSession.ExecuteCommand(Boolean stringOutput, Boolean marshallResults) in A:\Cognifide.PowerShell\Core\Host\ScriptSession.cs:line 753
   at Cognifide.PowerShell.Core.Host.ScriptSession.<>c__DisplayClass150_0.<ExecuteScriptPart>b__0() in A:\Cognifide.PowerShell\Core\Host\ScriptSession.cs:line 643
   at Cognifide.PowerShell.Core.Utility.SpeTimer.Measure[T](String message, Boolean log, Func`1 action) in A:\Cognifide.PowerShell\Core\Utility\SpeTimer.cs:line 28
   at Cognifide.PowerShell.Core.Host.ScriptSession.ExecuteScriptPart(String script, Boolean stringOutput, Boolean internalScript, Boolean marshalResults) in A:\Cognifide.PowerShell\Core\Host\ScriptSession.cs:line 635
   at Cognifide.PowerShell.Core.Host.ScriptSession.SetItemLocationContext(Item item) in A:\Cognifide.PowerShell\Core\Host\ScriptSession.cs:line 833
   at Cognifide.PowerShell.Client.Applications.PowerShellIse.JobExecuteScript(ClientPipelineArgs args, String scriptToExecute, Boolean debug) in A:\Cognifide.PowerShell\Client\Applications\PowerShellIse.cs:line 596
   at Cognifide.PowerShell.Client.Applications.PowerShellIse.JobExecute(ClientPipelineArgs args) in A:\Cognifide.PowerShell\Client\Applications\PowerShellIse.cs:line 543

Steps to Reproduce the Problem

  • Open ISE (http://domain/sitecore/shell/Applications/PowerShell/PowerShellIse?sc_bw=1)
  • paste this script
Write-Host "Start"

$empty = "EMPTY"
  • toggle breakpoint on line $empty = "EMPTY"
  • run debug (using Debug button)
  • press F5 (refresh a page)
  • try to run script (using Execute button)

Additional info

When I switch session mode to Single execution it woks fine but using ISE Editing session is impossible. You have to restart instance or wait long time.

  • Tested issue with clean install of Sitecore and the latest available version of SPE.

  • Asked questions on the Sitecore Slack Chat channel.

  • Reviewed questions and answers on the Sitecore Stack Exchange.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions