App constantly refreshing after an update

#1

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?

3 Likes
Keeps indexing and refreshing
#2

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.

#3

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

#4

Are you using FlowRouter?

#5

I’m still on iron router

#6

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

#7

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

#8

Using meteor cluster by any chance?

#9

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?

#10

Nginx load balancing to multiple mupx meteor instances

1 Like
#11

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.

#12

And I’m 100pc sure :slight_smile:

#13

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

#14

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

#15

meteor remove autoupdate

1 Like
#16

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

#17

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

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

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"
}
#19

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.

#20

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.