Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Python Tool Timeouts When Running Workflow

rdoptis
11 - Bolide

Hi There,

 

Timeouts can occur when executing a workflow that uses the Python tool if any of the notebook cells contain intensive operations requiring 31+ seconds of execution time.

 

The error message shown in the Alteryx message log: 

Error: Blobby Output (9): Tool #2: [NbConvertApp] Converting notebook C:\ProgramData\Alteryx\Engine\96e4c0ab-5610-4858-80e0-3625bb421cec\20\workbook.ipynb to html
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] ERROR | Timeout waiting for execute reply (30s).
Traceback (most recent call last):
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 324, in _wait_for_reply
    msg = self.kc.shell_channel.get_msg(timeout=timeout)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\jupyter_client\blocking\channels.py", line 57, in get_msg
    raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Ryan\AppData\Local\Alteryx\bin\Miniconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Ryan\AppData\Local\Alteryx\bin\Miniconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Ryan\AppData\Local\Alteryx\bin\Miniconda3\PythonTool_Venv\Scripts\jupyter-nbconvert.EXE\__main__.py", line 9, in <module>
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
    app.start()
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 325, in start
    self.convert_notebooks()
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 493, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 464, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 393, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 174, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 192, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\html.py", line 85, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\templateexporter.py", line 280, in from_notebook_node
    nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 134, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 311, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\base.py", line 47, in __call__
    return self.preprocess(nb, resources)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 262, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\base.py", line 69, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 280, in preprocess_cell
    reply, outputs = self.run_cell(cell, cell_index)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 348, in run_cell
    exec_reply = self._wait_for_reply(msg_id, cell)
  File "c:\users\ryan\appdata\local\alteryx\bin\miniconda3\pythontool_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 337, in _wait_for_reply
    raise exception("Cell execution timed out")
TimeoutError: Cell execution timed out

Does anyone have any creative ideas on how to adjust the timeout or eliminate it? Nbconvert has parameters for these timeouts, however I'm unsure how they can be adjusted when Alteryx Designer orchestrates the process...

 

Thanks,

Ryan

14 REPLIES 14
gsjacobs
8 - Asteroid

I ran into the same issue.  Thank you for the suggestion. Also, I agree, the ability to configure this through a console or (?) would be a good idea.

Balders
11 - Bolide

Hi all, I've put an idea to have the default timeout changed as I really don't like the current workarounds:

https://community.alteryx.com/t5/Alteryx-Designer-Ideas/Please-turn-off-the-python-tool-30s-timeout-...

trettelap
8 - Asteroid

I'm having trouble finding the PythonTool_venv folder in my program files. Would this have changed in a future install? 

trettelap
8 - Asteroid

I was able to find the path wit the help of Alteryx support. See the link below. This now works as expected. 

 

C:\Program Files\Alteryx\bin\Miniconda3\envs\JupyterTool_vEnv\Lib\site-packages\nbconvert\preprocessors
pjarrard
6 - Meteoroid

Looks like the value to change is now on row 85.

 

Still, easy enough to find.  Thanks to all who did the hard work!Capture.PNG

 

Labels