Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

Unknown Error on Server with Python Tool

chrisha
11 - Bolide

Heja,

 

I feel like I'm on the final stretch to have my Python plugin work properly. It's working in the Designer as well as on the server now -- at least considering the outputs.

 

When running a workflow containing my Python tool, which has only one input, I receive the following output from the server:

 

Screenshot 2019-08-05 at 13.40.27.png

"There was an unknown error executing the application. The engine reported status Error."

 

When I check the logs on the server, everything looks fine. When running the workflow on the server through AlteryxEngineCmd.exe, the output and log are also fine without any errors.

 

Anyone any idea how this happens?

 

I checked whether I didn't close any connections but I have everything in place, I think. Since I don't have any outputs, there isn't any .close() to the outgoing connections.

class AyxPlugin:

    def __init__(self, n_tool_id: int, alteryx_engine: object, output_anchor_mgr: object):
        self.n_tool_id = n_tool_id
        self.alteryx_engine = alteryx_engine
        # ...

    def pi_init(self, str_xml: str):
        xml = Et.fromstring(str_xml)
        # ...

    def pi_add_incoming_connection(self, str_type: str, str_name: str) -> object:
        self.input_anchor = IncomingInterface(parent=self)
        return self.input_anchor

    def pi_add_outgoing_connection(self, str_name: str) -> bool:
        # No outgoing connection
        return False

    def pi_push_all_records(self, n_record_limit: int) -> bool:
        # No outgoing connection
        return False

    def pi_close(self, b_has_errors: bool):
        return

    def output_message(self, text: str, messageType = Sdk.EngineMessageType.error):
        self.alteryx_engine.output_message(self.n_tool_id, messageType, self.xmsg(text))

    @staticmethod
    def xmsg(msg_string: str) -> str:
        return msg_string

class IncomingInterface:
    def __init__(self, parent: AyxPlugin):
        # Reference to AyxPlugin
        self.ayx_plugin = parent

    def ii_init(self, record_info_in: object) -> bool:
        return True

    def ii_push_record(self, in_record: object) -> bool:
        return True

    def ii_update_progress(self, d_percent: float):
        self.ayx_plugin.alteryx_engine.output_tool_progress(self.ayx_plugin.n_tool_id, d_percent)  # Inform the Alteryx engine of the tool's progress.

    def ii_close(self):
        return    
    

 

I cannot see any other unhandled Python exceptions or anything the like. And output and log are looking perfectly fine, so I cannot see any problem.

 

Any idea what might have happened that any workflow containing the tool quits with this error message?

 

Best

Christopher

 

5 REPLIES 5
MichalM
Alteryx Alumni (Retired)

@chrisha 

 

When you run the process using AlteryxEngineCmd.exe are you logged in as the Run as configured on the server that is used when the process is executed via the Gallery?

chrisha
11 - Bolide

Hi @MichalM,

 

I've just run it as the designated Alteryx user on our server. Identical output: no errors or warnings whatsoever, log is clean and workflow did what it was supposed to do.

 

Best

Christopher

 

chrisha
11 - Bolide

We are now running Alteryx 2019.4.6 on both Designer and Server. The error still occurs and the result of the Command Line exe is identical. Does anyone have any other suggestion?

Sri9
8 - Asteroid

I too get this error while I run a python tool in gallery. But I got the results fine as expected.

 

Using python - I was printing a directory with list of filenames, fullpath, size.

 

It ran fine for a simple directory path with <10 files. (3 sub directory)

 

But when I ran for heavy directory with 840 files (4 sub directory) I got this error, though I got all the files printed.

 

Looks like some kind of file locking conflicts / timeout error i guess.

 

Some Allteryx & Python expert can comment on this.

 

 

Sri9
8 - Asteroid

Even i was getting the same error and while i was checking logs and noticed that i was inside my python code was printing some of the dataframe and it taking huge data to my logs and its failing to send those data.

 

However the results were written fine to the Alteryx and once i commented those i didn't get that error again.

 

May be if your code is also sending huge data to the logs and try commenting it and run it again.

 

Error in Gallery:

The job My_Workflow_name did not complete successfully and resulted in the following errors:

  • There was an unknown error executing the application. The engine reported status Error

Error in log:

  • 00:03:37.585 - Error - Alteryx: Error running Event #1: Failure when receiving data from the peer