Access is denied Source: Kill Process

Good morning everyone,

	I need to know some information, i have a robot installed on an external company server.
	On the served i login with a user and i start a process. During the execution we use kill activity.
	The kill activity gose in error with Access is denied message.
	The user which i use to login in the server doesn't have any administrator privileges on the server where the robot is installed, so my questions are :
	
	1. If i am not the aministrator can i do the "Kill Process" or i need some required privileges?
	2. What are the minimun required user privileg to do Kill Process activity ?
	3. Otherwise exists any different way to use "Kill Process" or something similar(not close application or shortcuts or close tab)?

Thanks for your attention
Have a nice day

	**Kill error message:**
	
		UiPath exception:		Source: Kill Process

								Message: Encountered errors while trying to kill a process

								Exception Type: System.AggregateException

								An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
								System.AggregateException: Encountered errors while trying to kill a process 
								----> System.ComponentModel.Win32Exception: Access is denied
								  at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
								  at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
								  at System.Diagnostics.Process.Kill()
								  at UiPath.Core.Activities.KillProcess.Execute(CodeActivityContext context)
								  --- End of inner ExceptionDetail stack trace ---
								  at UiPath.Core.Activities.KillProcess.Execute(CodeActivityContext context)
								  at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
								  at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
								  at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
								  
		
		**Event viewer message** :	UiPath.Service.Host 19.4.4.0
								ServiceCallbackManager: System.ServiceModel.CommunicationObjectAbortedException: The operation cannot be completed because the pipe was closed.  This may have been caused by the application on the other end of the pipe exiting.
								---> System.IO.IOException: The write operation failed, see inner exception. ---> System.ServiceModel.CommunicationObjectAbortedException: The operation cannot be completed because the pipe was closed. 
								This may have been caused by the application on the other end of the pipe exiting.
								---> System.IO.PipeException: The operation cannot be completed because the pipe was closed.  This may have been caused by the application on the other end of the pipe exiting.
								   --- End of inner exception stack trace ---
								   at System.ServiceModel.Channels.PipeConnection.FinishSyncWrite(Boolean traceExceptionsAsErrors)
								   at System.ServiceModel.Channels.PipeConnection.WriteHelper(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout, Object& holder)
								   at System.ServiceModel.Channels.PipeConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
								   at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager)
								   at System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
								   at System.ServiceModel.Channels.ConnectionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
								   at System.Net.Security.NegotiateStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
								   at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
								   --- End of inner exception stack trace ---
								   at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
								   at System.Net.Security.NegotiateStream.Write(Byte[] buffer, Int32 offset, Int32 count)
								   at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
								   --- End of inner exception stack trace ---

								Server stack trace:
								   at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
								   at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout, BufferManager bufferManager)
								   at System.ServiceModel.Channels.FramingDuplexSessionChannel.OnSendCore(Message message, TimeSpan timeout)
								   at System.ServiceModel.Channels.TransportDuplexSessionChannel.OnSend(Message message, TimeSpan timeout)
								   at System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout)
								   at System.ServiceModel.Dispatcher.DuplexChannelBinder.Send(Message message, TimeSpan timeout)
								   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
								   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
								   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

								Exception rethrown at [0]:
								   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
								   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
								   at UiPath.Models.IUiPathRemoteDuplexCallback.OnJobCompleted(JobResult result)
								   at UiPath.Service.ServiceCallbackManager.<>c__DisplayClass7_0.<UiPath.Service.Core.IRemoteCallback.OnJobStatusUpdate>b__0(IUiPathRemoteDuplexCallback callback)
								   at UiPath.Shared.EnumerableExtensions.EnumerableExtensions.ForEach[TSource](IEnumerable`1 source, Action`1 action)
								   at UiPath.Service.ServiceCallbackManager.UiPath.Service.Core.IRemoteCallback.OnJobStatusUpdate(UserIdentity user, JobStatus status, Boolean notifyServer)
								   at UiPath.Service.Impl.ExecutionManager.Job.<>c__DisplayClass34_0.<SetJobStatus>b__0(IRemoteCallback callback)

You probably have to kill process per user rather than generic kill.
Since you cannot kill process from another user and if you try to then it will error out.

Here is a link for that.

2 Likes

Here is a link to KillProcessPerUser on Go: https://go.uipath.com/component/killprocessesperuser

Just to add…
If you have administrative rights, the Kill Process activity will kill all processes on that server. So, if multiple users or robots are using Excel and one kills it, all Excel processes get killed.

If you do not have administrative rights, it will try to kill the processes but give you access is denied. I believe you can set the ContinueOnError property to True, and this error will not occur.

If you decide to go with the Kill Process Per User method, it essentially will look for the session id and filter the processes by the current session id. Therefore, it will not even look at processes located on other users.

Regards.

2 Likes

Thanks for your answer!

Thanks for your help, and for the advice !
The ContinueOnError property to True it’s work!

Regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.