Python Forum

Full Version: Error regarding FastCGI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to deploy a flask app on IIS 10, but I got 500 error:

HTTP Error 500.0 - Internal Server Error
C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe - The FastCGI process exited unexpectedly

I'm using python 3.6 with wfastcgi 3.0.0 and I followed the web.config file template on https://pypi.python.org/pypi/wfastcgi, still no luck.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="Python FastCGI"
path="*"
verb="*"
modules="FastCgiModule"
scriptProcessor="C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe|C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Lib\site-packages\wfastcgi.py"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
</system.webServer>

<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="app.wsgi_app()" />
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\imageNetModel\imageNetModel" />

<!-- Optional settings -->
<add key="WSGI_LOG" value="C:\Logs\my_app.log" />
<add key="WSGI_RESTART_FILE_REGEX" value=".*((\.py)|(\.config))$" />
<add key="APPINSIGHTS_INSTRUMENTATIONKEY" value="__instrumentation_key__" />
<add key="DJANGO_SETTINGS_MODULE" value="my_app.settings" />
<add key="WSGI_PTVSD_SECRET" value="__secret_code__" />
<add key="WSGI_PTVSD_ADDRESS" value="ipaddress:port" />
</appSettings>
</configuration>


Anyone has an idea what's going on? Thanks in advance.
Please re-post with code between code tags, see BBCODE
when posting code, use shift-ctrl-v which will preserve indentation.
Yes sir.
  <?xml version="1.0" encoding="UTF-8"?>
  <configuration>
    <system.webServer>
      <handlers>
        <add name="Python FastCGI"
            path="*"
            verb="*"
            modules="FastCgiModule"
            scriptProcessor="C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe|C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Lib\site-packages\wfastcgi.py"
            resourceType="Unspecified"
            requireAccess="Script" 
          />
      </handlers>
    </system.webServer>

    <appSettings>
      <!-- Required settings -->
      <add key="WSGI_HANDLER" value="app.wsgi_app()" />
      <add key="PYTHONPATH" value="C:\inetpub\wwwroot\imageNetModel\imageNetModel" />

      <!-- Optional settings -->
      <add key="WSGI_LOG" value="C:\Logs\my_app.log" />
      <add key="WSGI_RESTART_FILE_REGEX" value=".*((\.py)|(\.config))$" />
      <add key="APPINSIGHTS_INSTRUMENTATIONKEY" value="__instrumentation_key__" />
      <add key="DJANGO_SETTINGS_MODULE" value="my_app.settings" />
      <add key="WSGI_PTVSD_SECRET" value="__secret_code__" />
      <add key="WSGI_PTVSD_ADDRESS" value="ipaddress:port" />
    </appSettings>
  </configuration>
Error 500 is an internal server error.
see: https://www.rfc-editor.org/info/rfc7231 for complete list of errors, and probable causes.
Not much to go on here, but this is the definition of that error:
Quote:The 500 (Internal Server Error) status code indicates that the server
   encountered an unexpected condition that prevented it from fulfilling
   the request.
Thanks Larz60, I understand that is an internal server error. There was a thread on stackoverflow saying wfastcgi module doesn't work with python 3.5, 3.6:

https://stackoverflow.com/questions/4274...expectedly

Above thread was posted a half year ago so right now I'm looking at https://pypi.python.org/pypi/wfastcgi and it looks like wfastcgi newer version supports python 3.6, which is my python version. But my question is, why am I still getting this error, am I doing something wrong there?
Is there anything meaningful in the IIS error logs?
Unfortunately no... I've checked the log files and event viewer. There is absolutely no related error message.
(Dec-16-2017, 03:25 PM)jiajingy Wrote: [ -> ]Unfortunately no... I've checked the log files and event viewer. There is absolutely no related error message.

Hello, in this moment i have the same error,
Did you find the error?, i need help
Dear Friends,

Any update or any solution you found to deploy Flask App on IIS.

Thanks'
Dharmesh