Invoke Python - pipe is broken

I have searched the forum and have not seen an answer that solves this for me. I have been using invoked python methods (and some existing robots are still working with this method) for a number of years. However, after the last upgrade 2021.10.4 I am getting the error below, generated from the invoke python method activity.

I have tried this on a number of different python code bases to see if it changed the outcome and the summary is:

  1. If the python code base invoked is a single function on a single file and does not import another function it works and has no parameters
  2. If the python code base invoked is a single file with the called function then invoking other functions in the same file this works even with parameters
  3. If the the called function imports a function from another python file, even if it doesn’t use it, the error appears, with or without parameters.

This does not appear to be a file size issue as my test cases are just sending json text back and forth (as I have seen commentary that this error can be caused by large files). And in scenarios 1 and 2 it works so it isn’t my python install or version or scope activity.

Am I missing something, or is this a limitation? For some of my projects I can make it work with a single file with multiple functions but I would prefer not to compromise the python project structures.

Note that the older robots that utilise python fit example 3 and are still working.

To trouble shoot this I have:

  • Reinstalled studio
  • Reinstalled the python packages
  • started a completely new project to test the scenarios above

RemoteException wrapping System.IO.IOException: Pipe is broken.
at System.IO.Pipes.PipeStream.CheckWriteOperations()
at System.IO.Pipes.PipeStream.Flush()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.set_AutoFlush(Boolean value)
at UiPath.Python.Service.PythonProxy.RequestAsync(PythonRequest request, CancellationToken ct)
at UiPath.Python.Service.PythonProxy.Shutdown()
at UiPath.Python.Impl.OutOfProcessEngine.Release()
at UiPath.Python.Activities.PythonScope.Cleanup()
at UiPath.Python.Activities.PythonScope.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

1 Like

Hey @timrj

This looks like python error.

Found this python - IOError: [Errno 32] Broken pipe when piping: `prog.py | othercmd` - Stack Overflow

May be give it a try.

Thanks
#nK

Thanks, i had a look and I don’t think it’s a python problem. The scripts that are invoked work fine when run in isolation. It is only when they are invoked by UIPath that the error occurs. I have also got one working by just bringing every code module into the single file but that is not ideal.

I have seen others with the same problem but none seem to have found a solution.

1 Like

我也是,找了好多都不行

1 Like

Same issue here, the python code runs perfectly by PyCharm. but cannot invoke inside UiPath.

I even triggered the same python code base from a web app and it all worked with same params and returned data.

1、Change the Python Version 3.6
2、Change the uipath.python.activities 1.3

Try it~

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