Anvil Community Forum

Improve error message for Internal server error

I have some uplink code that sends data (a list of dicts) to the anvil server code. The data is passed to this code as the “value”:

def set_global(name, value):
  row = _get_global_row(name)

Not very exciting, until you run the code and get this rather unhelpful error (at the row.update line):

Traceback (most recent call last):
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/src/binnenmelder/", line 128, in <module>
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/src/binnenmelder/", line 90, in plandag_poller
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/src/binnenmelder/", line 80, in upload_plandag_info'upload_plandag_info', data)
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/.venv/lib/python3.9/site-packages/anvil/", line 395, in call
    return _do_call(args, kwargs, fn_name=fn_name)
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/.venv/lib/python3.9/site-packages/anvil/", line 387, in _do_call
    return _threaded_server.do_call(args, kwargs, fn_name=fn_name, live_object=live_object)
  File "/Users/mjm/Dropbox/Devel/ACHN/Anvil_Binnenmelder/binnenmelder/.venv/lib/python3.9/site-packages/anvil/", line 412, in do_call
    raise error_from_server
anvil._server.InternalError: Internal server error: 5114160c907b

After a lot of spelunking I found out that one of the values of some dicts contained an erroneous value of “nan” (as an expression, not a string), caused by an Pandas Dataframe.to_dict(‘records’). Obviously the Pandas NaN value was incorrectly exported. Easily fixed once you know it.

So I’m only posting this because of the “internal server error” in the hope that can be turnes into something more useful.


Hi @mjmare,

Thanks for raising this. Agreed, it should fail more gracefully - I’ve added this to our list.