One Deployment Method for A Meteor Application on Windows

Sorry – didn’t see this and my app is still @ Meteor 1.2, so no chance to explore the best method for a 1.4 app. Have you tried to do it?

Hi

No not yet… I was running iT with --production but that is not stable…

Also can we use mupx to deploy from and TO Windows. Specs only say from…?

Verstuurd vanaf mijn iPhone

I’ve tried this since upgrading my project to Meteor 1.4 and I am facing some issues that I am trying to get some answers on:

And I posted on the iisnode GitHub issues site too: https://github.com/tjanczuk/iisnode/issues/528

I presume it’s not as easy as using the correct version of node? Since 1.4 you need node 4.X.X whereas before it was 0.10.40.

And yes, I know you can run it from the command line, but that doesn’t mean that it’s the same node binary iisnode is running. Maybe it’s pointing to a 0.10.40 node still?

I thought I had checked but your message prompted me to check again. I know how easy it is to miss these little things.

It looks like I am using Node v4.5.0 x86, and the web.config is pointing to the correct location for that version of Node also:

<iisnode nodeProcessCommandLine="C:\Program Files (x86)\nodejs\node.exe" />

I just tried that web.config but I get the same error.

Out of interest, do you have a PORT environment variable set? I am wondering if the issue is related to the ports being different between the demeteorized app and the IIS binding. From what I have been reading, iisnode asks that developers use the process.env.PORT variable, but it’s not possible for me to set this for the demeteorized application since it relies on the PORT environment variable. Or is it possible? Just throwing some ideas out there.

process.env.PORT and setting the “PORT environment variable” is the same thing. So when you set a variable in Windows (SET PORT=XXXX) that turns into process.env.PORT within a node application. It’s slightly different for Linux systems, but the idea is the same (export PORT=XXXX for Linux)

Ah okay, that makes sense.

Should it matter then that the node application is running on port 8080 and the IIS site binding is port 80? I think I am right in that iisnode should handle the communication between those ports, but I just want to double check.

Yeah, IISNode handles the communication between IIS/Node using a named pipe (this was an issue in the past)

1 Like

I would try turning on event tracing to see if you can get some more info about the error. I don’t think this was directly caused by the Meteor upgrade (we are running the latest version without any issues).

Thanks, I’ve tried enabling ETW logging in IIS if this is what you are referring to? But I am not seeing any additional relevant information.

I am a total newb when it comes to iisnode (I hadn’t even heard of it let alone use it) … but … one would think that you would have to somehow map the port / URL on IIS to the port (and maybe URL) within the node / meteor application so it knows to go from http://some.domain:80/foo -> meteor iisnode :8080 ??

Also it would be a bit odd to not have iisnode output anything at all to stdout/stderr when things happen? Maybe within iisnode you can specify some log file to use? I think you are close …

Also – isn’t there an “issue” area for iisnode you can post to asking for help? Seems like this is the main issue and not much else…

1 Like

@ramijarrar are you also using iisnode v0.2.21 (x64)?

@sjmcdowall thanks for your feedback and suggestions. I’ve posted to the iisnode GitHub issues site but it’s not had any comments yet.

We are using v0.2.21 (x86) of IISNode on Azure App Service.

Are you still setting PORT? This will definitely conflict with the communication between IIS/Node.

PORT is set to 8080. If I unset PORT then there is a conflict because the default port binding the node app uses is 80, which is the same as the IIS site, so the node application fails to start.

Here is a link I found doing a little googling …

Getting Started with IISNODE

Seems like a great article to try to debug this, but lo and behold the first thing I get out of here is that PORT should NOT be set at all because it appears iisnode will set the PORT it wants you to listen to create a channel back to it. So I would make sure NO PORT is set anywhere and console.log the process.env.PORT at the start of the node main.js or where ever and see what port # it’s doing … are you sure you are letting iisnode LAUNCH your node application?

Anyway, maybe that article will help – seems useful to me.

Hello,
I am trying to deploy a meteor 1.5 application and so far I have been able ;

  • to generate the build successfully.
  • I cd programs/server && run npm install ( I got a few warning and these errors

'node-pre-gyp' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@1.0.2 install:node-pre-gyp install --fallback-to-buildnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@1.0.2 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! meteor-dev-bundle@0.0.0 install:node npm-rebuild.jsnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script.

I ignored these and went on to cd into bundle and run node main.js and I got the following

`Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.
C:\ARBProd\bundle\programs\server\node_modules\fibers\future.js:280
throw(ex);
^

Error: MONGO_URL must be set in environment
at Object. (packages/mongo/remote_collection_driver.js:36:11)
at Object.defaultRemoteCollectionDriver (packages\underscore.js:784:19)
at new Mongo.Collection (packages/mongo/collection.js:99:40)
at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
at fileEvaluate (packages\modules-runtime.js:197:9)
at require (packages\modules-runtime.js:120:16)
at C:\ARBProd\bundle\programs\server\packages\accounts-base.js:2019:15
at C:\ARBProd\bundle\programs\server\packages\accounts-base.js:2030:3`

Please help. I am assuming the last error requires me to install mongo and somehow set the url etc. I have always run mongo only from meteor and not sure how to go about all that. Please help, I really need to get the app running on production server now.

NB: all I have done so far is still on my development environment (windows 10 64bit)
how do you install mongo as a self starting service and link a db to meteor?
what else must I do to get the app running on current development machine (to simulate production) so I can replicate same steps on actual production machine

In order to install native bcrypt on Windows, you’ll need a full set of build utilities installing first. You could try meteor npm install --global windows-build-tools (see windows-build-tools - npm) for more info. However, the software version is normally fine, unless you’re expecting several thousand authentication requests per second!

That seems to be your real problem. Meteor installs a development version of MongoDB as part of its application build. Looking at your problem statement I’m not sure that you’re doing the right things in the right places. So, starting from scratch in my home directory, this is what I’d expect to see:

meteor create my-new-app
cd my-new-app
meteor npm i
meteor

BTW, this topic is about deploying a Meteor app. You seem to be discussing building a Meteor app.

@robfallows
I am actually discussing deployment to windows.
I have made more progress since i last posted here.
My current challenge is how to set the mongo_url as well as root_url for only the build version.
I set an environment variable for the MONGO_URL but it affected all other meteor apps on my development machine which i am using to test for production
currently when i run node main.js this is what i get,

`PS C:\ARBProd\bundle> node main.js
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.

C:\ARBProd\bundle\programs\server\node_modules\fibers\future.js:313
throw(ex);
^
MongoError: failed to connect to server [localhost:27017] on first connect
at Pool. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\topologies\server.js:326:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:191:7)
at Connection. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\connection\pool.js:270:12)
at Object.onceWrapper (events.js:293:19)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:194:7)
at Socket. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\connection\connection.js:175:49)
at Object.onceWrapper (events.js:293:19)
at emitOne (events.js:96:13)
PS C:\ARBProd\bundle> node main.js
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.`

I have a discussion open here. Please have a look and help. Thanks