Meteor starts only on port 3000, not any other port


#1

I am finding I can run Meteor only out of port 3000.

Am I the only one? Is this expected?

Here’s what I did :

you@trykik:~/projects$ meteor create jiko
Created a new Meteor app in 'jiko'.           

To run your new app:                          
  cd jiko                                     
  meteor                                      
                                              
If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn                


you@trykik:~/projects/jiko$ meteor npm install
jiko@ /home/you/projects/jiko
└─┬ meteor-node-stubs@0.2.3 
  ├── assert@1.3.0 
  ├─┬ browserify-zlib@0.1.4 
  │ └── pako@0.2.8 
  ├─┬ buffer@4.5.1 

  :    :    : 

  │ └── inherits@2.0.1 
  └─┬ vm-browserify@0.0.4 
    └── indexof@0.0.1 



you@trykik:~/projects/jiko$ meteor -p 3000
[[[[[ ~/projects/jiko ]]]]]                   

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/
^C


you@trykik:~/projects/jiko$ meteor -p 3001
[[[[[ ~/projects/jiko ]]]]]                   

=> Started proxy.                             
   Starting your app                         \   

I left it for a 1/2 an hour before finally killing it.

you@trykik:~/projects/jiko$ meteor --version
Meteor 1.4.0.1


you@trykik:~/projects/jiko$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial

I disabled my firewall, but it made no difference.


#2

Not 100% on -p, but I usually run meteor --port 3030 without an issue?


#3

I’m sure the launcher script immediately evaluates -p and --port to the same command switch, before meteor even sees it. But, I tried both in any case.

I asked the question as a sanity check before trying to investigate any further. If no one says they’re seeing the same thing I’ll have to dig into it. Maybe I’m a coal mining canary.


#4

IDK what others do, but for me, keys like “–port” or “–production” only work with “meteor run”,
“meteor” in my case always ignores theese keys.


#5

I would have been delighted for you to be right about that, but it doesn’t fix my situation, unfortunately.


#6

I just started up a completely fresh Xubuntu Xenial virtual machine, installed git and meteor and tried again.

Same thing!

Between …

=> Started proxy.

… and …

=> Started MongoDB.

… it gets stuck doing …

Starting your app                         \

Is there something “wrong” with Xubuntu? with Qemu/KVM virtual machines?


#7

Just tried for the heck of it and you’re right, any other port fails to start meteor server.
Truth is, most of us don’t care about dev port (this is why maybe no one noticed till now), as we set the port in production with PORT env variable.


#8

meteor run --port 666


#9

That is a devlishly ambiguous post. Beastly … one might say!


#10

I like to run two sites simultaneously when comparing behavior of different bits of sample code and that sort of thing.

So, do I post an issue about it? or did you do that?

Oh and thanks so much for giving it a try. :beer:
I thought I had a very weird defect in my work environment.


#11

I have the same issue on two different Ubuntu servers since the upgrade to Meteor 1.4.0.1.
Is there any workaround or fix about this issue you had ?
Or is there any opened issue on Meteor Github about that ?


#12

I didn’t open an issue. I don’t know if anyone else did.

It is not a big concern for me. If you are having problems as a consequence you should report it.

imho, it is as much a bug in release testing as it is a run time bug. iow, seems all tests are done only on port 3000.


#13

Okay, thanks for your answer.

I’ll post a detailled issue about that since a lot has been discovered since my post on gitter.


#14

You could try running it with METEOR_PROFILE=1 METEOR_LOG=debug meteor --verbose (source: Meteor stuck at starting your app)


#15

Gee Willikers, @merlinpatt ! :tada: That actually worked !

But I had to do :

meteor reset
METEOR_PROFILE=1 METEOR_LOG=debug meteor --verbose -p 3001

#16

Ok that’s weird. I just tried meteor reset on its own and . . .

. . . Bingo! It seems that that’s all that’s required if you want to switch ports.

( The other thread you cited had that suggestion. Thanks! )


#17

I’m reviewing the issue right now, but I can see some obvious problems in this post:

  • You cannot* run two different Meteor projects on 3000 and 3001 because Meteor uses PORT+1 for the Mongo server it uses. You should use ports that are further away from each other. (Personally, I use 3100, 3200, 3300, etc.)
    * = Unless you use your own Mongo server with MONGO_URL, which prevents starting a Mongo server on PORT+1
  • You cannot run two different versions of the same project from the same folder unless you specify a new MONGO_LOCAL_DIR environment variable. (i.e. MONGO_LOCAL_DIR=.meteor/local2 meteor --port 3600

I run multiple reproductions all day long (on Mac) and have not run into the problems you’re describing.


#18

I did not try to run two at once. I tried to run on some other port than 3000.

As the thread subject, and my original post, states, " . . . I can run Meteor only out of port 3000".

The trick, to running on a different port, is to do meteor reset before switching.


#19

Thanks for the clarification - I’m just pointing out some potential problems due to some not-entirely-clear wording in the issue.

Anyhow, I’ve just confirmed that this is occurring on Ubuntu 14.04 – presumably other versions too, but I cannot get it to happen in Windows or OS X.

In regards to your other comments:

It’s a shame that you’re disappointed in the release testing. There are, in fact, tests in place to run the tool on different ports. I’m not entirely sure why those are passing but this problem still occurring, especially since they run in a CI environment that I’m almost entirely sure is Ubuntu. Hopefully this can be figured out!

If you have suggestions for better tests to prevent this in the future please do file issues and pull-requests accordingly. Also, involving yourself in public betas and filing issues is a great way to help identify these problems before they are officially released.


#20

Thanks very much for stepping in and looking at this.

I’m not disappointed! In fact, I’m overwhelmed by the quality of the Meteor release process.

I was just pointing out a miniscule, apparent deficiency. I believe the test needs to start Meteor on port 3000, stop it, then try to start it again, specifying some other port. That seems to be the prerequisite for recreating the failure.