community
cancel
Showing results for 
Search instead for 
Did you mean: 

Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!
SOLVED

Python tool fails with "InboundNamedPipe::ReadFile" when output is connected

Alteryx Partner

I've build a python tool with one input and one output, staying close to the "Python - Multiple InputsEngine" example in https://github.com/alteryx/python-sdk-samples. (the tool has to read in all the data before processing can start)

 

When I use the tool with no output anchor connected to a following tool, everything works fine.

But as soon as I connect another tool (e.g. browsing) I get the error:

 

"Error: Designer x64: The Designer x64 reported: InboundNamedPipe::ReadFile: Not enough bytes read. The Pipe has been closed"

 

If I connect a filter instead, I get the following error for different tools even for tools not connected to the workflow (like a text input tool):

 

"Error: Text Input (6): Internal Error: BrowseEverywhereIIFactory::Reserve() - Tool: 6 - Reserve called again after GetII has been called once"

 

Any ideas how to solve it?

 

I attached a strip down version of the tools core python script.

 

Jan

 

 

Alteryx
Alteryx

This looks like an issue with how the tool is configured, but to fully try and put this together, I need a copy of the Config.xml file for this tool.

Alteryx
Alteryx

In addition, just looking at your sample code, I do have one suggestion.  Alteryx actually will end up calling the code in your tool in update only mode, during config, where it only processes the metadata and does not actually push any records.  Does the error you are seeing occur only during 'Run' or does it show up even during just configuring the tools on the workflow?

 

If it shows up during configuring the tool in a workflow, you probably need to block calls that may try and output empty records.  To do this, all you should need to do is add the following if block to your code:

 

if self.alteryx_engine.get_init_var(self.n_tool_id, 'UpdateOnly') == 'True':

   return False

 

I would add that to the top your ii_push_record and ii_close methods, so they do not try and push any invalid records to output, during 'UpdateOnly' mode.

Alteryx Partner

Hi William, 

 

I added the "UpdateOnly" mode, but it still fails.

 

I move the code into a demo module including configuration. (see attachment)

 

Jan

Alteryx Partner

Hi William,

 

when I remove the build_record_info step from pi_init and move it directly in front of the part sending the records, all errors go away.

 

Jan

 

 
def pi_init(self, str_xml: str):
   self.output_anchor = self.output_anchor_mgr.get_output_anchor('Output')
   self.build_record_info()