New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ports are not always numbers #4413
Comments
Seems pretty legit to me. It's technically a feature request because we don't support production Meteor on Windows, but I would look at a PR for this. |
Good to hear. I'll bake up a PR this week. Thanks. |
Port environment var is not used by meteor on windows, is it normal ? |
That shouldn't be the case. Do you have a reproduction? |
I've just tryed to reproduce it :
then i got this in the console :
i open chrome to localhost:3333 : it fails i kill meteor and then relaunch meteor with port params
then i got this in the console :
i open chrome to localhost:3000: it fails I'm using windows 8.1, a meteor 1.1.0.2, and consoleZ 1.11.0.14175 |
We ran into the same issue when trying to build Meteor as a web app on Azure. In our case the PORT is not an integer, but a named pipe (string). web-app.js converts our string to an integer using parseInt, resulting in an app that doesn't listen on any port. When we remove the parseInt function call, the app is working. |
My approval to sign the CLA has been delayed (couldn't you tell? 😢). It should be a relatively simple fix to remove the parseInt on the port. There probably needs to be a test added which uses a named pipe. There is also a risk of errors for existing users who provide a port as a string like "3000foo"; what worked for them before (because of the nature of parseInt), will no longer work. This is likely a corner case and most people aren't doing anything of this nature, but it may be worth a warning in a version change doc. I'm happy to advise best practices for this if someone wants to tackle this while I'm being hung out to dry. 😄. |
@christopheranderson I'm interested in helping out with this, and have no trouble signing a CLA. Any thoughts on making this as backwards-friendly as possible? Is there a way to detect the use of IISNode from within Node.js? |
The strictest change needed to support named pipes for ports would involve checking the string to see if it looks like a named pipe. Following the MSDN docs for Pipe Names formatting, all named pipes should be named |
Well I forked meteor and cloned the |
I forked the repo with the intent of creating a unit test and corresponding fix for supporting named pipes, but have been struggling with the process. https://github.com/meteor/meteor/wiki/Contributing-to-Meteor didn't really help me with the following:
I'm likely missing a critical wiki page or blog that will set me straight! |
@ericterpstra unfortunately we don't support running from Git Bash, you need to run the @moonrockfamily You should add a unit test in webapp.js somehow, and you can run all of the tests with |
Running => Started proxy. => App running at: http://localhost:3000/ Opening http://localhost:3000/ displays: All tests pass! and 'Passed 0 or 0' |
You need to run the |
Tried again to work with meteor and run the test suite, but getting an error with node-aes-gcm. Seems to be a 32 vs 64 bit thing. I'm on Windows 7 64-bit, but running Node 0.12.7 32-bit because meteor.bat wouldn't use the right fibers.node with Node x64. Anyone else made any progress on this? This is only one of several problems I've had trying to run the tests. @christopheranderson Has that CLA been approved? :)
|
I managed to get everything working and tested. Basically added a check to see if process.env.PORT matches the named pipe pattern and returns a string. If not, it falls back to parseInt. The tests passed locally, but something failed on CircleCI related to CSS minification. Not sure why. @stubailo @christopheranderson - If there's anything to change or add, please let me know. Looking forward to getting this fixed. |
Looks good. I think that this addresses the Named Pipe issue while allowing the least amount of potential functional changes otherwise. In a perfect world, we might throw with a "Ports must be a number or match the named pipe pattern", but that would probably cause some headaches while only helping the rare person who gives a bad port. I think how you have it is fine. If you want really pedantic feedback, :), I'd add a test for a garbage string and expect it to fail. |
Hopefully the next release is soon! |
Hi Guys, can someone post a blog or any reference for deploying meteor 1.2 in a Windows Server 2012? It's just a pain in the ass knowing that every sites I visit the tutorials are for Ubuntu and/or Mac. Btw, I have no choice but to use Windows Server 2012 ;( |
@ICS-user I've had to piece things together. The biggest pain (aside from this port issue) is getting fibers compiled. I'm working on a deployment for Windows Server 2012 right now, and will post something online or in the forums in the next few days. (I'm also 'stuck' with WS2012 at work) |
@ericterpstra I share the agony. I need to deploy my app before Friday. Please let me know if you are already done with that post. Thanks! |
@ericterpstra I'm very interesting in your work of running meteor with iisnode. Where will you post regarding this matter so I can follow your progress? |
Wrote this a while back for a customer on trying to run it on IISNode with Azure Web Apps. Let me know if it helps. It requires demeteorize, which isn't ideal. Making Meteor.js work on Azure Web Apps Prepare dev environment:
Preparing package for deployment to Azure: Testing locally: Setting up and deploying to Azure: There's some investigation I'm looking into of using the iisnode.yml file to specify starting the meteor site without the "demeteorize" step, but it's in the "nice to do" pile. @rramachand21 is a great resource if you run into issues with IISNode specifically. |
Hi @ericterpstra where are you on the writings for your deployment. It's a good thing that my client agreed to deploy the web app in the meteor cloud. But not for long, I will be needing to deploy it on a Windows provided server. So I was hoping I can reference you writing for this matter. All the best! |
hi @christopheranderson regarding the azure. Is there any way that we can deploy by just using a plain cloud instance of Windows Server 2012? With IISNode? My client's set up is just like that. Thanks! |
You gotta drop your site into the right place, have a web.config & associated files to make IISNode work, and set your app settings correctly as above. The requirements aren't really different from Azure Web Apps; it's just a pain to manage your own VMs. Auto-scale/heal ftw. |
Recently i described the steps how to install a Meteor App on IIS using IISNODE. https://forums.meteor.com/t/anyone-have-meteor-working-with-window-server-iis-iisnode/8922/2 We also deploying it to Azure WebApps. To build the package we're using Teamcity to automate the steps to make it able to run on Windows based enviroments and indeed i'm using MSDeploy to package and deploy the solution to internal machines or Azure WebApps or VM's. When using MSdeploy aka WebDeploy you have to include the web.config and the iisnode.yml. If you're deploying using GIT it will check in the root of the meteor app if there is a package.json to check if it's a NodeJS application. If so, Kudu (the mechanism behind Azure WebApp) will create a web.config with some default rewrite rules. |
In Webapp.js, parseInt is used on the env.PORT. The env.PORT need not always be a number, but can be a named pipe.
meteor/packages/webapp/webapp_server.js
Line 742 in 40ec476
This issue can be hit when running Meteor with IIS on Windows, which uses a named pipe to feed the connections to Node. Removing the parseInt function call works fine for named pipes and ports on local tests. express-generator ships with a port parsing function which is more robust - maybe a better option than dropping the parseInt entirely.
The text was updated successfully, but these errors were encountered: