[Fixed] UnboundLocalError: local variable 'anvil' referenced before assignment

Hi
I am getting this error:

UnboundLocalError: local variable 'anvil' referenced before assignment

The lines referenced are this line in the server side:

@anvil.server.callable
def get_mytrips_for_user():
  user = anvil.users.get_user(allow_remembered=True)
  return app_tables.mytrips.search(User=user)

And this line in the client side:

self.manage_trips_form.repeating_panel_manage.items = anvil.server.call('get_mytrips_for_user')

It was working and now it isnt and the previous version history hasnt updated so I cant see what changed.
I would appreciate any suggestions as to where I should look?

1 Like

Having the same issue.

I think, it is a bug on the Anvil side.

1 Like

Well I found a solution. I hadnt set the sub form on the main form from .Manage import Manage but I’m not sure that was 100% it, because I’m pretty sure I had never done that when it was working, so will keep a watch on it.

Just found out that I had the same issue on Wednesday. Since it occurred within Anvil-supplied code, there are no clear steps for me to take. Hasn’t occurred since. I suspect that it occurs during the handling of other Exceptions. Either way, it’s an Anvil internal issue. If it occurs again, and I can repeat it reliably, I’ll report it.

1 Like

This was an internal bug from yesterday that shouldn’t have lasted very long, apologies for the disruption

3 Likes