I have created an Anvil app, which I host on my own server via the anvil-app-server. This application makes use of the Users addon provided by Anvil. This used to work fine, however, now with my last update I get the following error when I try to access the app in the browser:
I have not touched the user authentication logic at all, so I don’t understand why this is happening now. But I get this error every time now when I try to access the app, even in a private browser window, tried multiple browsers.
Why does the app not simply show the user login page?
It looks like at some point you are calling a server function that uses require_user, as described in Anvil Docs | Server Code That exception gets raised when the user is not logged in and that server function is called.
I understand what you mean, and I have thought about this too. However, the only server function I am calling from the main form has the @anvil.server.callable(require_user=False) decorator. So I would assume this should be fine.
Is there any way to find out where exactly this exception is being raised?
Are you using a background task for anything? It runs in a separate server environment and will not have access to a currently logged in user unless you explicitly pass the current user row to the background task and then use anvil.users.force_login(user_row) .