What causes Unhandled exception in wfastcgi.py: Traceback (most recent call last) in python flask app +IIS...
I' m creating a web app with Python flask and IIS 10 web service on windows server 2022. I have problem in the wfastcgi
log file that is configured in web.config
. The content of the log:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\wfastcgi.py", line 774, in main
record = read_fastcgi_record(fcgi_stream)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\wfastcgi.py", line 158, in read_fastcgi_record
data = stream.read(8) # read record
OSError: [Errno 22] Invalid argument
2023-05-27 13:56:42.139969: Running on_exit tasks
2023-05-27 13:56:42.141971: wfastcgi.py 3.0.0 closed
2023-05-27 13:56:45.739017: Unhandled exception in wfastcgi.py: Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\wfastcgi.py", line 774, in main
record = read_fastcgi_record(fcgi_stream)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\wfastcgi.py", line 158, in read_fastcgi_record
data = stream.read(8) # read record
OSError: [Errno 22] Invalid argument
2023-05-27 13:56:45.743023: Unhandled exception in wfastcgi.py: Traceback (most recent call last)
every time when i am giving any data through form then it take data & save it to mongo db but at the times of processing data in backend its not processing ..
Whole web.config text is bellow:
<configuration>
<system.webServer>
<handlers>
<add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe|C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<directoryBrowse enabled="true" />
</system.webServer>
<appSettings>
<add key="WSGI_HANDLER" value="my_app.app" /> <!-- {name_of_file}.{name_of_flask_app}-->
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\flask-ins" />
<add key="WSGI_LOG" value="C:\inetpub\wwwroot\flask-ins\app.log" />
</appSettings>
<system.web>
<authentication mode="Forms" />
</system.web>
</configuration>
configuration: python 3.9 windows sever 2022 IIS - 10 wfascgi - 3.0.0
Any help will be really appreciated.
Thank you.
I tried updating the wfastcgi using pip also but same issue