App constantly refreshing after an update

Since moving to Meteor 1.3, every time I do an update to my web app, the screen will constantly refresh upon loading. It’s as if it’s doing an infinite number of hot reloads until you click the stop loading button. Anyone else encountered this problem?

4 Likes

Yes I am seeing it too. To me it happens in Chrome but not in other browsers as far as I have been able to see.
And in --production more.
It is a bit hard to understand whats going on since everything happens too fast to break and look at the debugger.

Yeah. This is sort of ridiculous. The app is becoming unusable with updates being pushed daily. Going to turn away so many of our returning users

Are you using FlowRouter?

I’m still on iron router

Ok, so it’s not an issue with the router. I’m using FlowRouter.

Yeah. It’s definitely a hot reload thing from meteors end. I wonder why
it’s not affecting all apps though

Using meteor cluster by any chance?

Have seen this too and in my case I suspect it’s related to nginx caching, but I’m not certain. What does your hosting setup look like?

Nginx load balancing to multiple mupx meteor instances

1 Like

Ok, so I’m also seeing this only behind nginx, but with a single instance. Looks like a valid suspicion…
But I am 99% certain it never happened in 1.2 with the same proxy config.

And I’m 100pc sure :slight_smile:

Now users are complaining. Is there a way to completely disable the hot reload functionality to stop this happening?

Posted an issue on Meteor Github too: https://github.com/meteor/meteor/issues/7115

meteor remove autoupdate

1 Like

That must be something related to cache. Did you use appcache, as I’d seen the problem several versions ago?

On my (low traffic) site we use no cache at all except nginx sending headers. Still happens.

if ($uri != '/') {
    expires 30d;
}

Can someone who is experiencing this problem try starting their server with the DISABLE_WEBSOCKETS=true environment variable set to see if that makes a difference?

(Disclaimer: This will make your app fall back to HTTP long-polling instead of using SockJS which is fine temporarily but is overall less optimal.)

e.g. DISABLE_WEBSOCKETS=true ROOT_URL=... MONGO_URL=... node main.js

If you’re using mupx, add it to env in your mupx config file:

"env": {
  ...other stuff...,
  "DISABLE_WEBSOCKETS": "true"
}

I saw a whole lot of this issue while deploying a 1.1 application with multiple nodes in a cluster (DNS round robin to multiple servers each with app behind nginx). The app would reload endlessly until deployment was finished to all the nodes in the cluster.

What helped in my case was disabling meteorhacks:cluster communication between nodes. My guess at the time was that update would trigger a reload, bounce to a server not yet up to date, and try again.

I’m not using appcache. But it does feel like a cache refresh. It used to
happen once whenever an update would happen. But now it goes into an
infinite loop of refreshes.

I’ve recently made two updates to my site. One has been moving to mupx from
mup. The other has been moving from meteor 1.2.x to 1.3.2.4.

I’m using nginx twice now. Mupx uses it and then I have nginx as balancer
sending the traffic to these which then forwards the traffic to meteor.

I do have meteor hacks cluster installed in the project although it’s not
in use currently so I will try removing it and see what happens.