This project has moved and is read-only. For the latest updates, please go here.

WFastCGI issue loading cx_Oracle

Sep 3, 2014 at 4:49 PM
This may not be the best location for this question, but I can't think of a better, so here goes. I've managed to get WFastCGI working with a very simple test Django application, and so my next step is to move on to my real application. Unfortunately, when I try to load the application, I get an Error returned, saying "Error loading cx_Oracle module: DLL load failed: The specified module could not be found". I don't understand why this would occur, as I've confirmed that the virtualenv python exe I'm using can load that module without any problem. I've an Oracle client and can connect without problem to my database.

My website is configured correctly to the point that the wfastcgi handler is running and trying to import everything. As you can tell, I'm a n00b with IIS and WFastCGI, so any suggestions/guidance you can provide, even if it's a different place to ask my question, will be greatly appreciated. Thanks in advance.
Sep 3, 2014 at 6:37 PM
Are you running this locally or on Windows Azure Web Sites? One possibility might be a difference between 32-bit vs 64-bit environments.

If you're running locally can you post your configuration for your handler in applicationHost.config and your web.config?
Sep 3, 2014 at 8:06 PM
I'm running it locally, on Windows 2012 with IIS 8.5. testd is the simple Django app that works, sdcgis is the real app, the one causing the problem.

<?xml version="1.0" encoding="UTF-8"?>
        <add key="WSGI_HANDLER" value="django.core.handlers.wsgi.WSGIHandler()" />
        <add key="DJANGO_SETTINGS_MODULE" value="sdcgis.settings" />
        <add key="PYTHONPATH" value="C:\sdcgis;C:\Python27\Lib\site-packages;C:\Virtual\Django165\Lib\site-packages" />
        <add name="WFastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Virtual\Django165\Scripts\python.exe|c:\Python27\Scripts\" resourceType="Either" requireAccess="Script" />
applicationHost.config (I guessed at what you'll need, it's too large to post in its entirety):
            <add name="DefaultAppPool" autoStart="true" enable32BitAppOnWin64="true" />
            <add name="Default Web Site" />
            <add name="sdcgis" />
            <add name="testd" autoStart="true" enable32BitAppOnWin64="false" />
            <applicationPoolDefaults managedRuntimeVersion="v4.0">
                <processModel identityType="ApplicationPoolIdentity" />
            <site name="Default Web Site" id="1">
                <application path="/" applicationPool="Default Web Site">
                    <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
                    <binding protocol="http" bindingInformation="*:80:" />
            <site name="testd" id="2" serverAutoStart="true">
                <application path="/" applicationPool="testd">
                    <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\testd" />
                    <binding protocol="http" bindingInformation="*:8000:" />
                <traceFailedRequestsLogging enabled="true" />
            <site name="sdcgis" id="3" serverAutoStart="true">
                <application path="/" applicationPool="sdcgis">
                    <virtualDirectory path="/" physicalPath="C:\sdcgis" />
                    <binding protocol="http" bindingInformation="*:82:" />
                <logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
                <traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
            <applicationDefaults applicationPool="DefaultAppPool" />
            <virtualDirectoryDefaults allowSubDirConfig="true" />
            <application fullPath="C:\Virtual\Django165\Scripts\python.exe" arguments="C:\Python27\Scripts\" monitorChangesTo="" stderrMode="ReturnStdErrIn500" maxInstances="4" idleTimeout="300" activityTimeout="30" requestTimeout="90" instanceMaxRequests="200" protocol="NamedPipe" queueLength="1000" flushNamedPipe="false" rapidFailsPerMinute="10" />
Sep 19, 2014 at 10:24 PM
Not sure why this didn't work, but I completely removed Python and all related items, and then cleaned out any cx_Oracle entries in the registry. Then I reinstalled everything and it's working now.
Marked as answer by holyoaks on 9/19/2014 at 2:24 PM