What I’ve tried and what’s not working:
anvil.server.call sometimes results in AppOfflineError: Connection to server failed (1006) randomly, without any clues as to why it happens. I use try except and sleep(10) before making another 5 server calls within 50 seconds. Sometimes it works, sometimes doesn’t.
I checked out the following links as well, but still now find the solution. Any help is greatly appreciated.:
The AppOfflineError part could mean that the Anvil server is down.
The Connection to server failed part could mean that the client can’t reach the server.
Usually, when you get this error, there is a connection problem, it has nothing to do with Anvil.
The connection between the client and the server hops many times and there are many points of failure.
Perhaps Anvil could do better to improve the description of the error in some cases, but when you deal with long distance (and also short distance) connections, you always need to manage the random failures, because you will always have random failures.
Could be a connection problem that lasts longer than 50 seconds?
Are you having problems only with the running app or also with the IDE?
Are you having problems with all the instances of the app or one client works and one doesn’t (especially if the 2 clients are in two different cities/states/continents)?
I am having the same problem sometime. To be honest I am worried about the error between Anvil and (1006) is something else to deal outside Anvil , I use Uplink and the function continues but the client sees AppOfflineError: App is offline
AppOfflineError: Connection to server failed (1006)
at AddComponent, line 56
AppOfflineError: App is offline
at anvil-services/anvil/users/__init__.py, line 83
called from anvil-services/anvil/users/__init__.py, line 83
called from AddComponent, line 68 ```
I also tried the code below from forum to increase time out, but also this function is listed in the error above