anvil.tables.TableError: Table not found. Has it been deleted?

Hello,

I’m suddenly getting the following error message

anvil.tables.TableError: Table not found. Has it been deleted?

This occurs in multiple tables. But the tables are definitely there and contain data. The server has full access; I haven’t renamed anything and added no columns.

The error occurs when I retrieve the data in the server code (the parameter has a valid value), for example:

@anvil.server.callable
def get_hardware(muid):
  rows = app_tables.assets_hardware.search(muid=muid) # here it happens
  return rows

I tried to print the columns of one of the tables and this worked, it listed all columns.

@anvil.server.callable
def test_table():
    return app_tables.assets_hardware.list_columns()

It was working an hour ago, but now I’m getting the error and I don’t know why. I deleted a table that wasn’t related to anything, but i am not sure if i did this before or after the errors occured.

Can you help me?

Grreetings, Markus

I found the cause; it was due to the deleted table, which ultimately did have an impact after all.

The deleted table was intended to store values for the legal form, which could then be saved as a linked row in a contact record. A contact record can be saved as a contractual partner (also a linked row) in a hardware record.

I deleted the table for the legal forms but forgot to update the column in the Contacts table. So this is a kind of cascading error.

Perhaps it would be possible to adjust the error message so that users receive a clearer indication (e.g., “reference missing” or similar). Because the error message displayed—stating that the Hardware table is missing—is definitely incorrect.

1 Like

That does see to be a tricky error and your alternative error message makes sense to me too! I’d make that as a feature request post so that the Anvil Staff see the request – you can link this post there too for context :slight_smile: