Hi all -
I have a flow set up to turn off the 1904 date setting in Excel documents in a folder (attached). The intention behind this flow is to schedule it to run hourly so that we can run other scheduled workflows off of that folder and all files will read in successfully.
This flow works fine when run manually. You input the file path into the text input, and the python tool iterates through all files in the folder and turns off the 1904 date setting where applicable.
However, this flow will not run when scheduled. The errors I get are inconsistent; sometimes it's a Permission Error, sometimes it seems to have to do with package installation.
Find below two examples of errors after runs. The second one is clearly related to permissions, but I'm not sure why it would pop up when scheduled and not when run manually. The other one appears to be related to the
Error: Tool #1: Traceback (most recent call last):
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Program Files\Alteryx\bin\Miniconda3\envs\DesignerBaseTools_venv\Scripts\jupyter-nbconvert.EXE\__main__.py", line 7, in <module>
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\jupyter_core\application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 338, in start
self.convert_notebooks()
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 508, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 479, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\nbconvertapp.py", line 408, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 179, in from_filename
return self.from_file(f, resources=resources, **kw)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 197, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\notebook.py", line 32, in from_notebook_node
nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 139, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\exporters\exporter.py", line 316, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\preprocessors\base.py", line 47, in __call__
return self.preprocess(nb, resources)
File "c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\nbconvert\preprocessors\execute.py", line 383, in preprocess
nb.metadata['language_info'] = info_msg['content']['language_info']
KeyError: 'language_info'
Error: Tool #1: ---------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
<ipython-input-2-5d0c12328af7> in <module>
15 ayxDat = Alteryx.read('#1')
16 folder_path = ayxDat['folder_path'][0]
---> 17 turn_off_1904_date_setting(folder_path)
<ipython-input-2-5d0c12328af7> in turn_off_1904_date_setting(folder_path)
4
5 def turn_off_1904_date_setting(folder_path):
----> 6 for filename in os.listdir(folder_path):
7 if filename.endswith('.xlsx'):
8 file_path = os.path.join(folder_path, filename)
PermissionError: [WinError 5] Access is denied: '\\\\YourFilePathGoesHere\\Subfolder'
Any ideas on how to resolve this so that I can schedule this flow?
Thanks all!