Downlink Disconnected x8, servercode exited unexpectedly x3, connection failed x2

What I’m trying to do:
I have recently launched my app to a small group of users and am getting errors that I do not know how to deal with. I posted many last week and just over this weekend I have gotten 13 new error messages:

  • 8 x downlink disconnected
  • 3 x servercode exited unexpectedly
  • 2 x connection to server failed

This happens in different places in my app, often on background tasks that I have yet to optimise. I am wondering the following:

  1. Is anyone else experiencing similar issues?
  2. What is the correct way to get support with this from Anvil?
  3. Are there ways for me to debug this without support from Anvil?

The session ID’s are:
WVURRENAJJGJO5375BVSN6O2H5PHWFM7
QMHWSMXOU62TP2NNWZAPNNQZCY7BSXB5
WX3TEO4RBACLNFIY24GBTJXUZEEA6CHE
X5SCVN4BU2CA5HX2K7VUC3C4NTMGC5BD
TBM2KOI2NBFQLILLVVWLFJ2ZVXGMTPTJ
RJED7VSDGB4VV67L5E6OETYBJ6FXXAMJ
DT4USIYQYW4VX3ZV3PPR3HN66LTWI2TQ
6THPWZSBPUK76DD6PIXRFTPTXDEOY2WC
O3NPL3L2JLWQOEONQ5KOCBOIMD6HWEZR
K46YTIVYHGTNVJBARCDM7MO5UALBMNAD
RBURP3V5WPZUFKBMPA5XXMFUGVS6MDQ3
OQZOCEYWPSPZIAB2XDIEFCJTN5SNHWEY
Z36LIKT6VB72L72N23TGEJEAWNUELWU4

Hi @davidtopf2,

Before anything else – sorry about the rough ride you’ve been having! The errors you’re observing fall into two categories:

First, the “disconnected” / “exited unexpectedly” errors are to do with your server code unexpectedly dying. The most common cause of this is that your code is running out of memory. As you’re on a Business plan I’ve bumped up your per-instance memory allocation to 2G - could you see if this helps over the next few hours? If you find yourself consuming a lot more RAM than that, consistently you might want to consider a Dedicated plan.

(You might at this point ask the very reasonable question of “how can I monitor RAM usage in my server modules?” The answer is that right now we can currently only do that for Dedicated plans, but watch this space!)

The “Connection to server failed” error is a different kettle of fish. This is an error the browser gives us when it can’t connect a websocket, and the websocket is how we do anvil.server.call()s. The most typical cause of this is a user’s internet connection flaking out for a second, although it can also be caused by corporate firewalls that shoot down websocket connections. In the former cases (ie most of the time) you’ll find that if you retry the call a moment later it will usually work, so the recommended approach is a global error handler to turn that temporary connectivity issue into a more pleasant experience for the user.

1 Like