tjanczuk / iisnode

Hosting node.js applications in IIS on Windows
Other
1.85k stars 588 forks source link

iisnode and node-oracle: Is it possible? #411

Open SegFault0x0 opened 9 years ago

SegFault0x0 commented 9 years ago

I'm trying to perform an Oracle query with node-oracle via iisnode. I renamed all of my node files as *.njs and currently have my web.config set up for iisnode to handle all files of that extension, and a rewrite rule to forward the incoming requests to index.njs. "index.njs" is a server setup based upon The Node Beginner book's example (i.e. index.njs->server.njs->router.njs->requesthandlers.njs). The problem occurs when node-oracle -- utilized within requesthandlers.njs -- attempts to call oracle_bindings.node:

Application has thrown an uncaught exception and is terminated:
Error: The specified module could not be found.

c:\Program Files\iisnode\www\Reports\node_modules\oracle\build\Release\oracle_bindings.node
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (c:\Program Files\iisnode\www\Reports\node_modules\oracle\lib\oracle.njs:2:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Is there any way of getting around this or another solution I could use? Thanks in advance!

ghost commented 9 years ago

I have the same issue. When running the node app directly, without using iisnode, there is no problem. When running the same app via iisnode, I get the exact same error message as iGeechee has listed.

fatihalp commented 9 years ago

Same problem with a little bit different error message:


iisnode encountered an error when processing the request.

HRESULT: 0x6d
HTTP status: 500
HTTP subStatus: 1013
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

Application has thrown an uncaught exception and is terminated:
Error: %1 is not a valid Win32 application.

C:\Program Files\iisnode\www\nodeapp\node_modules\oracledb\build\Release\oracledb.node
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Program Files\iisnode\www\nodeapp\node_modules\oracledb\lib\oracledb.js:23:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
brunodenis commented 8 years ago

Same problem with a different error message :

Application has thrown an uncaught exception and is terminated: Error: The specified procedure could not be found. C:\MyMetriks\nodejs\node_modules\oracledb\build\Release\oracledb.node at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (C:\MyMetriks\nodejs\node_modules\oracledb\lib\oracledb.js:23:15) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)

Process is working fine when launched by node.exe via command but not via iisnode. Assistance would be greatly appreciated.

dominhhai commented 8 years ago

Same problem!

SegFault0x0 commented 8 years ago

I ended-up abandoning iisnode for node-windows, which runs node.exe as a service. I updated my server files to support CORS and set the service to start automatically on system startup.

sahandhnj commented 7 years ago

Any solution ?

ghc20 commented 7 years ago

Did anyone find a solution?

baseigneurie commented 7 years ago

Hey guys, same issue. When I run it locally with node app.js it works fine, but when loading the page through iisnode/IIS I get the same error.

iisnode encountered an error when processing the request.

HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

Application has thrown an uncaught exception and is terminated:
Error: The specified procedure could not be found.

\\?\C:\Applications\api\node_modules\oracledb\build\Release\oracledb.node
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Applications\api\node_modules\oracledb\lib\oracledb.js:35:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Applications\api\node_modules\oracledb\index.js:1:80)
SegFault0x0 commented 7 years ago

Have either of you tried @ghaefele's solution?

The error "The specified module could not be found" resulted from missing permissions for the IIS user on the oracle client folder (oci.dll). The IIS-process could not read the oci.dll on which oracledb depends. During development and outside IIS, my account had permissions on this folder. (#529)

And do you absolutely need Node traffic to go through IIS? I was able to use node-windows to run node.exe as a windows service which starts automatically on startup (and restarts upon failure), and still use IIS for my other traffic.