"msnodesql-0.2.1-v0.8-ia32.msi" does not work on Azure Web Sites #114

Open
siacomuzzi opened this Issue Feb 18, 2013 · 13 comments

Projects

None yet

3 participants

@siacomuzzi

Hi, I have problems to run the module in Azure Web Sites.

Repro steps:

  1. Remove msnodesql from dependencies in my package.json
  2. Copy content of "msnodesql-0.2.1-v0.8-ia32.msi" to "node_modules\msnodesql"
  3. Include "node_modules\msnodesql" content in my GIT repository
  4. Deploy to Azure
  5. When deployment is ready, and navigate to the web page, the error is the following:

"Error: Cannot find module '../build/Release/sqlserver.node'"
Error details: http://puu.sh/24jL4

@jkint
Contributor
jkint commented Feb 18, 2013

Please try msnodesql-0.2.1-v0.6-{ia32|x64}.msi. I believe Windows Azure Web Sites uses node.js 0.6, though I don't know the processor version.

To verify, it should be easy enough to write a simple website that outputs process.version and process.arch.

Thanks, and let us know the results are.

@siacomuzzi

Thanks Jay!

  • With "msnodesql-0.2.1-v0.6-{ia32|x64}.msi" -> same error
  • Azure websites: (process.version: v0.8.2; process.arch: ia32)
@jkint
Contributor
jkint commented Feb 18, 2013

Okay, well that eliminates that possibility. :)

Where is the sqlserver.node file within the archive? It should be in the node_modules\msnodesql\lib directory.

With your layout as I understand it, you should be able to do a "var sql=require('msnodesql')" from a node REPL prompt and have it load successfully. Is this successful prior to deploying on Windows Azure Web Sites?

@siacomuzzi
  • My "node_modules\msnodesql\lib" folder: http://puu.sh/24C5J
  • And yes, the module works fine on my machine
@jkint
Contributor
jkint commented Feb 18, 2013

Well, I'm not sure what's wrong. Just for completeness, I'll refer you to our article on the subject, but I think you've already done as it instructs.

I don't know... What does your package.json look like?

@siacomuzzi

My package.json: http://puu.sh/24CLP

@jkint
Contributor
jkint commented Feb 20, 2013

I've had some success, but I'm still working on making the solution more robust.

@jkint
Contributor
jkint commented Feb 21, 2013

So the crux of the issue is that Windows Azure Web Sites deploys node.js 0.8.2, and we distribute .node files built against 0.8.8, which can't be loaded by 0.8.2. If you were to rebuild against 0.8.2, it should work...

@siacomuzzi

Thanks Jay!
I'll try and let you know how it went.

@siacomuzzi

Same error :( => http://msnodesql-spike.azurewebsites.net/

I'm generating the sqlserver.node file with the following environment: http://puu.sh/26ctG
Could you please send me your copy of the sqlserver.node file that works on Azure Web Sites?

Thanks!

@jkint
Contributor
jkint commented Feb 21, 2013

I can do that. I hope to check in to a private branch that you can access later today/tomorrow.

Just FYI, Windows Azure Web Sites is set to 0.8.2. Download it from http://nodejs.org/dist/v0.8.2/ and put node.exe in a directory, e.g. c:\nodejs-0.8.2:

rem done in a Visual Studio command prompt
set PATH=c:\nodejs-0.8.2;%PATH%
rem should print v0.8.2
node -v
rem should print ia32
node -e "console.log( process.arch );"
cd \msnodesql
rem should produce a sqlserver.node file in build\release
node-gyp rebuild
cd build\release
node
> var sql=require( './sqlserver.node');
undefined <-- printed by node.js if the require was successful
> process.exit();

This should give you a sqlserver.node file that is compatible with Windows Azure Web Sites. Otherwise, you can wait until I have my private branch set up to try out. That make take a day or two :(.

@nnnick
nnnick commented Apr 4, 2013

I think I'm having a similar issue in deploying msnodesql to Azure.

@siacomuzzi did you have any luck deploying @jkint's copy of the sqlserver.node file?

I've created my sqlserver.node file using node version 8.2.0 but I'm still getting deployment errors on Azure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment