<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Python Extension Processors In M3 release  still go into invalid state for not finding the bin folder in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Python-Extension-Processors-In-M3-release-still-go-into/m-p/389230#M246933</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looking at output provided, you appear to running your Apache NiFi on Windows.&amp;nbsp; It appears this issue was raised 2 days ago against M3 in Apache Jira here:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-13394" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-13394&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;It is currently unresolved.&amp;nbsp; You can certainly create an Apache jira account and add additional comments to this jira with your detailed findings.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 14:36:46 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-06-14T14:36:46Z</dc:date>
    <item>
      <title>Python Extension Processors In M3 release  still go into invalid state for not finding the bin folder</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Python-Extension-Processors-In-M3-release-still-go-into/m-p/389107#M246896</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Initially I thought this was fixed in M3 and felt quite the relief for not having to manually rename the scripts folder to bin and restarting nifi twice for that: once to&amp;nbsp; create the initial extension folders under the work folder, and second after renaming the scripts to bin. It turns out that it works for the very first time however upon subsequent restarts the python extension processors start going into invalid state. When I check the log I found that its still looking for the bin folder:&lt;/P&gt;&lt;PRE&gt;2024-06-12 15:58:22,105 ERROR [Initialize ExcelTableToJson] org.apache.nifi.NiFi An Unknown Error Occurred in Thread VirtualThread[#118,Initialize ExcelTableToJson]/runnable@ForkJoinPool-1-worker-2: java.lang.RuntimeException: Failed to launch Process for Python Processor [ExcelTableToJson] Version [2.0.0-SNAPSHOT]
java.lang.RuntimeException: Failed to launch Process for Python Processor [ExcelTableToJson] Version [2.0.0-SNAPSHOT]
	at org.apache.nifi.py4j.StandardPythonBridge.getProcessForNextComponent(StandardPythonBridge.java:262)
	at org.apache.nifi.py4j.StandardPythonBridge.createProcessorBridge(StandardPythonBridge.java:123)
	at org.apache.nifi.py4j.StandardPythonBridge.lambda$createProcessor$7(StandardPythonBridge.java:140)
	at org.apache.nifi.python.processor.PythonProcessorProxy.lambda$new$0(PythonProcessorProxy.java:78)
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)
Caused by: java.io.IOException: Cannot run program "F:\nifi-2.0.0-M3-test\.\work\python\extensions\ExcelTableToJson\2.0.0-SNAPSHOT\bin\python": CreateProcess error=2, The system cannot find the file specified
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at org.apache.nifi.py4j.PythonProcess.launchPythonProcess(PythonProcess.java:283)
	at org.apache.nifi.py4j.PythonProcess.start(PythonProcess.java:129)
	at org.apache.nifi.py4j.StandardPythonBridge.getProcessForNextComponent(StandardPythonBridge.java:243)
	... 4 common frames omitted
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.&amp;lt;init&amp;gt;(ProcessImpl.java:500)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 8 common frames omitted
2024-06-12 15:58:22,109 ERROR [Initialize ExcelTableToJson] org.apache.nifi.NiFi An Unknown Error Occurred in Thread VirtualThread[#116,Initialize ExcelTableToJson]/runnable@ForkJoinPool-1-worker-7: java.lang.RuntimeException: Failed to launch Process for Python Processor [ExcelTableToJson] Version [2.0.0-SNAPSHOT]
java.lang.RuntimeException: Failed to launch Process for Python Processor [ExcelTableToJson] Version [2.0.0-SNAPSHOT]
	at org.apache.nifi.py4j.StandardPythonBridge.getProcessForNextComponent(StandardPythonBridge.java:262)
	at org.apache.nifi.py4j.StandardPythonBridge.createProcessorBridge(StandardPythonBridge.java:123)
	at org.apache.nifi.py4j.StandardPythonBridge.lambda$createProcessor$7(StandardPythonBridge.java:140)
	at org.apache.nifi.python.processor.PythonProcessorProxy.lambda$new$0(PythonProcessorProxy.java:78)
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)
Caused by: java.io.IOException: Cannot run program "F:\nifi-2.0.0-M3-test\.\work\python\extensions\ExcelTableToJson\2.0.0-SNAPSHOT\bin\python": CreateProcess error=2, The system cannot find the file specified
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at org.apache.nifi.py4j.PythonProcess.launchPythonProcess(PythonProcess.java:283)
	at org.apache.nifi.py4j.PythonProcess.start(PythonProcess.java:129)
	at org.apache.nifi.py4j.StandardPythonBridge.getProcessForNextComponent(StandardPythonBridge.java:243)
	... 4 common frames omitted
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.&amp;lt;init&amp;gt;(ProcessImpl.java:500)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 8 common frames omitted&lt;/PRE&gt;&lt;P&gt;When&amp;nbsp; rename the scripts folder to bin and restart Nifi&amp;nbsp; again its start working again!&lt;/P&gt;&lt;P&gt;Also Im not sure why there is no separate python.log file anymore like in M1 &amp;amp; M2, instead everything related to python extension is getting logged into the main nifi-app.log which makes it harder to find.&lt;/P&gt;&lt;P&gt;I have already posted a comment in github under pull request &lt;A href="https://github.com/apache/nifi/pull/8510" target="_self"&gt;12514&lt;/A&gt; which seem to be related to this issue.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/57059"&gt;@pvillard&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;***UPDATE***:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I think I know why this is happening and under what circumstance. I notice that whenever this happens actually the bin folder is getting created upon downloading the dependencies. For example if you look at the log above I'm creating python processor that reads an excel table and converts into array of json records. This processor uses the following dependencies:&lt;BR /&gt;['pandas','numpy','openpyxl']&lt;BR /&gt;When they get downloaded a bin folder is getting created with the following file insde:&lt;BR /&gt;f2py.exe&lt;/P&gt;&lt;P&gt;I think this confuses Nifi and once its find the bin folder it thinks thats where venv files are therefore the processor goes into invalid state when it cant find them there.&lt;/P&gt;&lt;P&gt;That is why I think its better not to hard code the folder path to look for one or the other and depending on what if finds first (which in this case the bin folder) it will start looking there.&amp;nbsp; I think this is better if its left to be configurable depending on which evn Nifi is deployed on.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:18:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Python-Extension-Processors-In-M3-release-still-go-into/m-p/389107#M246896</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-06-12T21:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Python Extension Processors In M3 release  still go into invalid state for not finding the bin folder</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Python-Extension-Processors-In-M3-release-still-go-into/m-p/389230#M246933</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looking at output provided, you appear to running your Apache NiFi on Windows.&amp;nbsp; It appears this issue was raised 2 days ago against M3 in Apache Jira here:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-13394" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-13394&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;It is currently unresolved.&amp;nbsp; You can certainly create an Apache jira account and add additional comments to this jira with your detailed findings.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:36:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Python-Extension-Processors-In-M3-release-still-go-into/m-p/389230#M246933</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-06-14T14:36:46Z</dc:date>
    </item>
  </channel>
</rss>

